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

Side by Side Diff: ash/accelerators/accelerator_controller.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 | « no previous file | ash/ash.gyp » ('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/accelerators/accelerator_controller.h" 5 #include "ash/accelerators/accelerator_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <iostream> 9 #include <iostream>
10 #include <string> 10 #include <string>
11 11
12 #include "ash/accelerators/accelerator_commands.h" 12 #include "ash/accelerators/accelerator_commands.h"
13 #include "ash/accelerators/accelerator_table.h" 13 #include "ash/accelerators/accelerator_table.h"
14 #include "ash/accelerators/debug_commands.h" 14 #include "ash/accelerators/debug_commands.h"
15 #include "ash/ash_switches.h" 15 #include "ash/ash_switches.h"
16 #include "ash/caps_lock_delegate.h" 16 #include "ash/caps_lock_delegate.h"
17 #include "ash/debug.h" 17 #include "ash/debug.h"
18 #include "ash/display/display_controller.h" 18 #include "ash/display/display_controller.h"
19 #include "ash/display/display_manager.h" 19 #include "ash/display/display_manager.h"
20 #include "ash/focus_cycler.h" 20 #include "ash/focus_cycler.h"
21 #include "ash/ime_control_delegate.h" 21 #include "ash/ime_control_delegate.h"
22 #include "ash/launcher/launcher.h" 22 #include "ash/launcher/launcher.h"
23 #include "ash/launcher/launcher_delegate.h" 23 #include "ash/launcher/launcher_delegate.h"
24 #include "ash/launcher/launcher_model.h" 24 #include "ash/launcher/launcher_model.h"
25 #include "ash/magnifier/magnification_controller.h" 25 #include "ash/magnifier/magnification_controller.h"
26 #include "ash/magnifier/partial_magnification_controller.h" 26 #include "ash/magnifier/partial_magnification_controller.h"
27 #include "ash/multi_profile_uma.h"
27 #include "ash/root_window_controller.h" 28 #include "ash/root_window_controller.h"
28 #include "ash/rotator/screen_rotation.h" 29 #include "ash/rotator/screen_rotation.h"
29 #include "ash/screenshot_delegate.h" 30 #include "ash/screenshot_delegate.h"
30 #include "ash/session_state_delegate.h" 31 #include "ash/session_state_delegate.h"
31 #include "ash/shelf/shelf_widget.h" 32 #include "ash/shelf/shelf_widget.h"
32 #include "ash/shell.h" 33 #include "ash/shell.h"
33 #include "ash/shell_delegate.h" 34 #include "ash/shell_delegate.h"
34 #include "ash/shell_window_ids.h" 35 #include "ash/shell_window_ids.h"
35 #include "ash/system/brightness_control_delegate.h" 36 #include "ash/system/brightness_control_delegate.h"
36 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h" 37 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 191 }
191 192
192 bool SwitchToNextUser() { 193 bool SwitchToNextUser() {
193 if (!Shell::GetInstance()->delegate()->IsMultiProfilesEnabled() || 194 if (!Shell::GetInstance()->delegate()->IsMultiProfilesEnabled() ||
194 !ash::switches::ShowMultiProfileShelfMenu()) 195 !ash::switches::ShowMultiProfileShelfMenu())
195 return false; 196 return false;
196 ash::SessionStateDelegate* delegate = 197 ash::SessionStateDelegate* delegate =
197 ash::Shell::GetInstance()->session_state_delegate(); 198 ash::Shell::GetInstance()->session_state_delegate();
198 if (delegate->NumberOfLoggedInUsers() <= 1) 199 if (delegate->NumberOfLoggedInUsers() <= 1)
199 return false; 200 return false;
201 MultiProfileUMA::RecordSwitchActiveUser(
202 MultiProfileUMA::SWITCH_ACTIVE_USER_BY_ACCELERATOR);
200 delegate->SwitchActiveUserToNext(); 203 delegate->SwitchActiveUserToNext();
201 return true; 204 return true;
202 } 205 }
203 206
204 #endif // defined(OS_CHROMEOS) 207 #endif // defined(OS_CHROMEOS)
205 208
206 bool HandleRotatePaneFocus(Shell::Direction direction) { 209 bool HandleRotatePaneFocus(Shell::Direction direction) {
207 Shell* shell = Shell::GetInstance(); 210 Shell* shell = Shell::GetInstance();
208 switch (direction) { 211 switch (direction) {
209 case Shell::FORWARD: 212 case Shell::FORWARD:
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 keyboard_brightness_control_delegate) { 984 keyboard_brightness_control_delegate) {
982 keyboard_brightness_control_delegate_ = 985 keyboard_brightness_control_delegate_ =
983 keyboard_brightness_control_delegate.Pass(); 986 keyboard_brightness_control_delegate.Pass();
984 } 987 }
985 988
986 bool AcceleratorController::CanHandleAccelerators() const { 989 bool AcceleratorController::CanHandleAccelerators() const {
987 return true; 990 return true;
988 } 991 }
989 992
990 } // namespace ash 993 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/ash.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698