mitm_software_ui.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_SECURITY_INTERSTITIALS_CORE_MITM_SOFTWARE_UI_H_
  5. #define COMPONENTS_SECURITY_INTERSTITIALS_CORE_MITM_SOFTWARE_UI_H_
  6. #include "base/memory/raw_ptr.h"
  7. #include "base/values.h"
  8. #include "components/security_interstitials/core/controller_client.h"
  9. #include "components/ssl_errors/error_classification.h"
  10. #include "net/ssl/ssl_info.h"
  11. #include "url/gurl.h"
  12. namespace security_interstitials {
  13. // Provides UI for SSL errors caused by MITM software misconfigurations.
  14. class MITMSoftwareUI {
  15. public:
  16. MITMSoftwareUI(const GURL& request_url,
  17. int cert_error,
  18. const net::SSLInfo& ssl_info,
  19. const std::string& mitm_software_name,
  20. bool is_enterprise_managed,
  21. ControllerClient* controller_);
  22. MITMSoftwareUI(const MITMSoftwareUI&) = delete;
  23. MITMSoftwareUI& operator=(const MITMSoftwareUI&) = delete;
  24. ~MITMSoftwareUI();
  25. void PopulateStringsForHTML(base::Value::Dict& load_time_data);
  26. void HandleCommand(SecurityInterstitialCommand command);
  27. protected:
  28. void PopulateEnterpriseUserStringsForHTML(base::Value::Dict& load_time_data);
  29. void PopulateAtHomeUserStringsForHTML(base::Value::Dict& load_time_data);
  30. private:
  31. const GURL request_url_;
  32. const int cert_error_;
  33. const net::SSLInfo ssl_info_;
  34. const std::string mitm_software_name_;
  35. const bool is_enterprise_managed_;
  36. raw_ptr<ControllerClient> controller_;
  37. };
  38. } // namespace security_interstitials
  39. #endif // COMPONENTS_SECURITY_INTERSTITIALS_CORE_MITM_SOFTWARE_UI_H_