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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 if (history_service) { | 257 if (history_service) { |
258 history_service->GetVisibleVisitCountToHost( | 258 history_service->GetVisibleVisitCountToHost( |
259 request_url_, | 259 request_url_, |
260 base::Bind(&SSLBlockingPage::OnGotHistoryCount, | 260 base::Bind(&SSLBlockingPage::OnGotHistoryCount, |
261 base::Unretained(this)), | 261 base::Unretained(this)), |
262 &request_tracker_); | 262 &request_tracker_); |
263 } | 263 } |
264 } | 264 } |
265 if (SSLErrorInfo::NetErrorToErrorType(cert_error_) == | 265 if (SSLErrorInfo::NetErrorToErrorType(cert_error_) == |
266 SSLErrorInfo::CERT_DATE_INVALID) { | 266 SSLErrorInfo::CERT_DATE_INVALID) { |
267 SSLErrorClassification::RecordUMAStatistics(overridable_ && | 267 SSLErrorClassification ssl_error_classification( |
felt
2014/07/16 22:47:33
you should create a single SSLErrorClassification
radhikabhar
2014/07/17 01:02:11
Done.
| |
268 !strict_enforcement_); | 268 base::Time::NowFromSystemTime(), |
269 request_url_, | |
270 *ssl_info_.cert.get()); | |
271 ssl_error_classification.RecordUMAStatisticsDateInvalid( | |
felt
2014/07/16 23:31:47
Actually, wouldn't it make more sense to just have
radhikabhar
2014/07/17 01:02:11
Done.
| |
272 overridable_ && !strict_enforcement_); | |
273 } | |
274 | |
275 if (SSLErrorInfo::NetErrorToErrorType(cert_error_) == | |
felt
2014/07/16 22:47:33
you should probably save the error type instead of
radhikabhar
2014/07/17 01:02:11
Done.
| |
276 SSLErrorInfo::CERT_COMMON_NAME_INVALID) { | |
277 SSLErrorClassification ssl_error_classification | |
278 (base::Time::NowFromSystemTime(), | |
279 request_url_, | |
280 *ssl_info_.cert.get()); | |
281 ssl_error_classification.RecordUMAStatisticsNameInvalid( | |
282 overridable_ && !strict_enforcement_); | |
283 } | |
284 | |
285 if (SSLErrorInfo::NetErrorToErrorType(cert_error_) == | |
286 SSLErrorInfo::CERT_AUTHORITY_INVALID) { | |
287 SSLErrorClassification ssl_error_classification( | |
288 base::Time::NowFromSystemTime(), | |
289 request_url_, | |
290 *ssl_info_.cert.get()); | |
291 ssl_error_classification.RecordUMAStatisticsAuthorityInvalid( | |
292 overridable_ && !strict_enforcement_); | |
269 } | 293 } |
270 | 294 |
271 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 295 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
272 CaptivePortalService* captive_portal_service = | 296 CaptivePortalService* captive_portal_service = |
273 CaptivePortalServiceFactory::GetForProfile(profile); | 297 CaptivePortalServiceFactory::GetForProfile(profile); |
274 captive_portal_detection_enabled_ = captive_portal_service ->enabled(); | 298 captive_portal_detection_enabled_ = captive_portal_service ->enabled(); |
275 captive_portal_service ->DetectCaptivePortal(); | 299 captive_portal_service ->DetectCaptivePortal(); |
276 registrar_.Add(this, | 300 registrar_.Add(this, |
277 chrome::NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT, | 301 chrome::NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT, |
278 content::Source<Profile>(profile)); | 302 content::Source<Profile>(profile)); |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
721 // sure we don't clear the captive portal flag, since the interstitial was | 745 // sure we don't clear the captive portal flag, since the interstitial was |
722 // potentially caused by the captive portal. | 746 // potentially caused by the captive portal. |
723 captive_portal_detected_ = captive_portal_detected_ || | 747 captive_portal_detected_ = captive_portal_detected_ || |
724 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); | 748 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); |
725 // Also keep track of non-HTTP portals and error cases. | 749 // Also keep track of non-HTTP portals and error cases. |
726 captive_portal_no_response_ = captive_portal_no_response_ || | 750 captive_portal_no_response_ = captive_portal_no_response_ || |
727 (results->result == captive_portal::RESULT_NO_RESPONSE); | 751 (results->result == captive_portal::RESULT_NO_RESPONSE); |
728 } | 752 } |
729 #endif | 753 #endif |
730 } | 754 } |
OLD | NEW |