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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 // Creates an SSL blocking page. If the blocking page isn't shown, the caller | 64 // Creates an SSL blocking page. If the blocking page isn't shown, the caller |
65 // is responsible for cleaning up the blocking page, otherwise the | 65 // is responsible for cleaning up the blocking page, otherwise the |
66 // interstitial takes ownership when shown. |options_mask| must be a bitwise | 66 // interstitial takes ownership when shown. |options_mask| must be a bitwise |
67 // mask of SSLBlockingPageOptionsMask values. | 67 // mask of SSLBlockingPageOptionsMask values. |
68 SSLBlockingPage(content::WebContents* web_contents, | 68 SSLBlockingPage(content::WebContents* web_contents, |
69 int cert_error, | 69 int cert_error, |
70 const net::SSLInfo& ssl_info, | 70 const net::SSLInfo& ssl_info, |
71 const GURL& request_url, | 71 const GURL& request_url, |
72 int options_mask, | 72 int options_mask, |
73 const base::Callback<void(bool)>& callback); | 73 const base::Callback<void(bool)>& callback, |
| 74 const base::Time& base_time); |
74 | 75 |
75 // SecurityInterstitialPage method: | 76 // SecurityInterstitialPage method: |
76 const void* GetTypeForTesting() const override; | 77 const void* GetTypeForTesting() const override; |
77 | 78 |
78 // Returns true if |options_mask| refers to an overridable SSL error. | 79 // Returns true if |options_mask| refers to an overridable SSL error. |
79 static bool IsOptionsOverridable(int options_mask); | 80 static bool IsOptionsOverridable(int options_mask); |
80 | 81 |
81 protected: | 82 protected: |
82 // InterstitialPageDelegate implementation. | 83 // InterstitialPageDelegate implementation. |
83 void CommandReceived(const std::string& command) override; | 84 void CommandReceived(const std::string& command) override; |
(...skipping 27 matching lines...) Expand all Loading... |
111 // - This can be set to "false" dynamically to prevent the behaviour. | 112 // - This can be set to "false" dynamically to prevent the behaviour. |
112 const bool overridable_; | 113 const bool overridable_; |
113 bool danger_overridable_; | 114 bool danger_overridable_; |
114 // Has the site requested strict enforcement of certificate errors? | 115 // Has the site requested strict enforcement of certificate errors? |
115 const bool strict_enforcement_; | 116 const bool strict_enforcement_; |
116 // Did the user previously allow a bad certificate but the decision has now | 117 // Did the user previously allow a bad certificate but the decision has now |
117 // expired? | 118 // expired? |
118 const bool expired_but_previously_allowed_; | 119 const bool expired_but_previously_allowed_; |
119 scoped_ptr<SSLErrorClassification> ssl_error_classification_; | 120 scoped_ptr<SSLErrorClassification> ssl_error_classification_; |
120 scoped_ptr<SecurityInterstitialMetricsHelper> metrics_helper_; | 121 scoped_ptr<SecurityInterstitialMetricsHelper> metrics_helper_; |
| 122 // The interstitial is supposed to use this for all time-based calculations |
| 123 const base::Time time_triggered_; |
121 | 124 |
122 // Which type of interstitial this is. | 125 // Which type of interstitial this is. |
123 enum SSLInterstitialReason { | 126 enum SSLInterstitialReason { |
124 SSL_REASON_SSL, | 127 SSL_REASON_SSL, |
125 SSL_REASON_BAD_CLOCK | 128 SSL_REASON_BAD_CLOCK |
126 } interstitial_reason_; | 129 } interstitial_reason_; |
127 | 130 |
128 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); | 131 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); |
129 }; | 132 }; |
130 | 133 |
131 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ | 134 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
OLD | NEW |