summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
authorrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-08 15:36:01 +0000
committerrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-08 15:36:01 +0000
commite4149f541f7da270cf6b45829e95fe1271fb243e (patch)
tree5dbd77cc6a77ce1894e66a1156041be1a057e393 /chrome/browser/ui
parent2fe93d818d1951530671d9e4088dac19bc976d55 (diff)
downloadchromium_src-e4149f541f7da270cf6b45829e95fe1271fb243e.zip
chromium_src-e4149f541f7da270cf6b45829e95fe1271fb243e.tar.gz
chromium_src-e4149f541f7da270cf6b45829e95fe1271fb243e.tar.bz2
Add missing histrograms values.
BUG=99653 TEST=No user visible changes. Histogram value appear in about:histograms. Review URL: http://codereview.chromium.org/9623015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125614 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/sync/one_click_signin_helper.cc37
-rw-r--r--chrome/browser/ui/sync/one_click_signin_histogram.h43
-rw-r--r--chrome/browser/ui/sync/one_click_signin_sync_starter.cc7
3 files changed, 58 insertions, 29 deletions
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc
index b65fa70..ace2792 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/ui/sync/one_click_signin_dialog.h"
+#include "chrome/browser/ui/sync/one_click_signin_histogram.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
@@ -34,29 +35,6 @@
#include "webkit/forms/password_form_dom_manager.h"
namespace {
-// Enum values used for UMA histograms.
-enum {
- // The infobar was shown to the user.
- HISTOGRAM_SHOWN,
-
- // The user pressed the accept button to perform the suggested action.
- HISTOGRAM_ACCEPTED,
-
- // The user pressed the reject to turn off the feature.
- HISTOGRAM_REJECTED,
-
- // The user pressed the X button to dismiss the infobar this time.
- HISTOGRAM_DISMISSED,
-
- // The user completely ignored the infoar. Either they navigated away, or
- // they used the page as is.
- HISTOGRAM_IGNORED,
-
- // The user clicked on the learn more link in the infobar.
- HISTOGRAM_LEARN_MORE,
-
- HISTOGRAM_MAX
-};
// The infobar asking the user if they want to use one-click sign in.
class OneClickLoginInfoBarDelegate : public ConfirmInfoBarDelegate {
@@ -105,16 +83,16 @@ OneClickLoginInfoBarDelegate::OneClickLoginInfoBarDelegate(
password_(password),
button_pressed_(false) {
DCHECK(profile_);
- RecordHistogramAction(HISTOGRAM_SHOWN);
+ RecordHistogramAction(one_click_signin::HISTOGRAM_SHOWN);
}
OneClickLoginInfoBarDelegate::~OneClickLoginInfoBarDelegate() {
if (!button_pressed_)
- RecordHistogramAction(HISTOGRAM_IGNORED);
+ RecordHistogramAction(one_click_signin::HISTOGRAM_IGNORED);
}
void OneClickLoginInfoBarDelegate::InfoBarDismissed() {
- RecordHistogramAction(HISTOGRAM_DISMISSED);
+ RecordHistogramAction(one_click_signin::HISTOGRAM_DISMISSED);
button_pressed_ = true;
}
@@ -138,7 +116,7 @@ string16 OneClickLoginInfoBarDelegate::GetButtonLabel(
}
bool OneClickLoginInfoBarDelegate::Accept() {
- RecordHistogramAction(HISTOGRAM_ACCEPTED);
+ RecordHistogramAction(one_click_signin::HISTOGRAM_ACCEPTED);
ShowOneClickSigninDialog(profile_, session_index_, email_, password_);
button_pressed_ = true;
return true;
@@ -149,13 +127,14 @@ bool OneClickLoginInfoBarDelegate::Cancel() {
TabContentsWrapper::GetCurrentWrapperForContents(
owner()->web_contents())->profile()->GetPrefs();
pref_service->SetBoolean(prefs::kReverseAutologinEnabled, false);
- RecordHistogramAction(HISTOGRAM_REJECTED);
+ RecordHistogramAction(one_click_signin::HISTOGRAM_REJECTED);
button_pressed_ = true;
return true;
}
void OneClickLoginInfoBarDelegate::RecordHistogramAction(int action) {
- UMA_HISTOGRAM_ENUMERATION("AutoLogin.Reverse", action, HISTOGRAM_MAX);
+ UMA_HISTOGRAM_ENUMERATION("AutoLogin.Reverse", action,
+ one_click_signin::HISTOGRAM_MAX);
}
} // namespace
diff --git a/chrome/browser/ui/sync/one_click_signin_histogram.h b/chrome/browser/ui/sync/one_click_signin_histogram.h
new file mode 100644
index 0000000..6b2c81b
--- /dev/null
+++ b/chrome/browser/ui/sync/one_click_signin_histogram.h
@@ -0,0 +1,43 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HISTOGRAM_H_
+#define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HISTOGRAM_H_
+#pragma once
+
+namespace one_click_signin {
+
+// Enum values used for use with "AutoLogin.Reverse" histograms.
+enum {
+ // The infobar was shown to the user.
+ HISTOGRAM_SHOWN,
+
+ // The user pressed the accept button to perform the suggested action.
+ HISTOGRAM_ACCEPTED,
+
+ // The user pressed the reject to turn off the feature.
+ HISTOGRAM_REJECTED,
+
+ // The user pressed the X button to dismiss the infobar this time.
+ HISTOGRAM_DISMISSED,
+
+ // The user completely ignored the infoar. Either they navigated away, or
+ // they used the page as is.
+ HISTOGRAM_IGNORED,
+
+ // The user clicked on the learn more link in the infobar.
+ HISTOGRAM_LEARN_MORE,
+
+ // The sync was started with default settings.
+ HISTOGRAM_WITH_DEFAULTS,
+
+ // The sync was started with advanced settings.
+ HISTOGRAM_WITH_ADVANCED,
+
+ HISTOGRAM_MAX
+};
+
+}
+
+#endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HISTOGRAM_H_
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 a5db0f7..cdfb079 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
@@ -4,11 +4,13 @@
#include "chrome/browser/ui/sync/one_click_signin_sync_starter.h"
+#include "base/metrics/histogram.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/signin_manager.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "chrome/browser/ui/sync/one_click_signin_histogram.h"
#include "chrome/browser/ui/webui/signin/login_ui_service.h"
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
@@ -23,6 +25,11 @@ OneClickSigninSyncStarter::OneClickSigninSyncStarter(
use_default_settings_(use_default_settings) {
DCHECK(profile_);
+ int action = use_default_settings ? one_click_signin::HISTOGRAM_WITH_DEFAULTS
+ : one_click_signin::HISTOGRAM_WITH_ADVANCED;
+ UMA_HISTOGRAM_ENUMERATION("AutoLogin.Reverse", action,
+ one_click_signin::HISTOGRAM_MAX);
+
SigninManager* manager = SigninManagerFactory::GetForProfile(profile_);
manager->StartSignInWithCredentials(session_index, email, password);
}