Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: chrome/browser/ssl/ssl_blocking_page.cc

Issue 872813003: Add Rappor metrics for Safe Browsing and SSL interstitials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 danger_overridable_(true), 228 danger_overridable_(true),
229 strict_enforcement_((options_mask & STRICT_ENFORCEMENT) != 0), 229 strict_enforcement_((options_mask & STRICT_ENFORCEMENT) != 0),
230 expired_but_previously_allowed_( 230 expired_but_previously_allowed_(
231 (options_mask & EXPIRED_BUT_PREVIOUSLY_ALLOWED) != 0) { 231 (options_mask & EXPIRED_BUT_PREVIOUSLY_ALLOWED) != 0) {
232 interstitial_reason_ = 232 interstitial_reason_ =
233 IsErrorDueToBadClock(base::Time::NowFromSystemTime(), cert_error_) ? 233 IsErrorDueToBadClock(base::Time::NowFromSystemTime(), cert_error_) ?
234 SSL_REASON_BAD_CLOCK : SSL_REASON_SSL; 234 SSL_REASON_BAD_CLOCK : SSL_REASON_SSL;
235 235
236 // This must be done after calculating |interstitial_reason_| above. 236 // This must be done after calculating |interstitial_reason_| above.
237 uma_helper_.reset(new SecurityInterstitialUmaHelper( 237 uma_helper_.reset(new SecurityInterstitialUmaHelper(
238 web_contents, request_url, GetHistogramPrefix(), GetSamplingEventName())); 238 web_contents, request_url, GetHistogramPrefix(), "" /* rappor prefix */,
239 GetSamplingEventName()));
239 uma_helper_->RecordUserDecision(SecurityInterstitialUmaHelper::SHOW); 240 uma_helper_->RecordUserDecision(SecurityInterstitialUmaHelper::SHOW);
240 uma_helper_->RecordUserInteraction( 241 uma_helper_->RecordUserInteraction(
241 SecurityInterstitialUmaHelper::TOTAL_VISITS); 242 SecurityInterstitialUmaHelper::TOTAL_VISITS);
242 243
243 ssl_error_classification_.reset(new SSLErrorClassification( 244 ssl_error_classification_.reset(new SSLErrorClassification(
244 web_contents, 245 web_contents,
245 base::Time::NowFromSystemTime(), 246 base::Time::NowFromSystemTime(),
246 request_url, 247 request_url,
247 cert_error_, 248 cert_error_,
248 *ssl_info_.cert.get())); 249 *ssl_info_.cert.get()));
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 event_name.append(kEventNotOverridable); 547 event_name.append(kEventNotOverridable);
547 event_name.append(net::ErrorToString(cert_error_)); 548 event_name.append(net::ErrorToString(cert_error_));
548 return event_name; 549 return event_name;
549 } 550 }
550 551
551 // static 552 // static
552 bool SSLBlockingPage::IsOptionsOverridable(int options_mask) { 553 bool SSLBlockingPage::IsOptionsOverridable(int options_mask) {
553 return (options_mask & SSLBlockingPage::OVERRIDABLE) && 554 return (options_mask & SSLBlockingPage::OVERRIDABLE) &&
554 !(options_mask & SSLBlockingPage::STRICT_ENFORCEMENT); 555 !(options_mask & SSLBlockingPage::STRICT_ENFORCEMENT);
555 } 556 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698