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

Unified Diff: chrome/browser/content_settings/chrome_content_settings_utils.cc

Issue 1148773005: Add a RAPPOR metric to track where users click to allow mixed scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move mixed script shield RAPPOR stats into a new RecordMixedScriptActionWithRAPPOR() function. Created 5 years, 7 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
Index: chrome/browser/content_settings/chrome_content_settings_utils.cc
diff --git a/chrome/browser/content_settings/chrome_content_settings_utils.cc b/chrome/browser/content_settings/chrome_content_settings_utils.cc
index 7da4bf12814a8bb28e3fd37bffbc786e6649f2a6..9719b0a39b36b60035d876727c215fb462f3d508 100644
--- a/chrome/browser/content_settings/chrome_content_settings_utils.cc
+++ b/chrome/browser/content_settings/chrome_content_settings_utils.cc
@@ -5,6 +5,8 @@
#include "chrome/browser/content_settings/chrome_content_settings_utils.h"
#include "base/metrics/histogram.h"
+#include "chrome/browser/browser_process.h"
+#include "components/rappor/rappor_utils.h"
namespace content_settings {
@@ -13,4 +15,25 @@ void RecordMixedScriptAction(MixedScriptAction action) {
MIXED_SCRIPT_ACTION_COUNT);
}
+void RecordMixedScriptActionWithRAPPOR(MixedScriptAction action,
+ const GURL& url) {
+ RecordMixedScriptAction(action);
felt 2015/06/12 00:18:25 A second method seems fine, but can you avoid call
lgarron 2015/06/12 00:30:18 I chose "with RAPPOR" instead of "using RAPPOR", h
+
+ std::string metric;
+ switch (action) {
+ case MIXED_SCRIPT_ACTION_DISPLAYED_SHIELD:
+ metric = "ContentSettings.MixedScript.DisplayedShield";
+ break;
+ case MIXED_SCRIPT_ACTION_CLICKED_ALLOW:
+ metric = "ContentSettings.MixedScript.UserClickedAllow";
+ break;
+ default:
+ NOTREACHED();
+ }
+
+ rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
+ metric,
+ url);
+}
+
} // namespace content_settings

Powered by Google App Engine
This is Rietveld 408576698