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 // Navigate to |suggested_url| when user clicks the link. |
| 111 void OpenSuggestedURL() const; |
| 112 |
109 const int cert_error_; | 113 const int cert_error_; |
110 const net::SSLInfo ssl_info_; | 114 const net::SSLInfo ssl_info_; |
111 // There are two ways for the user to override an interstitial: | 115 // There are two ways for the user to override an interstitial: |
112 // | 116 // |
113 // overridable_) By clicking on "Advanced" and then "Proceed". | 117 // overridable_) By clicking on "Advanced" and then "Proceed". |
114 // - This corresponds to "the user can override using the UI". | 118 // - This corresponds to "the user can override using the UI". |
115 // danger_overridable_) By typing the word "danger". | 119 // danger_overridable_) By typing the word "danger". |
116 // - This is an undocumented workaround. | 120 // - This is an undocumented workaround. |
117 // - This can be set to "false" dynamically to prevent the behaviour. | 121 // - This can be set to "false" dynamically to prevent the behaviour. |
118 const bool overridable_; | 122 const bool overridable_; |
119 bool danger_overridable_; | 123 bool danger_overridable_; |
120 // Has the site requested strict enforcement of certificate errors? | 124 // Has the site requested strict enforcement of certificate errors? |
121 const bool strict_enforcement_; | 125 const bool strict_enforcement_; |
122 // Did the user previously allow a bad certificate but the decision has now | 126 // Did the user previously allow a bad certificate but the decision has now |
123 // expired? | 127 // expired? |
124 const bool expired_but_previously_allowed_; | 128 const bool expired_but_previously_allowed_; |
125 scoped_ptr<SSLErrorClassification> ssl_error_classification_; | 129 scoped_ptr<SSLErrorClassification> ssl_error_classification_; |
126 | 130 |
127 // The time at which the interstitial was triggered. The interstitial | 131 // The time at which the interstitial was triggered. The interstitial |
128 // calculates all times relative to this. | 132 // calculates all times relative to this. |
129 const base::Time time_triggered_; | 133 const base::Time time_triggered_; |
130 | 134 |
131 scoped_ptr<CertReportHelper> cert_report_helper_; | 135 scoped_ptr<CertReportHelper> cert_report_helper_; |
132 | 136 |
| 137 // Guide the user to this URL, when there is a common name mismatch error |
| 138 // and it can be handled. |
| 139 const GURL suggested_url_; |
| 140 |
133 // Which type of interstitial this is. | 141 // Which type of interstitial this is. |
134 enum SSLInterstitialReason { | 142 enum SSLInterstitialReason { |
135 SSL_REASON_SSL, | 143 SSL_REASON_SSL, |
136 SSL_REASON_BAD_CLOCK | 144 SSL_REASON_BAD_CLOCK |
137 } interstitial_reason_; | 145 } interstitial_reason_; |
138 | 146 |
139 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); | 147 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); |
140 }; | 148 }; |
141 | 149 |
142 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ | 150 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
OLD | NEW |