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

Unified Diff: chrome/browser/ui/sync/one_click_signin_sync_starter.cc

Issue 382813002: Added more policy UMA metrics. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More review feedback. 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 | « no previous file | components/policy/core/browser/browser_policy_connector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sync/one_click_signin_sync_starter.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
index d1f4e7961c2df121f4f8893f2e40426882192479..a3a4bee85079ee298eeebb5ea0f56ce8bc1662db 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/sync/one_click_signin_sync_starter.h"
+#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
@@ -46,6 +47,32 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+namespace {
+
+// UMA histogram for tracking what users do when presented with the signin
+// screen.
+// Hence,
+// (a) existing enumerated constants should never be deleted or reordered, and
+// (b) new constants should only be appended at the end of the enumeration.
+//
+// Keep this in sync with SigninChoice in histograms.xml.
+enum SigninChoice {
+ SIGNIN_CHOICE_CANCEL = 0,
+ SIGNIN_CHOICE_CONTINUE = 1,
+ SIGNIN_CHOICE_NEW_PROFILE = 2,
+ // SIGNIN_CHOICE_SIZE should always be last - this is a count of the number
+ // of items in this enum.
+ SIGNIN_CHOICE_SIZE,
+};
+
+void SetUserChoiceHistogram(SigninChoice choice) {
+ UMA_HISTOGRAM_ENUMERATION("Enterprise.UserSigninChoice",
+ choice,
+ SIGNIN_CHOICE_SIZE);
+}
+
+} // namespace
+
OneClickSigninSyncStarter::OneClickSigninSyncStarter(
Profile* profile,
Browser* browser,
@@ -150,16 +177,19 @@ OneClickSigninSyncStarter::SigninDialogDelegate::~SigninDialogDelegate() {
}
void OneClickSigninSyncStarter::SigninDialogDelegate::OnCancelSignin() {
+ SetUserChoiceHistogram(SIGNIN_CHOICE_CANCEL);
if (sync_starter_ != NULL)
sync_starter_->CancelSigninAndDelete();
}
void OneClickSigninSyncStarter::SigninDialogDelegate::OnContinueSignin() {
+ SetUserChoiceHistogram(SIGNIN_CHOICE_CONTINUE);
if (sync_starter_ != NULL)
sync_starter_->LoadPolicyWithCachedCredentials();
}
void OneClickSigninSyncStarter::SigninDialogDelegate::OnSigninWithNewProfile() {
+ SetUserChoiceHistogram(SIGNIN_CHOICE_NEW_PROFILE);
if (sync_starter_ != NULL)
sync_starter_->CreateNewSignedInProfile();
}
« no previous file with comments | « no previous file | components/policy/core/browser/browser_policy_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698