OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/security_interstitials/core/ssl_error_ui.h" | 5 #include "components/security_interstitials/core/ssl_error_ui.h" |
6 | 6 |
7 #include "base/i18n/time_formatting.h" | 7 #include "base/i18n/time_formatting.h" |
8 #include "components/security_interstitials/core/common_string_util.h" | 8 #include "components/security_interstitials/core/common_string_util.h" |
9 #include "components/security_interstitials/core/metrics_helper.h" | 9 #include "components/security_interstitials/core/metrics_helper.h" |
10 #include "components/ssl_errors/error_classification.h" | 10 #include "components/ssl_errors/error_classification.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 l10n_util::GetStringFUTF16( | 79 l10n_util::GetStringFUTF16( |
80 IDS_SSL_V2_PRIMARY_PARAGRAPH, | 80 IDS_SSL_V2_PRIMARY_PARAGRAPH, |
81 common_string_util::GetFormattedHostName(request_url_))); | 81 common_string_util::GetFormattedHostName(request_url_))); |
82 | 82 |
83 if (soft_override_enabled_) | 83 if (soft_override_enabled_) |
84 PopulateOverridableStrings(load_time_data); | 84 PopulateOverridableStrings(load_time_data); |
85 else | 85 else |
86 PopulateNonOverridableStrings(load_time_data); | 86 PopulateNonOverridableStrings(load_time_data); |
87 } | 87 } |
88 | 88 |
| 89 const net::SSLInfo& SSLErrorUI::ssl_info() const { |
| 90 return ssl_info_; |
| 91 } |
| 92 |
| 93 const base::Time& SSLErrorUI::time_triggered() const { |
| 94 return time_triggered_; |
| 95 } |
| 96 |
| 97 ControllerClient* SSLErrorUI::controller() const { |
| 98 return controller_; |
| 99 } |
| 100 |
89 void SSLErrorUI::PopulateOverridableStrings( | 101 void SSLErrorUI::PopulateOverridableStrings( |
90 base::DictionaryValue* load_time_data) { | 102 base::DictionaryValue* load_time_data) { |
91 DCHECK(soft_override_enabled_); | 103 DCHECK(soft_override_enabled_); |
92 | 104 |
93 base::string16 url(common_string_util::GetFormattedHostName(request_url_)); | 105 base::string16 url(common_string_util::GetFormattedHostName(request_url_)); |
94 ssl_errors::ErrorInfo error_info = ssl_errors::ErrorInfo::CreateError( | 106 ssl_errors::ErrorInfo error_info = ssl_errors::ErrorInfo::CreateError( |
95 ssl_errors::ErrorInfo::NetErrorToErrorType(cert_error_), | 107 ssl_errors::ErrorInfo::NetErrorToErrorType(cert_error_), |
96 ssl_info_.cert.get(), request_url_); | 108 ssl_info_.cert.get(), request_url_); |
97 | 109 |
98 load_time_data->SetBoolean("overridable", true); | 110 load_time_data->SetBoolean("overridable", true); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 NOTREACHED() << "Unsupported command: " << command; | 207 NOTREACHED() << "Unsupported command: " << command; |
196 case CMD_ERROR: | 208 case CMD_ERROR: |
197 case CMD_TEXT_FOUND: | 209 case CMD_TEXT_FOUND: |
198 case CMD_TEXT_NOT_FOUND: | 210 case CMD_TEXT_NOT_FOUND: |
199 // Commands are for testing. | 211 // Commands are for testing. |
200 break; | 212 break; |
201 } | 213 } |
202 } | 214 } |
203 | 215 |
204 } // security_interstitials | 216 } // security_interstitials |
OLD | NEW |