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

Unified Diff: chrome/browser/ssl/ssl_blocking_page.cc

Issue 399773002: Experience sampling insturmentation for SSL and Safe Browsing interstitials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sampling-api
Patch Set: rebase-update Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f7cc7d092415a58893f1b63a5193d63126f8e4e6..69f91e9962768369ec68ecc4876bff94083c885c 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -18,6 +18,7 @@
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/extensions/api/experience_sampling_private/experience_sampling.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_preferences_util.h"
@@ -69,6 +70,7 @@ using base::TimeTicks;
using content::InterstitialPage;
using content::NavigationController;
using content::NavigationEntry;
+using extensions::SamplingEvent;
namespace {
@@ -107,6 +109,11 @@ const char* GetTrialCondition() {
return kCondV2;
}
+// Constants for the Experience Sampling instrumentation.
+const char kEventNameBase[] = "ssl_interstitial_";
+const char kEventNotOverridable[] = "notoverridable_";
+const char kEventOverridable[] = "overridable_";
+
// Events for UMA. Do not reorder or change!
enum SSLBlockingPageEvent {
SHOW_ALL,
@@ -362,6 +369,19 @@ SSLBlockingPage::SSLBlockingPage(
content::Source<Profile>(profile));
#endif
+ // 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 SamplingEvent(
+ event_name,
+ request_url_,
+ web_contents_->GetLastCommittedURL(),
+ web_contents_->GetBrowserContext()));
+
interstitial_page_ = InterstitialPage::Create(
web_contents_, true, request_url, this);
interstitial_page_->Show();
@@ -681,6 +701,7 @@ void SSLBlockingPage::CommandReceived(const std::string& command) {
}
case CMD_MORE: {
RecordSSLBlockingPageEventStats(MORE);
+ sampling_event_->has_viewed_details = true;
break;
}
case CMD_RELOAD: {
@@ -691,6 +712,7 @@ void SSLBlockingPage::CommandReceived(const std::string& command) {
case CMD_HELP: {
content::NavigationController::LoadURLParams help_page_params(GURL(
"https://support.google.com/chrome/answer/4454607"));
+ sampling_event_->has_viewed_learn_more = true;
web_contents_->GetController().LoadURLWithParams(help_page_params);
break;
}
@@ -721,6 +743,8 @@ void SSLBlockingPage::OnProceed() {
captive_portal_probe_completed_,
captive_portal_no_response_,
captive_portal_detected_);
+ // ExperienceSampling: Notify that user decided to proceed.
+ sampling_event_->CreateUserDecisionEvent(SamplingEvent::kProceed);
// Accepting the certificate resumes the loading of the page.
NotifyAllowCertificate();
}
@@ -735,6 +759,10 @@ void SSLBlockingPage::OnDontProceed() {
captive_portal_probe_completed_,
captive_portal_no_response_,
captive_portal_detected_);
+ // ExperienceSampling: Notify that user decided to not proceed.
+ // This also occurs if the user navigates away or closes the tab.
+ sampling_event_->CreateUserDecisionEvent(SamplingEvent::kDeny);
+
felt 2014/07/25 01:05:51 nit: don't need this empty line
Chris Thompson 2014/07/25 01:21:59 Done.
NotifyDenyCertificate();
}
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698