| 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..fc25ffcce368ff184b2f2b64ea5685a62b3e1d1e 100644
|
| --- a/chrome/browser/ssl/ssl_blocking_page.cc
|
| +++ b/chrome/browser/ssl/ssl_blocking_page.cc
|
| @@ -51,6 +51,10 @@
|
| #include "chrome/browser/captive_portal/captive_portal_service_factory.h"
|
| #endif
|
|
|
| +#if defined(ENABLE_EXTENSIONS)
|
| +#include "chrome/browser/extensions/api/experience_sampling_private/experience_sampling.h"
|
| +#endif
|
| +
|
| #if defined(OS_WIN)
|
| #include "base/base_paths_win.h"
|
| #include "base/path_service.h"
|
| @@ -70,8 +74,19 @@ using content::InterstitialPage;
|
| using content::NavigationController;
|
| using content::NavigationEntry;
|
|
|
| +#if defined(ENABLE_EXTENSIONS)
|
| +using extensions::ExperienceSamplingEvent;
|
| +#endif
|
| +
|
| namespace {
|
|
|
| +// Constants for the Experience Sampling instrumentation.
|
| +#if defined(ENABLE_EXTENSIONS)
|
| +const char kEventNameBase[] = "ssl_interstitial_";
|
| +const char kEventNotOverridable[] = "notoverridable_";
|
| +const char kEventOverridable[] = "overridable_";
|
| +#endif
|
| +
|
| // Events for UMA. Do not reorder or change!
|
| enum SSLBlockingPageEvent {
|
| SHOW_ALL,
|
| @@ -327,6 +342,21 @@ SSLBlockingPage::SSLBlockingPage(
|
| content::Source<Profile>(profile));
|
| #endif
|
|
|
| +#if defined(ENABLE_EXTENSIONS)
|
| + // ExperienceSampling: Set up new sampling event for this interstitial.
|
| + std::string event_name(kEventNameBase);
|
| + if (overridable_ && !strict_enforcement_)
|
| + event_name.append(kEventOverridable);
|
| + else
|
| + event_name.append(kEventNotOverridable);
|
| + event_name.append(net::ErrorToString(cert_error_));
|
| + sampling_event_.reset(new ExperienceSamplingEvent(
|
| + event_name,
|
| + request_url_,
|
| + web_contents_->GetLastCommittedURL(),
|
| + web_contents_->GetBrowserContext()));
|
| +#endif
|
| +
|
| // Creating an interstitial without showing (e.g. from chrome://interstitials)
|
| // it leaks memory, so don't create it here.
|
| }
|
| @@ -484,6 +514,10 @@ void SSLBlockingPage::CommandReceived(const std::string& command) {
|
| }
|
| case CMD_MORE: {
|
| RecordSSLBlockingPageEventStats(MORE);
|
| +#if defined(ENABLE_EXTENSIONS)
|
| + if (sampling_event_.get())
|
| + sampling_event_->set_has_viewed_details(true);
|
| +#endif
|
| break;
|
| }
|
| case CMD_RELOAD: {
|
| @@ -494,6 +528,10 @@ void SSLBlockingPage::CommandReceived(const std::string& command) {
|
| case CMD_HELP: {
|
| content::NavigationController::LoadURLParams help_page_params(GURL(
|
| "https://support.google.com/chrome/answer/4454607"));
|
| +#if defined(ENABLE_EXTENSIONS)
|
| + if (sampling_event_.get())
|
| + sampling_event_->set_has_viewed_learn_more(true);
|
| +#endif
|
| web_contents_->GetController().LoadURLWithParams(help_page_params);
|
| break;
|
| }
|
| @@ -524,6 +562,11 @@ void SSLBlockingPage::OnProceed() {
|
| captive_portal_probe_completed_,
|
| captive_portal_no_response_,
|
| captive_portal_detected_);
|
| +#if defined(ENABLE_EXTENSIONS)
|
| + // ExperienceSampling: Notify that user decided to proceed.
|
| + if (sampling_event_.get())
|
| + sampling_event_->CreateUserDecisionEvent(ExperienceSamplingEvent::kProceed);
|
| +#endif
|
| // Accepting the certificate resumes the loading of the page.
|
| NotifyAllowCertificate();
|
| }
|
| @@ -538,6 +581,12 @@ void SSLBlockingPage::OnDontProceed() {
|
| captive_portal_probe_completed_,
|
| captive_portal_no_response_,
|
| captive_portal_detected_);
|
| +#if defined(ENABLE_EXTENSIONS)
|
| + // ExperienceSampling: Notify that user decided to not proceed.
|
| + // This also occurs if the user navigates away or closes the tab.
|
| + if (sampling_event_.get())
|
| + sampling_event_->CreateUserDecisionEvent(ExperienceSamplingEvent::kDeny);
|
| +#endif
|
| NotifyDenyCertificate();
|
| }
|
|
|
|
|