OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SSL_CAPTIVE_PORTAL_BLOCKING_PAGE_H_ | 5 #ifndef CHROME_BROWSER_SSL_CAPTIVE_PORTAL_BLOCKING_PAGE_H_ |
6 #define CHROME_BROWSER_SSL_CAPTIVE_PORTAL_BLOCKING_PAGE_H_ | 6 #define CHROME_BROWSER_SSL_CAPTIVE_PORTAL_BLOCKING_PAGE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "chrome/browser/interstitials/security_interstitial_page.h" | |
14 #include "chrome/common/features.h" | 13 #include "chrome/common/features.h" |
| 14 #include "components/security_interstitials/content/security_interstitial_page.h
" |
15 #include "content/public/browser/certificate_request_result_type.h" | 15 #include "content/public/browser/certificate_request_result_type.h" |
16 #include "net/ssl/ssl_info.h" | 16 #include "net/ssl/ssl_info.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 #if !BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) | 19 #if !BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) |
20 #error This file must be built with ENABLE_CAPTIVE_PORTAL_DETECTION flag. | 20 #error This file must be built with ENABLE_CAPTIVE_PORTAL_DETECTION flag. |
21 #endif | 21 #endif |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 class NavigationEntry; | 24 class NavigationEntry; |
25 class WebContents; | 25 class WebContents; |
26 } | 26 } |
27 | 27 |
28 namespace net { | 28 namespace net { |
29 class SSLInfo; | 29 class SSLInfo; |
30 } | 30 } |
31 | 31 |
32 class CertReportHelper; | 32 class CertReportHelper; |
33 class SSLCertReporter; | 33 class SSLCertReporter; |
34 | 34 |
35 // This class is responsible for showing/hiding the interstitial page that is | 35 // This class is responsible for showing/hiding the interstitial page that is |
36 // shown when a captive portal triggers an SSL error. | 36 // shown when a captive portal triggers an SSL error. |
37 // It deletes itself when the interstitial page is closed. | 37 // It deletes itself when the interstitial page is closed. |
38 // | 38 // |
39 // This class should only be used on the UI thread because its implementation | 39 // This class should only be used on the UI thread because its implementation |
40 // uses captive_portal::CaptivePortalService, which can only be accessed on the | 40 // uses captive_portal::CaptivePortalService, which can only be accessed on the |
41 // UI thread. Only used when ENABLE_CAPTIVE_PORTAL_DETECTION is true. | 41 // UI thread. Only used when ENABLE_CAPTIVE_PORTAL_DETECTION is true. |
42 class CaptivePortalBlockingPage : public SecurityInterstitialPage { | 42 class CaptivePortalBlockingPage |
| 43 : public security_interstitials::SecurityInterstitialPage { |
43 public: | 44 public: |
44 // Interstitial type, for testing. | 45 // Interstitial type, for testing. |
45 static const void* const kTypeForTesting; | 46 static const void* const kTypeForTesting; |
46 | 47 |
47 CaptivePortalBlockingPage( | 48 CaptivePortalBlockingPage( |
48 content::WebContents* web_contents, | 49 content::WebContents* web_contents, |
49 const GURL& request_url, | 50 const GURL& request_url, |
50 const GURL& login_url, | 51 const GURL& login_url, |
51 std::unique_ptr<SSLCertReporter> ssl_cert_reporter, | 52 std::unique_ptr<SSLCertReporter> ssl_cert_reporter, |
52 const net::SSLInfo& ssl_info, | 53 const net::SSLInfo& ssl_info, |
(...skipping 25 matching lines...) Expand all Loading... |
78 // URL of the login page, opened when the user clicks the "Connect" button. | 79 // URL of the login page, opened when the user clicks the "Connect" button. |
79 const GURL login_url_; | 80 const GURL login_url_; |
80 std::unique_ptr<CertReportHelper> cert_report_helper_; | 81 std::unique_ptr<CertReportHelper> cert_report_helper_; |
81 const net::SSLInfo ssl_info_; | 82 const net::SSLInfo ssl_info_; |
82 base::Callback<void(content::CertificateRequestResultType)> callback_; | 83 base::Callback<void(content::CertificateRequestResultType)> callback_; |
83 | 84 |
84 DISALLOW_COPY_AND_ASSIGN(CaptivePortalBlockingPage); | 85 DISALLOW_COPY_AND_ASSIGN(CaptivePortalBlockingPage); |
85 }; | 86 }; |
86 | 87 |
87 #endif // CHROME_BROWSER_SSL_CAPTIVE_PORTAL_BLOCKING_PAGE_H_ | 88 #endif // CHROME_BROWSER_SSL_CAPTIVE_PORTAL_BLOCKING_PAGE_H_ |
OLD | NEW |