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

Side by Side Diff: ash/system/user/tray_user.cc

Issue 25098009: Log UMA metrics for multiprofile actions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/multi_profile_uma.cc ('k') | chrome/browser/chromeos/login/user_manager_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/user/tray_user.h" 5 #include "ash/system/user/tray_user.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <climits> 8 #include <climits>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ash/ash_switches.h" 11 #include "ash/ash_switches.h"
12 #include "ash/multi_profile_uma.h"
12 #include "ash/popup_message.h" 13 #include "ash/popup_message.h"
13 #include "ash/root_window_controller.h" 14 #include "ash/root_window_controller.h"
14 #include "ash/session_state_delegate.h" 15 #include "ash/session_state_delegate.h"
15 #include "ash/shelf/shelf_layout_manager.h" 16 #include "ash/shelf/shelf_layout_manager.h"
16 #include "ash/shell.h" 17 #include "ash/shell.h"
17 #include "ash/shell_delegate.h" 18 #include "ash/shell_delegate.h"
18 #include "ash/system/tray/system_tray.h" 19 #include "ash/system/tray/system_tray.h"
19 #include "ash/system/tray/system_tray_delegate.h" 20 #include "ash/system/tray/system_tray_delegate.h"
20 #include "ash/system/tray/system_tray_notifier.h" 21 #include "ash/system/tray/system_tray_notifier.h"
21 #include "ash/system/tray/tray_constants.h" 22 #include "ash/system/tray/tray_constants.h"
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 744
744 void UserView::ButtonPressed(views::Button* sender, const ui::Event& event) { 745 void UserView::ButtonPressed(views::Button* sender, const ui::Event& event) {
745 if (sender == logout_button_) { 746 if (sender == logout_button_) {
746 ash::Shell::GetInstance()->system_tray_delegate()->SignOut(); 747 ash::Shell::GetInstance()->system_tray_delegate()->SignOut();
747 } else if (sender == user_card_view_ && SupportsMultiProfile()) { 748 } else if (sender == user_card_view_ && SupportsMultiProfile()) {
748 if (!multiprofile_index_) { 749 if (!multiprofile_index_) {
749 ToggleAddUserMenuOption(); 750 ToggleAddUserMenuOption();
750 } else { 751 } else {
751 ash::SessionStateDelegate* delegate = 752 ash::SessionStateDelegate* delegate =
752 ash::Shell::GetInstance()->session_state_delegate(); 753 ash::Shell::GetInstance()->session_state_delegate();
754 MultiProfileUMA::RecordSwitchActiveUser(
755 MultiProfileUMA::SWITCH_ACTIVE_USER_BY_TRAY);
753 delegate->SwitchActiveUser(delegate->GetUserEmail(multiprofile_index_)); 756 delegate->SwitchActiveUser(delegate->GetUserEmail(multiprofile_index_));
754 // Since the user list is about to change the system menu should get 757 // Since the user list is about to change the system menu should get
755 // closed. 758 // closed.
756 owner_->system_tray()->CloseSystemBubble(); 759 owner_->system_tray()->CloseSystemBubble();
757 } 760 }
758 } else if (add_menu_option_.get() && 761 } else if (add_menu_option_.get() &&
759 sender == add_menu_option_->GetContentsView()) { 762 sender == add_menu_option_->GetContentsView()) {
760 // Let the user add another account to the session. 763 // Let the user add another account to the session.
764 MultiProfileUMA::RecordSigninUser(MultiProfileUMA::SIGNIN_USER_BY_TRAY);
761 ash::Shell::GetInstance()->system_tray_delegate()->ShowUserLogin(); 765 ash::Shell::GetInstance()->system_tray_delegate()->ShowUserLogin();
762 } else { 766 } else {
763 NOTREACHED(); 767 NOTREACHED();
764 } 768 }
765 } 769 }
766 770
767 void UserView::AddLogoutButton(ash::user::LoginStatus login) { 771 void UserView::AddLogoutButton(ash::user::LoginStatus login) {
768 const base::string16 title = ash::user::GetLocalizedSignOutStringForStatus( 772 const base::string16 title = ash::user::GetLocalizedSignOutStringForStatus(
769 login, true); 773 login, true);
770 TrayPopupLabelButton* logout_button = new TrayPopupLabelButton(this, title); 774 TrayPopupLabelButton* logout_button = new TrayPopupLabelButton(this, title);
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 kUserIconLargeSize : kUserIconSize; 1295 kUserIconLargeSize : kUserIconSize;
1292 1296
1293 avatar_->SetImage( 1297 avatar_->SetImage(
1294 ash::Shell::GetInstance()->session_state_delegate()->GetUserImage( 1298 ash::Shell::GetInstance()->session_state_delegate()->GetUserImage(
1295 multiprofile_index_), 1299 multiprofile_index_),
1296 gfx::Size(icon_size, icon_size)); 1300 gfx::Size(icon_size, icon_size));
1297 } 1301 }
1298 1302
1299 } // namespace internal 1303 } // namespace internal
1300 } // namespace ash 1304 } // namespace ash
OLDNEW
« no previous file with comments | « ash/multi_profile_uma.cc ('k') | chrome/browser/chromeos/login/user_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698