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 #include "chrome/browser/ssl/ssl_blocking_page.h" | 5 #include "chrome/browser/ssl/ssl_blocking_page.h" |
6 | 6 |
7 #include "base/build_time.h" | 7 #include "base/build_time.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 uma_helper_->RecordUserInteraction( | 240 uma_helper_->RecordUserInteraction( |
241 SecurityInterstitialUmaHelper::TOTAL_VISITS); | 241 SecurityInterstitialUmaHelper::TOTAL_VISITS); |
242 | 242 |
243 ssl_error_classification_.reset(new SSLErrorClassification( | 243 ssl_error_classification_.reset(new SSLErrorClassification( |
244 web_contents, | 244 web_contents, |
245 base::Time::NowFromSystemTime(), | 245 base::Time::NowFromSystemTime(), |
246 request_url, | 246 request_url, |
247 cert_error_, | 247 cert_error_, |
248 *ssl_info_.cert.get())); | 248 *ssl_info_.cert.get())); |
249 ssl_error_classification_->RecordUMAStatistics(overridable_); | 249 ssl_error_classification_->RecordUMAStatistics(overridable_); |
250 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | |
251 ssl_error_classification_->RecordCaptivePortalUMAStatistics(overridable_); | |
252 #endif | |
253 | 250 |
254 // Creating an interstitial without showing (e.g. from chrome://interstitials) | 251 // Creating an interstitial without showing (e.g. from chrome://interstitials) |
255 // it leaks memory, so don't create it here. | 252 // it leaks memory, so don't create it here. |
256 } | 253 } |
257 | 254 |
258 bool SSLBlockingPage::ShouldCreateNewNavigation() const { | 255 bool SSLBlockingPage::ShouldCreateNewNavigation() const { |
259 return true; | 256 return true; |
260 } | 257 } |
261 | 258 |
262 const void* SSLBlockingPage::GetTypeForTesting() const { | 259 const void* SSLBlockingPage::GetTypeForTesting() const { |
263 return SSLBlockingPage::kTypeForTesting; | 260 return SSLBlockingPage::kTypeForTesting; |
264 } | 261 } |
265 | 262 |
266 SSLBlockingPage::~SSLBlockingPage() { | 263 SSLBlockingPage::~SSLBlockingPage() { |
| 264 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| 265 // Captive portal detection results can arrive anytime during the interstitial |
| 266 // is being displayed, so record it when the interstitial is going away. |
| 267 ssl_error_classification_->RecordCaptivePortalUMAStatistics(overridable_); |
| 268 #endif |
267 if (!callback_.is_null()) { | 269 if (!callback_.is_null()) { |
268 // The page is closed without the user having chosen what to do, default to | 270 // The page is closed without the user having chosen what to do, default to |
269 // deny. | 271 // deny. |
270 uma_helper_->RecordUserDecision( | 272 uma_helper_->RecordUserDecision( |
271 SecurityInterstitialUmaHelper::DONT_PROCEED); | 273 SecurityInterstitialUmaHelper::DONT_PROCEED); |
272 RecordSSLExpirationPageEventState( | 274 RecordSSLExpirationPageEventState( |
273 expired_but_previously_allowed_, false, overridable_); | 275 expired_but_previously_allowed_, false, overridable_); |
274 NotifyDenyCertificate(); | 276 NotifyDenyCertificate(); |
275 } | 277 } |
276 } | 278 } |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 event_name.append(kEventNotOverridable); | 548 event_name.append(kEventNotOverridable); |
547 event_name.append(net::ErrorToString(cert_error_)); | 549 event_name.append(net::ErrorToString(cert_error_)); |
548 return event_name; | 550 return event_name; |
549 } | 551 } |
550 | 552 |
551 // static | 553 // static |
552 bool SSLBlockingPage::IsOptionsOverridable(int options_mask) { | 554 bool SSLBlockingPage::IsOptionsOverridable(int options_mask) { |
553 return (options_mask & SSLBlockingPage::OVERRIDABLE) && | 555 return (options_mask & SSLBlockingPage::OVERRIDABLE) && |
554 !(options_mask & SSLBlockingPage::STRICT_ENFORCEMENT); | 556 !(options_mask & SSLBlockingPage::STRICT_ENFORCEMENT); |
555 } | 557 } |
OLD | NEW |