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

Unified Diff: chrome/browser/supervised_user/supervised_user_whitelist_service.cc

Issue 905763002: Add metrics for supervised user whitelist installation and uninstallation, and absolute count. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@2015_01_19_component_installer
Patch Set: review 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
« no previous file with comments | « no previous file | tools/metrics/actions/actions.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/supervised_user/supervised_user_whitelist_service.cc
diff --git a/chrome/browser/supervised_user/supervised_user_whitelist_service.cc b/chrome/browser/supervised_user/supervised_user_whitelist_service.cc
index 89c0d015d4550c92e150e7acfcc9d1f6e73a409c..21a9ccedf639be402a5f190909c0553cf3107b74 100644
--- a/chrome/browser/supervised_user/supervised_user_whitelist_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_whitelist_service.cc
@@ -9,6 +9,8 @@
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/metrics/histogram.h"
+#include "base/metrics/user_metrics.h"
+#include "base/metrics/user_metrics_action.h"
#include "base/prefs/pref_service.h"
#include "base/prefs/scoped_user_pref_update.h"
#include "base/strings/string_split.h"
@@ -61,6 +63,7 @@ void SupervisedUserWhitelistService::Init() {
bool new_installation = false;
RegisterWhitelist(it.key(), name, new_installation);
}
+ UMA_HISTOGRAM_COUNTS_100("ManagedUsers.Whitelist.Count", whitelists->size());
// Register whitelists specified on the command line.
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
@@ -257,6 +260,8 @@ syncer::SyncError SupervisedUserWhitelistService::ProcessSyncChanges(
void SupervisedUserWhitelistService::AddNewWhitelist(
base::DictionaryValue* pref_dict,
const sync_pb::ManagedUserWhitelistSpecifics& whitelist) {
+ base::RecordAction(base::UserMetricsAction("ManagedUsers_Whitelist_Added"));
+
bool new_installation = true;
RegisterWhitelist(whitelist.id(), whitelist.name(), new_installation);
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
@@ -273,6 +278,8 @@ void SupervisedUserWhitelistService::SetWhitelistProperties(
void SupervisedUserWhitelistService::RemoveWhitelist(
base::DictionaryValue* pref_dict,
const std::string& id) {
+ base::RecordAction(base::UserMetricsAction("ManagedUsers_Whitelist_Removed"));
+
pref_dict->RemoveWithoutPathExpansion(id, NULL);
installer_->UnregisterWhitelist(id);
UnloadWhitelist(id);
« no previous file with comments | « no previous file | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698