OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SSL_BLOCKING_PAGE_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
6 #define CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ | 6 #define CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... | |
41 // DO NOT reorder or change these without also changing the JavaScript! | 41 // DO NOT reorder or change these without also changing the JavaScript! |
42 enum SSLBlockingPageCommands { | 42 enum SSLBlockingPageCommands { |
43 CMD_DONT_PROCEED = 0, | 43 CMD_DONT_PROCEED = 0, |
44 CMD_PROCEED = 1, | 44 CMD_PROCEED = 1, |
45 CMD_MORE = 2, | 45 CMD_MORE = 2, |
46 CMD_RELOAD = 3, | 46 CMD_RELOAD = 3, |
47 CMD_HELP = 4, | 47 CMD_HELP = 4, |
48 CMD_CLOCK = 5 | 48 CMD_CLOCK = 5 |
49 }; | 49 }; |
50 | 50 |
51 enum SSLBlockingPageOptionsMask { | |
52 OVERRIDABLE = 1 << 0, | |
53 STRICT_ENFORCEMENT = 1 << 1, | |
54 EXPIRED_BUT_PREVIOUSLY_ALLOWED = 1 << 2 | |
55 }; | |
56 | |
51 virtual ~SSLBlockingPage(); | 57 virtual ~SSLBlockingPage(); |
52 | 58 |
53 // Create an interstitial and show it. | 59 // Create an interstitial and show it. |
54 void Show(); | 60 void Show(); |
55 | 61 |
56 // Creates an SSL blocking page. If the blocking page isn't shown, the caller | 62 // Creates an SSL blocking page. If the blocking page isn't shown, the caller |
57 // is responsible for cleaning up the blocking page, otherwise the | 63 // is responsible for cleaning up the blocking page, otherwise the |
58 // interstitial takes ownership when shown. | 64 // interstitial takes ownership when shown. |options_mask| must be a bitwise |
59 SSLBlockingPage( | 65 // mask of SSLBlockingPageOptionsMask values. |
60 content::WebContents* web_contents, | 66 SSLBlockingPage(content::WebContents* web_contents, |
61 int cert_error, | 67 int cert_error, |
62 const net::SSLInfo& ssl_info, | 68 const net::SSLInfo& ssl_info, |
63 const GURL& request_url, | 69 const GURL& request_url, |
64 bool overridable, | 70 int options_mask, |
65 bool strict_enforcement, | 71 const base::Callback<void(bool)>& callback); |
66 const base::Callback<void(bool)>& callback); | |
67 | 72 |
68 // A method that sets strings in the specified dictionary from the passed | 73 // A method that sets strings in the specified dictionary from the passed |
69 // vector so that they can be used to resource the ssl_roadblock.html/ | 74 // vector so that they can be used to resource the ssl_roadblock.html/ |
70 // ssl_error.html files. | 75 // ssl_error.html files. |
71 // Note: there can be up to 5 strings in |extra_info|. | 76 // Note: there can be up to 5 strings in |extra_info|. |
72 static void SetExtraInfo(base::DictionaryValue* strings, | 77 static void SetExtraInfo(base::DictionaryValue* strings, |
73 const std::vector<base::string16>& extra_info); | 78 const std::vector<base::string16>& extra_info); |
74 | 79 |
75 protected: | 80 protected: |
76 // InterstitialPageDelegate implementation. | 81 // InterstitialPageDelegate implementation. |
(...skipping 14 matching lines...) Expand all Loading... | |
91 | 96 |
92 // content::NotificationObserver: | 97 // content::NotificationObserver: |
93 virtual void Observe( | 98 virtual void Observe( |
94 int type, | 99 int type, |
95 const content::NotificationSource& source, | 100 const content::NotificationSource& source, |
96 const content::NotificationDetails& details) OVERRIDE; | 101 const content::NotificationDetails& details) OVERRIDE; |
97 | 102 |
98 base::Callback<void(bool)> callback_; | 103 base::Callback<void(bool)> callback_; |
99 | 104 |
100 content::WebContents* web_contents_; | 105 content::WebContents* web_contents_; |
101 int cert_error_; | 106 const int cert_error_; |
102 const net::SSLInfo ssl_info_; | 107 const net::SSLInfo ssl_info_; |
103 GURL request_url_; | 108 const GURL request_url_; |
104 // Could the user successfully override the error? | 109 // Could the user successfully override the error? |
105 bool overridable_; | 110 const bool overridable_; |
felt
2014/08/12 19:37:34
overridable_ can't be const, its value might chang
| |
106 // Has the site requested strict enforcement of certificate errors? | 111 // Has the site requested strict enforcement of certificate errors? |
107 bool strict_enforcement_; | 112 const bool strict_enforcement_; |
108 content::InterstitialPage* interstitial_page_; // Owns us. | 113 content::InterstitialPage* interstitial_page_; // Owns us. |
109 // Is the hostname for an internal network? | 114 // Is the hostname for an internal network? |
110 bool internal_; | 115 bool internal_; |
111 // How many times is this same URL in history? | 116 // How many times is this same URL in history? |
112 int num_visits_; | 117 int num_visits_; |
113 // Used for getting num_visits_. | 118 // Used for getting num_visits_. |
114 base::CancelableTaskTracker request_tracker_; | 119 base::CancelableTaskTracker request_tracker_; |
115 // Is captive portal detection enabled? | 120 // Is captive portal detection enabled? |
116 bool captive_portal_detection_enabled_; | 121 bool captive_portal_detection_enabled_; |
117 // Did the probe complete before the interstitial was closed? | 122 // Did the probe complete before the interstitial was closed? |
118 bool captive_portal_probe_completed_; | 123 bool captive_portal_probe_completed_; |
119 // Did the captive portal probe receive an error or get a non-HTTP response? | 124 // Did the captive portal probe receive an error or get a non-HTTP response? |
120 bool captive_portal_no_response_; | 125 bool captive_portal_no_response_; |
121 // Was a captive portal detected? | 126 // Was a captive portal detected? |
122 bool captive_portal_detected_; | 127 bool captive_portal_detected_; |
128 // Did the user previously allow a bad certificate but the decision has now | |
129 // expired? | |
130 const bool expired_but_previously_allowed_; | |
123 | 131 |
124 content::NotificationRegistrar registrar_; | 132 content::NotificationRegistrar registrar_; |
125 | 133 |
126 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); | 134 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); |
127 }; | 135 }; |
128 | 136 |
129 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ | 137 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
OLD | NEW |