OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_SSL_CAPTIVE_PORTAL_BLOCKING_PAGE_H_ | |
6 #define CHROME_BROWSER_SSL_CAPTIVE_PORTAL_BLOCKING_PAGE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/callback.h" | |
11 #include "base/macros.h" | |
12 #include "chrome/browser/interstitials/security_interstitial_page.h" | |
13 | |
14 class GURL; | |
15 | |
16 namespace content{ | |
17 class WebContents; | |
18 } | |
19 | |
20 // This class is responsible for showing/hiding the interstitial page that is | |
21 // shown when a captive portal and an SSL error is detected. | |
felt
2014/12/28 15:40:52
nit: "...that is shown when a captive portal trigg
meacer
2015/01/08 14:29:16
Done.
| |
22 // It deletes itself when the interstitial page is closed. | |
23 // | |
24 // This class should only be used on the UI thread because its implementation | |
25 // uses captive_portal::CaptivePortalService, which can only be accessed on the | |
26 // UI thread. Only used when ENABLE_CAPTIVE_PORTAL_DETECTION is true. | |
27 class CaptivePortalBlockingPage : public SecurityInterstitialPage { | |
28 public: | |
29 // Interstitial type, for testing. | |
30 static const void* kTypeForTesting; | |
felt
2014/12/28 15:40:52
If this is only for testing, can it be protected o
meacer
2015/01/08 14:29:16
If we do this, then we should do the same for SSLB
felt
2015/01/08 16:47:44
Yeah, no need to do it here but I generally think
Bernhard Bauer
2015/01/08 17:25:13
If you actually name it ...ForTesting, there's a p
| |
31 | |
32 CaptivePortalBlockingPage(content::WebContents* web_contents, | |
33 const GURL& request_url, | |
34 const base::Callback<void(bool)>& callback); | |
35 ~CaptivePortalBlockingPage() override; | |
36 | |
37 // SecurityInterstitialPage method: | |
38 const void* GetTypeForTesting() const override; | |
39 | |
40 protected: | |
41 // SecurityInterstitialPage methods: | |
42 void PopulateInterstitialStrings( | |
43 base::DictionaryValue* load_time_data) override; | |
44 bool ShouldCreateNewNavigation() const override; | |
45 | |
46 // InterstitialPageDelegate method: | |
47 void CommandReceived(const std::string& command) override; | |
48 | |
49 private: | |
50 base::Callback<void(bool)> callback_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(CaptivePortalBlockingPage); | |
53 }; | |
54 | |
55 #endif // CHROME_BROWSER_SSL_CAPTIVE_PORTAL_BLOCKING_PAGE_H_ | |
OLD | NEW |