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

Side by Side Diff: chrome/browser/ui/ash/chrome_shell_delegate.cc

Issue 12481018: ash: Add metrics for screen lock and shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: report metric before requesting lock Created 7 years, 9 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/wm/session_state_controller_impl2.cc ('k') | no next file » | 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 "chrome/browser/ui/ash/chrome_shell_delegate.h" 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/host/root_window_host_factory.h" 8 #include "ash/host/root_window_host_factory.h"
9 #include "ash/launcher/launcher_types.h" 9 #include "ash/launcher/launcher_types.h"
10 #include "ash/magnifier/magnifier_constants.h" 10 #include "ash/magnifier/magnifier_constants.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 ash::UserMetricsAction action) { 208 ash::UserMetricsAction action) {
209 switch (action) { 209 switch (action) {
210 case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6: 210 case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6:
211 content::RecordAction( 211 content::RecordAction(
212 content::UserMetricsAction("Accel_KeyboardBrightnessDown_F6")); 212 content::UserMetricsAction("Accel_KeyboardBrightnessDown_F6"));
213 break; 213 break;
214 case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7: 214 case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7:
215 content::RecordAction( 215 content::RecordAction(
216 content::UserMetricsAction("Accel_KeyboardBrightnessUp_F7")); 216 content::UserMetricsAction("Accel_KeyboardBrightnessUp_F7"));
217 break; 217 break;
218 case ash::UMA_ACCEL_LOCK_SCREEN_L:
219 content::RecordAction(
220 content::UserMetricsAction("Accel_LockScreen_L"));
221 break;
222 case ash::UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON:
223 content::RecordAction(
224 content::UserMetricsAction("Accel_LockScreen_LockButton"));
225 break;
226 case ash::UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON:
227 content::RecordAction(
228 content::UserMetricsAction("Accel_LockScreen_PowerButton"));
229 break;
218 case ash::UMA_ACCEL_MAXIMIZE_RESTORE_F4: 230 case ash::UMA_ACCEL_MAXIMIZE_RESTORE_F4:
219 content::RecordAction( 231 content::RecordAction(
220 content::UserMetricsAction("Accel_Maximize_Restore_F4")); 232 content::UserMetricsAction("Accel_Maximize_Restore_F4"));
221 break; 233 break;
222 case ash::UMA_ACCEL_NEWTAB_T: 234 case ash::UMA_ACCEL_NEWTAB_T:
223 content::RecordAction(content::UserMetricsAction("Accel_NewTab_T")); 235 content::RecordAction(content::UserMetricsAction("Accel_NewTab_T"));
224 break; 236 break;
225 case ash::UMA_ACCEL_NEXTWINDOW_F5: 237 case ash::UMA_ACCEL_NEXTWINDOW_F5:
226 content::RecordAction(content::UserMetricsAction("Accel_NextWindow_F5")); 238 content::RecordAction(content::UserMetricsAction("Accel_NextWindow_F5"));
227 break; 239 break;
228 case ash::UMA_ACCEL_NEXTWINDOW_TAB: 240 case ash::UMA_ACCEL_NEXTWINDOW_TAB:
229 content::RecordAction(content::UserMetricsAction("Accel_NextWindow_Tab")); 241 content::RecordAction(content::UserMetricsAction("Accel_NextWindow_Tab"));
230 break; 242 break;
231 case ash::UMA_ACCEL_PREVWINDOW_F5: 243 case ash::UMA_ACCEL_PREVWINDOW_F5:
232 content::RecordAction(content::UserMetricsAction("Accel_PrevWindow_F5")); 244 content::RecordAction(content::UserMetricsAction("Accel_PrevWindow_F5"));
233 break; 245 break;
234 case ash::UMA_ACCEL_PREVWINDOW_TAB: 246 case ash::UMA_ACCEL_PREVWINDOW_TAB:
235 content::RecordAction(content::UserMetricsAction("Accel_PrevWindow_Tab")); 247 content::RecordAction(content::UserMetricsAction("Accel_PrevWindow_Tab"));
236 break; 248 break;
237 case ash::UMA_ACCEL_SEARCH_LWIN: 249 case ash::UMA_ACCEL_SEARCH_LWIN:
238 content::RecordAction(content::UserMetricsAction("Accel_Search_LWin")); 250 content::RecordAction(content::UserMetricsAction("Accel_Search_LWin"));
239 break; 251 break;
252 case ash::UMA_ACCEL_SHUT_DOWN_POWER_BUTTON:
253 content::RecordAction(
254 content::UserMetricsAction("Accel_ShutDown_PowerButton"));
255 break;
240 case ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE: 256 case ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE:
241 content::RecordAction(content::UserMetricsAction("MaxButton_Maximize")); 257 content::RecordAction(content::UserMetricsAction("MaxButton_Maximize"));
242 break; 258 break;
243 case ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE_LEFT: 259 case ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE_LEFT:
244 content::RecordAction(content::UserMetricsAction("MaxButton_MaxLeft")); 260 content::RecordAction(content::UserMetricsAction("MaxButton_MaxLeft"));
245 break; 261 break;
246 case ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT: 262 case ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT:
247 content::RecordAction(content::UserMetricsAction("MaxButton_MaxRight")); 263 content::RecordAction(content::UserMetricsAction("MaxButton_MaxRight"));
248 break; 264 break;
249 case ash::UMA_MAXIMIZE_BUTTON_MINIMIZE: 265 case ash::UMA_MAXIMIZE_BUTTON_MINIMIZE:
(...skipping 19 matching lines...) Expand all
269 content::RecordAction( 285 content::RecordAction(
270 content::UserMetricsAction("Caption_ClickTogglesMaximize")); 286 content::UserMetricsAction("Caption_ClickTogglesMaximize"));
271 break; 287 break;
272 case ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE: 288 case ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE:
273 content::RecordAction( 289 content::RecordAction(
274 content::UserMetricsAction("Caption_GestureTogglesMaximize")); 290 content::UserMetricsAction("Caption_GestureTogglesMaximize"));
275 break; 291 break;
276 case ash::UMA_TOUCHSCREEN_TAP_DOWN: 292 case ash::UMA_TOUCHSCREEN_TAP_DOWN:
277 content::RecordAction(content::UserMetricsAction("Touchscreen_Down")); 293 content::RecordAction(content::UserMetricsAction("Touchscreen_Down"));
278 break; 294 break;
295 case ash::UMA_TRAY_HELP:
296 content::RecordAction(content::UserMetricsAction("Tray_Help"));
297 break;
298 case ash::UMA_TRAY_LOCK_SCREEN:
299 content::RecordAction(content::UserMetricsAction("Tray_LockScreen"));
300 break;
301 case ash::UMA_TRAY_SHUT_DOWN:
302 content::RecordAction(content::UserMetricsAction("Tray_ShutDown"));
303 break;
279 } 304 }
280 } 305 }
281 306
282 string16 ChromeShellDelegate::GetTimeRemainingString(base::TimeDelta delta) { 307 string16 ChromeShellDelegate::GetTimeRemainingString(base::TimeDelta delta) {
283 return TimeFormat::TimeRemainingLong(delta); 308 return TimeFormat::TimeRemainingLong(delta);
284 } 309 }
285 310
286 string16 ChromeShellDelegate::GetTimeDurationLongString(base::TimeDelta delta) { 311 string16 ChromeShellDelegate::GetTimeDurationLongString(base::TimeDelta delta) {
287 return TimeFormat::TimeDurationLong(delta); 312 return TimeFormat::TimeDurationLong(delta);
288 } 313 }
(...skipping 16 matching lines...) Expand all
305 } 330 }
306 331
307 Browser* ChromeShellDelegate::GetTargetBrowser() { 332 Browser* ChromeShellDelegate::GetTargetBrowser() {
308 Browser* browser = chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()); 333 Browser* browser = chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow());
309 if (browser) 334 if (browser)
310 return browser; 335 return browser;
311 return chrome::FindOrCreateTabbedBrowser( 336 return chrome::FindOrCreateTabbedBrowser(
312 ProfileManager::GetDefaultProfileOrOffTheRecord(), 337 ProfileManager::GetDefaultProfileOrOffTheRecord(),
313 chrome::HOST_DESKTOP_TYPE_ASH); 338 chrome::HOST_DESKTOP_TYPE_ASH);
314 } 339 }
OLDNEW
« no previous file with comments | « ash/wm/session_state_controller_impl2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698