blob: 8924c48fb5056abb5922ff6b88fc9b5ac2f10cd6 [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;
18}
19
20namespace weblayer {
21
22// A stripped-down version of the class by the same name in
23// //chrome/browser/ssl, which provides basic functionality for interacting with
24// the SSL interstitial.
25class SSLErrorControllerClient
26 : public security_interstitials::SecurityInterstitialControllerClient {
27 public:
28 SSLErrorControllerClient(
29 content::WebContents* web_contents,
30 int cert_error,
31 const net::SSLInfo& ssl_info,
32 const GURL& request_url,
33 std::unique_ptr<security_interstitials::MetricsHelper> metrics_helper);
34
35 ~SSLErrorControllerClient() override = default;
36
37 // security_interstitials::SecurityInterstitialControllerClient:
38 void GoBack() override;
39 void Proceed() override;
40 void OpenUrlInNewForegroundTab(const GURL& url) override;
Colin Blundell40121f82020-01-10 15:01:5041 bool CanLaunchDateAndTimeSettings() override;
Colin Blundell0c25cae2020-02-12 14:33:2742 void LaunchDateAndTimeSettings() override;
Colin Blundell2ae70152019-11-25 12:32:3143
44 private:
45 const int cert_error_;
46 const net::SSLInfo ssl_info_;
47 const GURL request_url_;
48
49 DISALLOW_COPY_AND_ASSIGN(SSLErrorControllerClient);
50};
51
52} // namespace weblayer
53
54#endif // WEBLAYER_BROWSER_SSL_ERROR_CONTROLLER_CLIENT_H_