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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 HistoryService* history_service = HistoryServiceFactory::GetForProfile( | 339 HistoryService* history_service = HistoryServiceFactory::GetForProfile( |
340 profile, Profile::EXPLICIT_ACCESS); | 340 profile, Profile::EXPLICIT_ACCESS); |
341 if (history_service) { | 341 if (history_service) { |
342 history_service->GetVisibleVisitCountToHost( | 342 history_service->GetVisibleVisitCountToHost( |
343 request_url_, | 343 request_url_, |
344 base::Bind(&SSLBlockingPage::OnGotHistoryCount, | 344 base::Bind(&SSLBlockingPage::OnGotHistoryCount, |
345 base::Unretained(this)), | 345 base::Unretained(this)), |
346 &request_tracker_); | 346 &request_tracker_); |
347 } | 347 } |
348 } | 348 } |
349 if (SSLErrorInfo::NetErrorToErrorType(cert_error_) == | 349 |
350 SSLErrorInfo::CERT_DATE_INVALID) { | 350 SSLErrorClassification ssl_error_classification( |
351 SSLErrorClassification::RecordUMAStatistics(overridable_ && | 351 base::Time::NowFromSystemTime(), |
352 !strict_enforcement_); | 352 request_url_, |
353 } | 353 *ssl_info_.cert.get()); |
| 354 ssl_error_classification.RecordUMAStatistics( |
| 355 overridable_ && !strict_enforcement_, cert_error_); |
354 | 356 |
355 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 357 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
356 CaptivePortalService* captive_portal_service = | 358 CaptivePortalService* captive_portal_service = |
357 CaptivePortalServiceFactory::GetForProfile(profile); | 359 CaptivePortalServiceFactory::GetForProfile(profile); |
358 captive_portal_detection_enabled_ = captive_portal_service ->enabled(); | 360 captive_portal_detection_enabled_ = captive_portal_service ->enabled(); |
359 captive_portal_service ->DetectCaptivePortal(); | 361 captive_portal_service ->DetectCaptivePortal(); |
360 registrar_.Add(this, | 362 registrar_.Add(this, |
361 chrome::NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT, | 363 chrome::NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT, |
362 content::Source<Profile>(profile)); | 364 content::Source<Profile>(profile)); |
363 #endif | 365 #endif |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 // sure we don't clear the captive portal flag, since the interstitial was | 813 // sure we don't clear the captive portal flag, since the interstitial was |
812 // potentially caused by the captive portal. | 814 // potentially caused by the captive portal. |
813 captive_portal_detected_ = captive_portal_detected_ || | 815 captive_portal_detected_ = captive_portal_detected_ || |
814 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); | 816 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); |
815 // Also keep track of non-HTTP portals and error cases. | 817 // Also keep track of non-HTTP portals and error cases. |
816 captive_portal_no_response_ = captive_portal_no_response_ || | 818 captive_portal_no_response_ = captive_portal_no_response_ || |
817 (results->result == captive_portal::RESULT_NO_RESPONSE); | 819 (results->result == captive_portal::RESULT_NO_RESPONSE); |
818 } | 820 } |
819 #endif | 821 #endif |
820 } | 822 } |
OLD | NEW |