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

Unified Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 952463002: Add UMA to track permission changes from the content settings menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/ui/webui/options/content_settings_handler.cc
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
index 5f9ff7c9f4bf888382e1a43d36c4dd577e0d1dec..a01d7d0671af4f8a46d3f894a7404a3d3349dbdc 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
+#include "base/metrics/histogram.h"
Ilya Sherman 2015/02/23 22:55:20 Ditto
Miguel Garcia 2015/02/24 13:25:24 Done.
#include "base/prefs/pref_service.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
@@ -1418,6 +1419,19 @@ void ContentSettingsHandler::RemoveException(const base::ListValue* args) {
RemoveMediaException(args);
else
RemoveExceptionFromHostContentSettingsMap(args, type);
+
+ ContentSettingsTypeHistogram histogram_value =
+ ContentSettingTypeToHistogramValue(type);
+ DCHECK_NE(histogram_value, CONTENT_SETTINGS_TYPE_HISTOGRAM_INVALID)
+ << "Invalid content setting type specified.";
+
+ UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Menu.PermissionChanged",
+ histogram_value,
+ CONTENT_SETTINGS_HISTOGRAM_NUM_TYPES);
+
+ UMA_HISTOGRAM_ENUMERATION(
+ "WebsiteSettings.ContentSettings.PermissionChanged.Reset",
+ histogram_value, CONTENT_SETTINGS_HISTOGRAM_NUM_TYPES);
Ilya Sherman 2015/02/23 22:55:20 Please call LogPermissionChange() to emit to these
Miguel Garcia 2015/02/24 13:25:24 So the thing is that those two files are a world a
Ilya Sherman 2015/02/24 19:13:40 I'm suggesting moving the helper method out into a
}
void ContentSettingsHandler::SetException(const base::ListValue* args) {

Powered by Google App Engine
This is Rietveld 408576698