Chromium Code Reviews| Index: chrome/browser/ssl/ssl_blocking_page.cc |
| diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc |
| index d9cb0020a77f6c680d832d172f32f0305bf66526..896f50968fd1483291b4ba4ee4e0834c4c12dc2f 100644 |
| --- a/chrome/browser/ssl/ssl_blocking_page.cc |
| +++ b/chrome/browser/ssl/ssl_blocking_page.cc |
| @@ -72,6 +72,11 @@ using content::NavigationEntry; |
| namespace { |
| +const char kExpirationAndDecisionNonoverridableHistogram[] = |
| + "interstitial.ssl.expiration_and_decision.nonoverridable"; |
| +const char kExpirationAndDecisionOverridableHistogram[] = |
| + "interstitial.ssl.expiration_and_decision.overridable"; |
| + |
| // Events for UMA. Do not reorder or change! |
| enum SSLBlockingPageEvent { |
| SHOW_ALL, |
| @@ -102,24 +107,59 @@ enum SSLBlockingPageEvent { |
| UNUSED_BLOCKING_PAGE_EVENT, |
| }; |
| +// Events for UMA. Do not reorder or change! |
| +enum SSLExpirationAndDecision { |
| + EXPIRED_AND_PROCEED, |
| + EXPIRED_AND_DO_NOT_PROCEED, |
| + NOT_EXPIRED_AND_PROCEED, |
| + NOT_EXPIRED_AND_DO_NOT_PROCEED, |
| + END_OF_SSL_EXPIRATION_AND_DECISION, |
| +}; |
| + |
| void RecordSSLBlockingPageEventStats(SSLBlockingPageEvent event) { |
| UMA_HISTOGRAM_ENUMERATION("interstitial.ssl", |
| event, |
| UNUSED_BLOCKING_PAGE_EVENT); |
| } |
| -void RecordSSLBlockingPageDetailedStats( |
| - bool proceed, |
| - int cert_error, |
| - bool overridable, |
| - bool internal, |
| - int num_visits, |
| - bool captive_portal_detection_enabled, |
| - bool captive_portal_probe_completed, |
| - bool captive_portal_no_response, |
| - bool captive_portal_detected) { |
| +void RecordSSLExpirationPageEventState(bool expired_but_previously_allowed, |
| + bool proceed, |
| + bool overridable) { |
| + const char *histogram; |
| + if (overridable) |
| + histogram = kExpirationAndDecisionOverridableHistogram; |
| + else |
| + histogram = kExpirationAndDecisionNonoverridableHistogram; |
| + |
| + SSLExpirationAndDecision event; |
| + if (expired_but_previously_allowed && proceed) |
| + event = EXPIRED_AND_PROCEED; |
| + else if (expired_but_previously_allowed && !proceed) |
| + event = EXPIRED_AND_DO_NOT_PROCEED; |
| + else if (!expired_but_previously_allowed && proceed) |
| + event = NOT_EXPIRED_AND_PROCEED; |
| + else |
| + event = NOT_EXPIRED_AND_DO_NOT_PROCEED; |
| + |
| + UMA_HISTOGRAM_ENUMERATION(histogram, |
|
felt
2014/08/08 17:55:33
Although this might compile, I don't think it will
jww
2014/08/12 04:51:02
Done.
|
| + event, |
| + END_OF_SSL_EXPIRATION_AND_DECISION); |
| +} |
| + |
| +void RecordSSLBlockingPageDetailedStats(bool proceed, |
| + int cert_error, |
| + bool overridable, |
| + bool internal, |
| + int num_visits, |
| + bool captive_portal_detection_enabled, |
| + bool captive_portal_probe_completed, |
| + bool captive_portal_no_response, |
| + bool captive_portal_detected, |
| + bool expired_but_previously_allowed) { |
| UMA_HISTOGRAM_ENUMERATION("interstitial.ssl_error_type", |
| SSLErrorInfo::NetErrorToErrorType(cert_error), SSLErrorInfo::END_OF_ENUM); |
| + RecordSSLExpirationPageEventState( |
| + expired_but_previously_allowed, proceed, overridable); |
| #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| if (captive_portal_detection_enabled) |
| RecordSSLBlockingPageEventStats( |
| @@ -269,14 +309,14 @@ void LaunchDateAndTimeSettings() { |
| // Note that we always create a navigation entry with SSL errors. |
| // No error happening loading a sub-resource triggers an interstitial so far. |
| -SSLBlockingPage::SSLBlockingPage( |
| - content::WebContents* web_contents, |
| - int cert_error, |
| - const net::SSLInfo& ssl_info, |
| - const GURL& request_url, |
| - bool overridable, |
| - bool strict_enforcement, |
| - const base::Callback<void(bool)>& callback) |
| +SSLBlockingPage::SSLBlockingPage(content::WebContents* web_contents, |
| + int cert_error, |
| + const net::SSLInfo& ssl_info, |
| + const GURL& request_url, |
| + bool overridable, |
| + bool strict_enforcement, |
| + bool expired_but_previously_allowed, |
| + const base::Callback<void(bool)>& callback) |
| : callback_(callback), |
| web_contents_(web_contents), |
| cert_error_(cert_error), |
| @@ -290,7 +330,8 @@ SSLBlockingPage::SSLBlockingPage( |
| captive_portal_detection_enabled_(false), |
| captive_portal_probe_completed_(false), |
| captive_portal_no_response_(false), |
| - captive_portal_detected_(false) { |
| + captive_portal_detected_(false), |
| + expired_but_previously_allowed_(expired_but_previously_allowed) { |
| Profile* profile = Profile::FromBrowserContext( |
| web_contents->GetBrowserContext()); |
| // For UMA stats. |
| @@ -341,7 +382,8 @@ SSLBlockingPage::~SSLBlockingPage() { |
| captive_portal_detection_enabled_, |
| captive_portal_probe_completed_, |
| captive_portal_no_response_, |
| - captive_portal_detected_); |
| + captive_portal_detected_, |
| + expired_but_previously_allowed_); |
| // The page is closed without the user having chosen what to do, default to |
| // deny. |
| NotifyDenyCertificate(); |
| @@ -523,7 +565,8 @@ void SSLBlockingPage::OnProceed() { |
| captive_portal_detection_enabled_, |
| captive_portal_probe_completed_, |
| captive_portal_no_response_, |
| - captive_portal_detected_); |
| + captive_portal_detected_, |
| + expired_but_previously_allowed_); |
| // Accepting the certificate resumes the loading of the page. |
| NotifyAllowCertificate(); |
| } |
| @@ -537,7 +580,8 @@ void SSLBlockingPage::OnDontProceed() { |
| captive_portal_detection_enabled_, |
| captive_portal_probe_completed_, |
| captive_portal_no_response_, |
| - captive_portal_detected_); |
| + captive_portal_detected_, |
| + expired_but_previously_allowed_); |
| NotifyDenyCertificate(); |
| } |