| 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..26b95bc0bcf19528f4c36ac72fc8af325a3136b5 100644
|
| --- a/chrome/browser/ssl/ssl_blocking_page.cc
|
| +++ b/chrome/browser/ssl/ssl_blocking_page.cc
|
| @@ -102,24 +102,61 @@ 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) {
|
| + 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;
|
| +
|
| + if (overridable) {
|
| + UMA_HISTOGRAM_ENUMERATION(
|
| + "interstitial.ssl.expiration_and_decision.overridable",
|
| + event,
|
| + END_OF_SSL_EXPIRATION_AND_DECISION);
|
| + } else {
|
| + UMA_HISTOGRAM_ENUMERATION(
|
| + "interstitial.ssl.expiration_and_decision.nonoverridable",
|
| + 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 +306,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 +327,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 +379,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 +562,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 +577,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();
|
| }
|
|
|
|
|