Colin Blundell | 2ae7015 | 2019-11-25 12:32:31 | [diff] [blame] | 1 | // 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 | |
| 12 | namespace content { |
| 13 | class WebContents; |
| 14 | } |
| 15 | |
| 16 | namespace security_interstitials { |
| 17 | class MetricsHelper; |
| 18 | } |
| 19 | |
| 20 | namespace 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. |
| 25 | class 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 Blundell | 40121f8 | 2020-01-10 15:01:50 | [diff] [blame] | 41 | bool CanLaunchDateAndTimeSettings() override; |
Colin Blundell | 0c25cae | 2020-02-12 14:33:27 | [diff] [blame] | 42 | void LaunchDateAndTimeSettings() override; |
Colin Blundell | 2ae7015 | 2019-11-25 12:32:31 | [diff] [blame] | 43 | |
| 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_ |