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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 // is responsible for cleaning up the blocking page, otherwise the | 60 // is responsible for cleaning up the blocking page, otherwise the |
61 // interstitial takes ownership when shown. |options_mask| must be a bitwise | 61 // interstitial takes ownership when shown. |options_mask| must be a bitwise |
62 // mask of SSLBlockingPageOptionsMask values. | 62 // mask of SSLBlockingPageOptionsMask values. |
63 SSLBlockingPage(content::WebContents* web_contents, | 63 SSLBlockingPage(content::WebContents* web_contents, |
64 int cert_error, | 64 int cert_error, |
65 const net::SSLInfo& ssl_info, | 65 const net::SSLInfo& ssl_info, |
66 const GURL& request_url, | 66 const GURL& request_url, |
67 int options_mask, | 67 int options_mask, |
68 const base::Time& time_triggered, | 68 const base::Time& time_triggered, |
69 scoped_ptr<SSLCertReporter> ssl_cert_reporter, | 69 scoped_ptr<SSLCertReporter> ssl_cert_reporter, |
70 const base::Callback<void(bool)>& callback); | 70 const base::Callback<void(bool)>& callback, |
71 const GURL& suggested_url); | |
71 | 72 |
72 // InterstitialPageDelegate method: | 73 // InterstitialPageDelegate method: |
73 InterstitialPageDelegate::TypeID GetTypeForTesting() const override; | 74 InterstitialPageDelegate::TypeID GetTypeForTesting() const override; |
74 | 75 |
75 // Returns true if |options_mask| refers to an overridable SSL error and | 76 // Returns true if |options_mask| refers to an overridable SSL error and |
76 // if SSL error overriding is allowed by policy. | 77 // if SSL error overriding is allowed by policy. |
77 static bool IsOverridable(int options_mask, const Profile* const profile); | 78 static bool IsOverridable(int options_mask, const Profile* const profile); |
78 | 79 |
79 static bool DoesPolicyAllowDangerOverride(const Profile* const profile); | 80 static bool DoesPolicyAllowDangerOverride(const Profile* const profile); |
80 | 81 |
(...skipping 18 matching lines...) Expand all Loading... | |
99 private: | 100 private: |
100 void NotifyDenyCertificate(); | 101 void NotifyDenyCertificate(); |
101 void NotifyAllowCertificate(); | 102 void NotifyAllowCertificate(); |
102 CertificateErrorReport::InterstitialReason GetCertReportInterstitialReason(); | 103 CertificateErrorReport::InterstitialReason GetCertReportInterstitialReason(); |
103 | 104 |
104 std::string GetUmaHistogramPrefix() const; | 105 std::string GetUmaHistogramPrefix() const; |
105 std::string GetSamplingEventName() const; | 106 std::string GetSamplingEventName() const; |
106 | 107 |
107 base::Callback<void(bool)> callback_; | 108 base::Callback<void(bool)> callback_; |
108 | 109 |
110 void NavigateToSuggestedURL() const; | |
111 | |
109 const int cert_error_; | 112 const int cert_error_; |
110 const net::SSLInfo ssl_info_; | 113 const net::SSLInfo ssl_info_; |
111 // There are two ways for the user to override an interstitial: | 114 // There are two ways for the user to override an interstitial: |
112 // | 115 // |
113 // overridable_) By clicking on "Advanced" and then "Proceed". | 116 // overridable_) By clicking on "Advanced" and then "Proceed". |
114 // - This corresponds to "the user can override using the UI". | 117 // - This corresponds to "the user can override using the UI". |
115 // danger_overridable_) By typing the word "danger". | 118 // danger_overridable_) By typing the word "danger". |
116 // - This is an undocumented workaround. | 119 // - This is an undocumented workaround. |
117 // - This can be set to "false" dynamically to prevent the behaviour. | 120 // - This can be set to "false" dynamically to prevent the behaviour. |
118 const bool overridable_; | 121 const bool overridable_; |
119 bool danger_overridable_; | 122 bool danger_overridable_; |
120 // Has the site requested strict enforcement of certificate errors? | 123 // Has the site requested strict enforcement of certificate errors? |
121 const bool strict_enforcement_; | 124 const bool strict_enforcement_; |
122 // Did the user previously allow a bad certificate but the decision has now | 125 // Did the user previously allow a bad certificate but the decision has now |
123 // expired? | 126 // expired? |
124 const bool expired_but_previously_allowed_; | 127 const bool expired_but_previously_allowed_; |
125 scoped_ptr<SSLErrorClassification> ssl_error_classification_; | 128 scoped_ptr<SSLErrorClassification> ssl_error_classification_; |
126 | 129 |
127 // The time at which the interstitial was triggered. The interstitial | 130 // The time at which the interstitial was triggered. The interstitial |
128 // calculates all times relative to this. | 131 // calculates all times relative to this. |
129 const base::Time time_triggered_; | 132 const base::Time time_triggered_; |
130 | 133 |
131 scoped_ptr<CertReportHelper> cert_report_helper_; | 134 scoped_ptr<CertReportHelper> cert_report_helper_; |
132 | 135 |
136 // Guide the user to this url, when there is a common name mismatch error | |
palmer
2015/07/17 00:16:00
Nit: URL
Bhanu Dev
2015/07/23 20:11:06
Done.
| |
137 // and it can be handled. | |
138 const GURL suggested_url_; | |
139 | |
133 // Which type of interstitial this is. | 140 // Which type of interstitial this is. |
134 enum SSLInterstitialReason { | 141 enum SSLInterstitialReason { |
135 SSL_REASON_SSL, | 142 SSL_REASON_SSL, |
136 SSL_REASON_BAD_CLOCK | 143 SSL_REASON_BAD_CLOCK |
137 } interstitial_reason_; | 144 } interstitial_reason_; |
138 | 145 |
139 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); | 146 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); |
140 }; | 147 }; |
141 | 148 |
142 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ | 149 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
OLD | NEW |