| 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();
|
| }
|
|
|