blob: 1d7ba47125a71a5f768f02465a642aa4d87fe657 [file] [log] [blame]
Colin Blundell2ae70152019-11-25 12:32:311// Copyright 2019 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
5#ifndef WEBLAYER_BROWSER_SSL_ERROR_CONTROLLER_CLIENT_H_
6#define WEBLAYER_BROWSER_SSL_ERROR_CONTROLLER_CLIENT_H_
7
8#include "components/security_interstitials/content/security_interstitial_controller_client.h"
9#include "net/ssl/ssl_info.h"
10#include "url/gurl.h"
11
12namespace content {
13class WebContents;
14}
15
16namespace security_interstitials {
17class MetricsHelper;
Xinghui Lu74f0391a2020-10-12 20:35:3118class SettingsPageHelper;
Colin Blundell2ae70152019-11-25 12:32:3119}
20
21namespace weblayer {
22
23// A stripped-down version of the class by the same name in
24// //chrome/browser/ssl, which provides basic functionality for interacting with
25// the SSL interstitial.
26class SSLErrorControllerClient
27 : public security_interstitials::SecurityInterstitialControllerClient {
28 public:
29 SSLErrorControllerClient(
30 content::WebContents* web_contents,
31 int cert_error,
32 const net::SSLInfo& ssl_info,
33 const GURL& request_url,
Xinghui Lu74f0391a2020-10-12 20:35:3134 std::unique_ptr<security_interstitials::MetricsHelper> metrics_helper,
35 std::unique_ptr<security_interstitials::SettingsPageHelper>
36 settings_page_helper);
Colin Blundell2ae70152019-11-25 12:32:3137
38 ~SSLErrorControllerClient() override = default;
39
40 // security_interstitials::SecurityInterstitialControllerClient:
41 void GoBack() override;
42 void Proceed() override;
43 void OpenUrlInNewForegroundTab(const GURL& url) override;
Colin Blundell40121f82020-01-10 15:01:5044 bool CanLaunchDateAndTimeSettings() override;
Colin Blundell0c25cae2020-02-12 14:33:2745 void LaunchDateAndTimeSettings() override;
Colin Blundell2ae70152019-11-25 12:32:3146
47 private:
48 const int cert_error_;
49 const net::SSLInfo ssl_info_;
50 const GURL request_url_;
51
52 DISALLOW_COPY_AND_ASSIGN(SSLErrorControllerClient);
53};
54
55} // namespace weblayer
56
57#endif // WEBLAYER_BROWSER_SSL_ERROR_CONTROLLER_CLIENT_H_