summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-09 00:58:40 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-09 00:58:40 +0000
commit8dc3dabb335212159fc30916558a59f1da673940 (patch)
tree5f7560da89b09da5b8e8d591b9f1eaec15cb80d8
parent4333f21ceae038eb3a0756c9b83b57672d84e7c6 (diff)
downloadchromium_src-8dc3dabb335212159fc30916558a59f1da673940.zip
chromium_src-8dc3dabb335212159fc30916558a59f1da673940.tar.gz
chromium_src-8dc3dabb335212159fc30916558a59f1da673940.tar.bz2
Merge 226527 "Log UMA metrics for multiprofile actions."
> Log UMA metrics for multiprofile actions. > > BUG=297184 > > Review URL: https://codereview.chromium.org/25098009 TBR=tengs@chromium.org Review URL: https://codereview.chromium.org/26639002 git-svn-id: svn://svn.chromium.org/chrome/branches/1650/src@227638 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/ash.gyp2
-rw-r--r--ash/multi_profile_uma.cc25
-rw-r--r--ash/multi_profile_uma.h43
-rw-r--r--ash/system/user/tray_user.cc4
-rw-r--r--chrome/browser/chromeos/login/user_manager_impl.cc12
-rw-r--r--chrome/browser/chromeos/profiles/avatar_menu_actions_chromeos.cc3
-rw-r--r--tools/metrics/histograms/histograms.xml35
7 files changed, 121 insertions, 3 deletions
diff --git a/ash/ash.gyp b/ash/ash.gyp
index 6e89c95..9e8b0e6 100644
--- a/ash/ash.gyp
+++ b/ash/ash.gyp
@@ -163,6 +163,8 @@
'magnifier/magnifier_constants.h',
'magnifier/partial_magnification_controller.cc',
'magnifier/partial_magnification_controller.h',
+ 'multi_profile_uma.cc',
+ 'multi_profile_uma.h',
'popup_message.cc',
'popup_message.h',
'root_window_controller.cc',
diff --git a/ash/multi_profile_uma.cc b/ash/multi_profile_uma.cc
new file mode 100644
index 0000000..b6383e4
--- /dev/null
+++ b/ash/multi_profile_uma.cc
@@ -0,0 +1,25 @@
+// Copyright 2013 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.
+
+#include "ash/multi_profile_uma.h"
+
+#include "base/metrics/histogram.h"
+
+namespace ash {
+
+// static
+void MultiProfileUMA::RecordSwitchActiveUser(SwitchActiveUserAction action) {
+ UMA_HISTOGRAM_ENUMERATION("MultiProfile.SwitchActiveUserUIPath",
+ action,
+ NUM_SWITCH_ACTIVE_USER_ACTIONS);
+}
+
+// static
+void MultiProfileUMA::RecordSigninUser(SigninUserAction action) {
+ UMA_HISTOGRAM_ENUMERATION("MultiProfile.SigninUserUIPath",
+ action,
+ NUM_SIGNIN_USER_ACTIONS);
+}
+
+} // namespace ash
diff --git a/ash/multi_profile_uma.h b/ash/multi_profile_uma.h
new file mode 100644
index 0000000..ead66e8
--- /dev/null
+++ b/ash/multi_profile_uma.h
@@ -0,0 +1,43 @@
+// Copyright 2013 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 ASH_MULTI_PROFILE_UMA_H_
+#define ASH_MULTI_PROFILE_UMA_H_
+
+#include "ash/ash_export.h"
+#include "base/basictypes.h"
+
+namespace ash {
+
+// Records UMA statistics for multiprofile actions.
+// Note: There is also an action to switch profile windows from the
+// browser frame that is recorded by the "Profile.OpenMethod" metric.
+class ASH_EXPORT MultiProfileUMA {
+ public:
+ // Keep these enums up to date with tools/metrics/histograms/histograms.xml.
+ enum SwitchActiveUserAction {
+ SWITCH_ACTIVE_USER_BY_TRAY = 0,
+ SWITCH_ACTIVE_USER_BY_ACCELERATOR,
+ NUM_SWITCH_ACTIVE_USER_ACTIONS
+ };
+
+ enum SigninUserAction {
+ SIGNIN_USER_BY_TRAY = 0,
+ SIGNIN_USER_BY_BROWSER_FRAME,
+ NUM_SIGNIN_USER_ACTIONS
+ };
+
+ // Record switching the active user and what UI path was taken.
+ static void RecordSwitchActiveUser(SwitchActiveUserAction action);
+
+ // Record signing in a new user and what UI path was taken.
+ static void RecordSigninUser(SigninUserAction action);
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(MultiProfileUMA);
+};
+
+} // namespace ash
+
+#endif // ASH_MULTI_PROFILE_UMA_H_
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc
index e832727..c11890a 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -9,6 +9,7 @@
#include <vector>
#include "ash/ash_switches.h"
+#include "ash/multi_profile_uma.h"
#include "ash/popup_message.h"
#include "ash/root_window_controller.h"
#include "ash/session_state_delegate.h"
@@ -750,6 +751,8 @@ void UserView::ButtonPressed(views::Button* sender, const ui::Event& event) {
} else {
ash::SessionStateDelegate* delegate =
ash::Shell::GetInstance()->session_state_delegate();
+ MultiProfileUMA::RecordSwitchActiveUser(
+ MultiProfileUMA::SWITCH_ACTIVE_USER_BY_TRAY);
delegate->SwitchActiveUser(delegate->GetUserEmail(multiprofile_index_));
// Since the user list is about to change the system menu should get
// closed.
@@ -758,6 +761,7 @@ void UserView::ButtonPressed(views::Button* sender, const ui::Event& event) {
} else if (add_menu_option_.get() &&
sender == add_menu_option_->GetContentsView()) {
// Let the user add another account to the session.
+ MultiProfileUMA::RecordSigninUser(MultiProfileUMA::SIGNIN_USER_BY_TRAY);
ash::Shell::GetInstance()->system_tray_delegate()->ShowUserLogin();
} else {
NOTREACHED();
diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc
index b9a02f1..1cc62e7 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/user_manager_impl.cc
@@ -395,14 +395,20 @@ void UserManagerImpl::UserLoggedIn(const std::string& email,
logged_in_users_.insert(logged_in_users_.begin(), active_user_);
SetLRUUser(active_user_);
- if (!primary_user_)
+ if (!primary_user_) {
primary_user_ = active_user_;
+ if (primary_user_->GetType() == User::USER_TYPE_REGULAR)
+ SendRegularUserLoginMetrics(email);
+ }
UMA_HISTOGRAM_ENUMERATION("UserManager.LoginUserType",
active_user_->GetType(), User::NUM_USER_TYPES);
- if (active_user_->GetType() == User::USER_TYPE_REGULAR)
- SendRegularUserLoginMetrics(email);
+ if (IsMultipleProfilesAllowed()) {
+ UMA_HISTOGRAM_COUNTS_100("MultiProfile.UserCount",
+ GetLoggedInUsers().size());
+ }
+
g_browser_process->local_state()->SetString(kLastLoggedInRegularUser,
(active_user_->GetType() == User::USER_TYPE_REGULAR) ? email : "");
diff --git a/chrome/browser/chromeos/profiles/avatar_menu_actions_chromeos.cc b/chrome/browser/chromeos/profiles/avatar_menu_actions_chromeos.cc
index fd27cd4..79e3cc6 100644
--- a/chrome/browser/chromeos/profiles/avatar_menu_actions_chromeos.cc
+++ b/chrome/browser/chromeos/profiles/avatar_menu_actions_chromeos.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/profiles/avatar_menu_actions_chromeos.h"
+#include "ash/multi_profile_uma.h"
#include "ash/shell.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "chrome/browser/chromeos/login/user_manager.h"
@@ -25,6 +26,8 @@ AvatarMenuActionsChromeOS::~AvatarMenuActionsChromeOS() {
void AvatarMenuActionsChromeOS::AddNewProfile(ProfileMetrics::ProfileAdd type) {
// Let the user add another account to the session.
+ ash::MultiProfileUMA::RecordSigninUser(
+ ash::MultiProfileUMA::SIGNIN_USER_BY_BROWSER_FRAME);
ash::Shell::GetInstance()->system_tray_delegate()->ShowUserLogin();
}
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 7cb49c0..77bc844 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -6557,6 +6557,31 @@ other types of suffix sets.
</summary>
</histogram>
+<histogram name="MultiProfile.SigninUserUIPath"
+ enum="MultiProfileSigninUserAction">
+ <summary>
+ Count the number of times each UI path is taken for signing into a new
+ account in a ChromeOS multiprofile session. UI paths include the system tray
+ and the user account switcher on the browser frame.
+ </summary>
+</histogram>
+
+<histogram name="MultiProfile.SwitchActiveUserUIPath"
+ enum="MultiProfileSwitchActiveUserAction">
+ <summary>
+ Count the number of times each UI path is taken for switching the active
+ account in a ChromeOS multiprofile session. UI paths include the system tray
+ and the keyboard shortcut.
+ </summary>
+</histogram>
+
+<histogram name="Multiprofile.UserCount">
+ <summary>
+ The number of users simultaneously signed into a multiprofile session on
+ ChromeOS. This is recorded whenever a new user logs in.
+ </summary>
+</histogram>
+
<histogram name="Navigation.MainFrameScheme" enum="NavigationScheme">
<summary>The scheme of the URL for each main-frame navigation.</summary>
</histogram>
@@ -23451,6 +23476,16 @@ other types of suffix sets.
<int value="9" label="OPUS"/>
</enum>
+<enum name="MultiProfileSigninUserAction" type="int">
+ <int value="0" label="System tray"/>
+ <int value="1" label="Browser frame"/>
+</enum>
+
+<enum name="MultiProfileSwitchActiveUserAction" type="int">
+ <int value="0" label="System tray"/>
+ <int value="1" label="Keyboard accelerator"/>
+</enum>
+
<enum name="NavigationScheme" type="int">
<int value="0" label="(Unknown)"/>
<int value="1" label="http"/>