insecure_form_controller_client.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2020 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 WEBLAYER_BROWSER_INSECURE_FORM_CONTROLLER_CLIENT_H_
  5. #define WEBLAYER_BROWSER_INSECURE_FORM_CONTROLLER_CLIENT_H_
  6. #include "base/memory/raw_ptr.h"
  7. #include "components/security_interstitials/content/security_interstitial_controller_client.h"
  8. #include "components/security_interstitials/core/metrics_helper.h"
  9. namespace content {
  10. class WebContents;
  11. }
  12. namespace weblayer {
  13. // A stripped-down version of the class by the same name in
  14. // //chrome/browser/ssl, which provides basic functionality for interacting with
  15. // the insecure form interstitial.
  16. class InsecureFormControllerClient
  17. : public security_interstitials::SecurityInterstitialControllerClient {
  18. public:
  19. static std::unique_ptr<security_interstitials::MetricsHelper>
  20. GetMetricsHelper(const GURL& url);
  21. static std::unique_ptr<security_interstitials::SettingsPageHelper>
  22. GetSettingsPageHelper();
  23. InsecureFormControllerClient(content::WebContents* web_contents,
  24. const GURL& form_target_url);
  25. InsecureFormControllerClient(const InsecureFormControllerClient&) = delete;
  26. InsecureFormControllerClient& operator=(const InsecureFormControllerClient&) =
  27. delete;
  28. ~InsecureFormControllerClient() override;
  29. // security_interstitials::SecurityInterstitialControllerClient:
  30. void GoBack() override;
  31. void Proceed() override;
  32. private:
  33. raw_ptr<content::WebContents> web_contents_;
  34. };
  35. } // namespace weblayer
  36. #endif // WEBLAYER_BROWSER_INSECURE_FORM_CONTROLLER_CLIENT_H_