diff options
author | tengs@chromium.org <tengs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-02 19:41:43 +0000 |
---|---|---|
committer | tengs@chromium.org <tengs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-02 19:41:43 +0000 |
commit | 377958792b16099c8087c2acc254f41bfacadcfc (patch) | |
tree | 5b1c34a0cbaefc6fae5d2696630f3f94567c9c29 /ash | |
parent | 164e7a7f81a837e83900c465d00c2a8f9c33ee37 (diff) | |
download | chromium_src-377958792b16099c8087c2acc254f41bfacadcfc.zip chromium_src-377958792b16099c8087c2acc254f41bfacadcfc.tar.gz chromium_src-377958792b16099c8087c2acc254f41bfacadcfc.tar.bz2 |
Log UMA metrics for multiprofile actions.
BUG=297184
Review URL: https://codereview.chromium.org/25098009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226527 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/accelerators/accelerator_controller.cc | 3 | ||||
-rw-r--r-- | ash/ash.gyp | 2 | ||||
-rw-r--r-- | ash/multi_profile_uma.cc | 25 | ||||
-rw-r--r-- | ash/multi_profile_uma.h | 43 | ||||
-rw-r--r-- | ash/system/user/tray_user.cc | 4 |
5 files changed, 77 insertions, 0 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index 89aed5b..06a00c2 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -24,6 +24,7 @@ #include "ash/launcher/launcher_model.h" #include "ash/magnifier/magnification_controller.h" #include "ash/magnifier/partial_magnification_controller.h" +#include "ash/multi_profile_uma.h" #include "ash/root_window_controller.h" #include "ash/rotator/screen_rotation.h" #include "ash/screenshot_delegate.h" @@ -197,6 +198,8 @@ bool SwitchToNextUser() { ash::Shell::GetInstance()->session_state_delegate(); if (delegate->NumberOfLoggedInUsers() <= 1) return false; + MultiProfileUMA::RecordSwitchActiveUser( + MultiProfileUMA::SWITCH_ACTIVE_USER_BY_ACCELERATOR); delegate->SwitchActiveUserToNext(); return true; } diff --git a/ash/ash.gyp b/ash/ash.gyp index 1d677f5..13ea12f 100644 --- a/ash/ash.gyp +++ b/ash/ash.gyp @@ -167,6 +167,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(); |