diff options
author | harrym@chromium.org <harrym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-13 08:10:18 +0000 |
---|---|---|
committer | harrym@chromium.org <harrym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-13 08:10:18 +0000 |
commit | 5d2ea361990ac129fd0385c4c85efd17917edfc0 (patch) | |
tree | 028f0b44d7bda24c341e4bd65e58c2b6b88a1967 | |
parent | 7f635540943693cca1748e6f7d7345269befac59 (diff) | |
download | chromium_src-5d2ea361990ac129fd0385c4c85efd17917edfc0.zip chromium_src-5d2ea361990ac129fd0385c4c85efd17917edfc0.tar.gz chromium_src-5d2ea361990ac129fd0385c4c85efd17917edfc0.tar.bz2 |
Adding UMA metric tracking to the status are menu and related tray views to track usage of the menu's.
BUG=297046
Review URL: https://codereview.chromium.org/73583003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240537 0039d316-1c4b-4281-b951-d872f2087c98
46 files changed, 728 insertions, 370 deletions
diff --git a/ash/accelerators/exit_warning_handler.cc b/ash/accelerators/exit_warning_handler.cc index 1f8b53e..776068e 100644 --- a/ash/accelerators/exit_warning_handler.cc +++ b/ash/accelerators/exit_warning_handler.cc @@ -4,6 +4,7 @@ #include "ash/accelerators/exit_warning_handler.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" #include "ash/shell_delegate.h" #include "ash/shell_window_ids.h" @@ -126,13 +127,15 @@ void ExitWarningHandler::HandleAccelerator() { state_ = WAIT_FOR_DOUBLE_PRESS; Show(); StartTimer(); - shell_delegate->RecordUserMetricsAction(UMA_ACCEL_EXIT_FIRST_Q); + Shell::GetInstance()-> + metrics()->RecordUserMetricsAction(UMA_ACCEL_EXIT_FIRST_Q); break; case WAIT_FOR_DOUBLE_PRESS: state_ = EXITING; CancelTimer(); Hide(); - shell_delegate->RecordUserMetricsAction(UMA_ACCEL_EXIT_SECOND_Q); + Shell::GetInstance()-> + metrics()->RecordUserMetricsAction(UMA_ACCEL_EXIT_SECOND_Q); shell_delegate->Exit(); break; case EXITING: diff --git a/ash/ash.gyp b/ash/ash.gyp index 038f5c80..08202d2 100644 --- a/ash/ash.gyp +++ b/ash/ash.gyp @@ -165,10 +165,10 @@ 'magnifier/magnifier_constants.h', 'magnifier/partial_magnification_controller.cc', 'magnifier/partial_magnification_controller.h', + 'metrics/user_metrics_recorder.cc', + 'metrics/user_metrics_recorder.h', 'multi_profile_uma.cc', 'multi_profile_uma.h', - 'periodic_metrics_recorder.cc', - 'periodic_metrics_recorder.h', 'popup_message.cc', 'popup_message.h', 'root_window_controller.cc', diff --git a/ash/metrics/user_metrics_recorder.cc b/ash/metrics/user_metrics_recorder.cc new file mode 100644 index 0000000..a08da8f --- /dev/null +++ b/ash/metrics/user_metrics_recorder.cc @@ -0,0 +1,375 @@ +// 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/metrics/user_metrics_recorder.h" + +#include "ash/shelf/shelf_layout_manager.h" +#include "ash/shelf/shelf_view.h" +#include "ash/shelf/shelf_widget.h" +#include "ash/shell.h" +#include "base/metrics/histogram.h" +#include "content/public/browser/user_metrics.h" + +namespace ash { + +// Time in seconds between calls to "RecordPeriodicMetrics". +const int kAshPeriodicMetricsTimeInSeconds = 30 * 60; + +UserMetricsRecorder::UserMetricsRecorder() { + timer_.Start(FROM_HERE, + base::TimeDelta::FromSeconds(kAshPeriodicMetricsTimeInSeconds), + this, + &UserMetricsRecorder::RecordPeriodicMetrics); +} + +UserMetricsRecorder::~UserMetricsRecorder() { + timer_.Stop(); +} + +void UserMetricsRecorder::RecordUserMetricsAction(UserMetricsAction action) { + switch (action) { + case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6: + content::RecordAction( + content::UserMetricsAction("Accel_KeyboardBrightnessDown_F6")); + break; + case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7: + content::RecordAction( + content::UserMetricsAction("Accel_KeyboardBrightnessUp_F7")); + break; + case ash::UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON: + content::RecordAction( + content::UserMetricsAction("Accel_LockScreen_LockButton")); + break; + case ash::UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON: + content::RecordAction( + content::UserMetricsAction("Accel_LockScreen_PowerButton")); + break; + case ash::UMA_ACCEL_MAXIMIZE_RESTORE_F4: + content::RecordAction( + content::UserMetricsAction("Accel_Maximize_Restore_F4")); + break; + case ash::UMA_ACCEL_PREVWINDOW_F5: + content::RecordAction(content::UserMetricsAction("Accel_PrevWindow_F5")); + break; + case ash::UMA_ACCEL_EXIT_FIRST_Q: + content::RecordAction(content::UserMetricsAction("Accel_Exit_First_Q")); + break; + case ash::UMA_ACCEL_EXIT_SECOND_Q: + content::RecordAction(content::UserMetricsAction("Accel_Exit_Second_Q")); + break; + case ash::UMA_ACCEL_SHUT_DOWN_POWER_BUTTON: + content::RecordAction( + content::UserMetricsAction("Accel_ShutDown_PowerButton")); + break; + case ash::UMA_CLOSE_THROUGH_CONTEXT_MENU: + content::RecordAction(content::UserMetricsAction("CloseFromContextMenu")); + break; + case ash::UMA_GESTURE_OVERVIEW: + content::RecordAction(content::UserMetricsAction("Gesture_Overview")); + break; + case ash::UMA_LAUNCHER_CLICK_ON_APP: + content::RecordAction(content::UserMetricsAction("Launcher_ClickOnApp")); + break; + case ash::UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON: + content::RecordAction( + content::UserMetricsAction("Launcher_ClickOnApplistButton")); + break; + case ash::UMA_MOUSE_DOWN: + content::RecordAction(content::UserMetricsAction("Mouse_Down")); + break; + case ash::UMA_SHELF_ALIGNMENT_SET_BOTTOM: + content::RecordAction( + content::UserMetricsAction("Shelf_AlignmentSetBottom")); + break; + case ash::UMA_SHELF_ALIGNMENT_SET_LEFT: + content::RecordAction( + content::UserMetricsAction("Shelf_AlignmentSetLeft")); + break; + case ash::UMA_SHELF_ALIGNMENT_SET_RIGHT: + content::RecordAction( + content::UserMetricsAction("Shelf_AlignmentSetRight")); + case ash::UMA_STATUS_AREA_AUDIO_CURRENT_INPUT_DEVICE: + content::RecordAction( + content::UserMetricsAction("StatusArea_Audio_CurrentInputDevice")); + break; + case ash::UMA_STATUS_AREA_AUDIO_CURRENT_OUTPUT_DEVICE: + content::RecordAction( + content::UserMetricsAction("StatusArea_Audio_CurrentOutputDevice")); + break; + case ash::UMA_STATUS_AREA_AUDIO_SWITCH_INPUT_DEVICE: + content::RecordAction( + content::UserMetricsAction("StatusArea_Audio_SwitchInputDevice")); + break; + case ash::UMA_STATUS_AREA_AUDIO_SWITCH_OUTPUT_DEVICE: + content::RecordAction( + content::UserMetricsAction("StatusArea_Audio_SwitchOutputDevice")); + break; + case ash::UMA_STATUS_AREA_BRIGHTNESS_CHANGED: + content::RecordAction( + content::UserMetricsAction("StatusArea_BrightnessChanged")); + break; + case ash::UMA_STATUS_AREA_BLUETOOTH_CONNECT_KNOWN_DEVICE: + content::RecordAction( + content::UserMetricsAction("StatusArea_Bluetooth_Connect_Known")); + break; + case ash::UMA_STATUS_AREA_BLUETOOTH_CONNECT_UNKNOWN_DEVICE: + content::RecordAction( + content::UserMetricsAction("StatusArea_Bluetooth_Connect_Unknown")); + break; + case ash::UMA_STATUS_AREA_BLUETOOTH_DISABLED: + content::RecordAction( + content::UserMetricsAction("StatusArea_Bluetooth_Disabled")); + break; + case ash::UMA_STATUS_AREA_BLUETOOTH_ENABLED: + content::RecordAction( + content::UserMetricsAction("StatusArea_Bluetooth_Enabled")); + break; + case ash::UMA_STATUS_AREA_CAPS_LOCK_DETAILED: + content::RecordAction( + content::UserMetricsAction("StatusArea_CapsLock_Detailed")); + break; + case ash::UMA_STATUS_AREA_CAPS_LOCK_DISABLED_BY_CLICK: + content::RecordAction( + content::UserMetricsAction("StatusArea_CapsLock_DisabledByClick")); + break; + case ash::UMA_STATUS_AREA_CAPS_LOCK_ENABLED_BY_CLICK: + content::RecordAction( + content::UserMetricsAction("StatusArea_CapsLock_EnabledByClick")); + break; + case ash::UMA_STATUS_AREA_CAPS_LOCK_POPUP: + content::RecordAction( + content::UserMetricsAction("StatusArea_CapsLock_Popup")); + break; + case ash::UMA_STATUS_AREA_CONNECT_TO_CONFIGURED_NETWORK: + content::RecordAction( + content::UserMetricsAction("StatusArea_Network_ConnectConfigured")); + break; + case ash::UMA_STATUS_AREA_CONNECT_TO_UNCONFIGURED_NETWORK: + content::RecordAction( + content::UserMetricsAction("StatusArea_Network_ConnectUnconfigured")); + break; + case ash::UMA_STATUS_AREA_CONNECT_TO_VPN: + content::RecordAction( + content::UserMetricsAction("StatusArea_VPN_ConnectToNetwork")); + break; + case ash::UMA_STATUS_AREA_CHANGED_VOLUME_MENU: + content::RecordAction( + content::UserMetricsAction("StatusArea_Volume_ChangedMenu")); + break; + case ash::UMA_STATUS_AREA_CHANGED_VOLUME_POPUP: + content::RecordAction( + content::UserMetricsAction("StatusArea_Volume_ChangedPopup")); + break; + case ash::UMA_STATUS_AREA_DETAILED_ACCESSABILITY: + content::RecordAction( + content::UserMetricsAction("StatusArea_Accessability_DetailedView")); + break; + case ash::UMA_STATUS_AREA_DETAILED_AUDIO_VIEW: + content::RecordAction( + content::UserMetricsAction("StatusArea_Audio_Detailed")); + break; + case ash::UMA_STATUS_AREA_DETAILED_BLUETOOTH_VIEW: + content::RecordAction( + content::UserMetricsAction("StatusArea_Bluetooth_Detailed")); + break; + case ash::UMA_STATUS_AREA_DETAILED_BRIGHTNESS_VIEW: + content::RecordAction( + content::UserMetricsAction("StatusArea_Brightness_Detailed")); + break; + case ash::UMA_STATUS_AREA_DETAILED_DRIVE_VIEW: + content::RecordAction( + content::UserMetricsAction("StatusArea_Drive_Detailed")); + break; + case ash::UMA_STATUS_AREA_DETAILED_NETWORK_VIEW: + content::RecordAction( + content::UserMetricsAction("StatusArea_Network_Detailed")); + break; + case ash::UMA_STATUS_AREA_DETAILED_VPN_VIEW: + content::RecordAction( + content::UserMetricsAction("StatusArea_VPN_Detailed")); + break; + case ash::UMA_STATUS_AREA_DISABLE_AUTO_CLICK: + content::RecordAction( + content::UserMetricsAction("StatusArea_AutoClickDisabled")); + break; + case ash::UMA_STATUS_AREA_DISABLE_HIGH_CONTRAST: + content::RecordAction( + content::UserMetricsAction("StatusArea_HighContrastDisabled")); + break; + case ash::UMA_STATUS_AREA_DISABLE_LARGE_CURSOR: + content::RecordAction( + content::UserMetricsAction("StatusArea_LargeCursorDisabled")); + break; + case ash::UMA_STATUS_AREA_DISABLE_MAGNIFIER: + content::RecordAction( + content::UserMetricsAction("StatusArea_MagnifierDisabled")); + break; + case ash::UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK: + content::RecordAction( + content::UserMetricsAction("StatusArea_SpokenFeedbackDisabled")); + break; + case ash::UMA_STATUS_AREA_DISABLE_WIFI: + content::RecordAction( + content::UserMetricsAction("StatusArea_Network_WifiDisabled")); + break; + case ash::UMA_STATUS_AREA_DRIVE_CANCEL_OPERATION: + content::RecordAction( + content::UserMetricsAction("StatusArea_Drive_CancelOperation")); + break; + case ash::UMA_STATUS_AREA_DRIVE_SETTINGS: + content::RecordAction( + content::UserMetricsAction("StatusArea_Drive_Settings")); + break; + case ash::UMA_STATUS_AREA_ENABLE_AUTO_CLICK: + content::RecordAction( + content::UserMetricsAction("StatusArea_AutoClickEnabled")); + break; + case ash::UMA_STATUS_AREA_ENABLE_HIGH_CONTRAST: + content::RecordAction( + content::UserMetricsAction("StatusArea_HighContrastEnabled")); + break; + case ash::UMA_STATUS_AREA_ENABLE_LARGE_CURSOR: + content::RecordAction( + content::UserMetricsAction("StatusArea_LargeCursorEnabled")); + break; + case ash::UMA_STATUS_AREA_ENABLE_MAGNIFIER: + content::RecordAction( + content::UserMetricsAction("StatusArea_MagnifierEnabled")); + break; + case ash::UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK: + content::RecordAction( + content::UserMetricsAction("StatusArea_SpokenFeedbackEnabled")); + break; + case ash::UMA_STATUS_AREA_ENABLE_WIFI: + content::RecordAction( + content::UserMetricsAction("StatusArea_Network_WifiEnabled")); + break; + case ash::UMA_STATUS_AREA_IME_SHOW_DETAILED: + content::RecordAction( + content::UserMetricsAction("StatusArea_IME_Detailed")); + break; + case ash::UMA_STATUS_AREA_IME_SWITCH_MODE: + content::RecordAction( + content::UserMetricsAction("StatusArea_IME_SwitchMode")); + break; + case ash::UMA_STATUS_AREA_MENU_OPENED: + content::RecordAction( + content::UserMetricsAction("StatusArea_MenuOpened")); + break; + case ash::UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED: + content::RecordAction( + content::UserMetricsAction("StatusArea_Network_JoinOther")); + break; + case ash::UMA_STATUS_AREA_NETWORK_SETTINGS_CLICKED: + content::RecordAction( + content::UserMetricsAction("StatusArea_Network_Settings")); + break; + case ash::UMA_STATUS_AREA_SHOW_NETWORK_CONNECTION_DETAILS: + content::RecordAction( + content::UserMetricsAction("StatusArea_Network_ConnectionDetails")); + break; + case ash::UMA_STATUS_AREA_SHOW_VPN_CONNECTION_DETAILS: + content::RecordAction( + content::UserMetricsAction("StatusArea_VPN_ConnectionDetails")); + break; + case ash::UMA_STATUS_AREA_SIGN_OUT: + content::RecordAction( + content::UserMetricsAction("StatusArea_SignOut")); + break; + case ash::UMA_STATUS_AREA_VPN_JOIN_OTHER_CLICKED: + content::RecordAction( + content::UserMetricsAction("StatusArea_VPN_JoinOther")); + break; + case ash::UMA_STATUS_AREA_VPN_SETTINGS_CLICKED: + content::RecordAction( + content::UserMetricsAction("StatusArea_VPN_Settings")); + break; + case ash::UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK: + content::RecordAction( + content::UserMetricsAction("Caption_ClickTogglesMaximize")); + break; + case ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE: + content::RecordAction( + content::UserMetricsAction("Caption_GestureTogglesMaximize")); + break; + case ash::UMA_TOUCHPAD_GESTURE_OVERVIEW: + content::RecordAction( + content::UserMetricsAction("Touchpad_Gesture_Overview")); + break; + case ash::UMA_TOUCHSCREEN_TAP_DOWN: + content::RecordAction(content::UserMetricsAction("Touchscreen_Down")); + break; + case ash::UMA_TRAY_HELP: + content::RecordAction(content::UserMetricsAction("Tray_Help")); + break; + case ash::UMA_TRAY_LOCK_SCREEN: + content::RecordAction(content::UserMetricsAction("Tray_LockScreen")); + break; + case ash::UMA_TRAY_SHUT_DOWN: + content::RecordAction(content::UserMetricsAction("Tray_ShutDown")); + break; + case ash::UMA_WINDOW_APP_CLOSE_BUTTON_CLICK: + content::RecordAction(content::UserMetricsAction("AppCloseButton_Clk")); + break; + case ash::UMA_WINDOW_CLOSE_BUTTON_CLICK: + content::RecordAction(content::UserMetricsAction("CloseButton_Clk")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN: + content::RecordAction(content::UserMetricsAction("MaxButton_Clk_ExitFS")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE: + content::RecordAction( + content::UserMetricsAction("MaxButton_Clk_Restore")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE: + content::RecordAction( + content::UserMetricsAction("MaxButton_Clk_Maximize")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE: + content::RecordAction(content::UserMetricsAction("MinButton_Clk")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE: + content::RecordAction(content::UserMetricsAction("MaxButton_Maximize")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT: + content::RecordAction(content::UserMetricsAction("MaxButton_MaxLeft")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT: + content::RecordAction(content::UserMetricsAction("MaxButton_MaxRight")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MINIMIZE: + content::RecordAction(content::UserMetricsAction("MaxButton_Minimize")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_RESTORE: + content::RecordAction(content::UserMetricsAction("MaxButton_Restore")); + break; + case ash::UMA_WINDOW_MAXIMIZE_BUTTON_SHOW_BUBBLE: + content::RecordAction(content::UserMetricsAction("MaxButton_ShowBubble")); + break; + case ash::UMA_WINDOW_OVERVIEW: + content::RecordAction( + content::UserMetricsAction("WindowSelector_Overview")); + break; + case ash::UMA_WINDOW_SELECTION: + content::RecordAction( + content::UserMetricsAction("WindowSelector_Selection")); + break; + } +} + +void UserMetricsRecorder::RecordPeriodicMetrics() { + internal::ShelfLayoutManager* manager = + internal::ShelfLayoutManager::ForLauncher(Shell::GetPrimaryRootWindow()); + if (manager) { + UMA_HISTOGRAM_ENUMERATION("Ash.ShelfAlignmentOverTime", + manager->SelectValueForShelfAlignment( + internal::SHELF_ALIGNMENT_UMA_ENUM_VALUE_BOTTOM, + internal::SHELF_ALIGNMENT_UMA_ENUM_VALUE_LEFT, + internal::SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT, + -1), + internal::SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT); + } +} + +} // namespace ash diff --git a/ash/metrics/user_metrics_recorder.h b/ash/metrics/user_metrics_recorder.h new file mode 100644 index 0000000..dc7043b --- /dev/null +++ b/ash/metrics/user_metrics_recorder.h @@ -0,0 +1,129 @@ +// 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_USER_METRICS_RECORDER_H_ +#define ASH_USER_METRICS_RECORDER_H_ + +#include "ash/ash_export.h" +#include "base/timer/timer.h" + +namespace ash { + +enum UserMetricsAction { + UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6, + UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7, + UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON, + UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON, + UMA_ACCEL_MAXIMIZE_RESTORE_F4, + UMA_ACCEL_PREVWINDOW_F5, + UMA_ACCEL_EXIT_FIRST_Q, + UMA_ACCEL_EXIT_SECOND_Q, + UMA_ACCEL_SHUT_DOWN_POWER_BUTTON, + UMA_CLOSE_THROUGH_CONTEXT_MENU, + UMA_GESTURE_OVERVIEW, + UMA_LAUNCHER_CLICK_ON_APP, + UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON, + UMA_MOUSE_DOWN, + UMA_SHELF_ALIGNMENT_SET_BOTTOM, + UMA_SHELF_ALIGNMENT_SET_LEFT, + UMA_SHELF_ALIGNMENT_SET_RIGHT, + UMA_STATUS_AREA_AUDIO_CURRENT_INPUT_DEVICE, + UMA_STATUS_AREA_AUDIO_CURRENT_OUTPUT_DEVICE, + UMA_STATUS_AREA_AUDIO_SWITCH_INPUT_DEVICE, + UMA_STATUS_AREA_AUDIO_SWITCH_OUTPUT_DEVICE, + UMA_STATUS_AREA_BRIGHTNESS_CHANGED, + UMA_STATUS_AREA_BLUETOOTH_CONNECT_KNOWN_DEVICE, + UMA_STATUS_AREA_BLUETOOTH_CONNECT_UNKNOWN_DEVICE, + UMA_STATUS_AREA_BLUETOOTH_DISABLED, + UMA_STATUS_AREA_BLUETOOTH_ENABLED, + UMA_STATUS_AREA_CAPS_LOCK_DETAILED, + UMA_STATUS_AREA_CAPS_LOCK_DISABLED_BY_CLICK, + UMA_STATUS_AREA_CAPS_LOCK_ENABLED_BY_CLICK, + UMA_STATUS_AREA_CAPS_LOCK_POPUP, + UMA_STATUS_AREA_CONNECT_TO_CONFIGURED_NETWORK, + UMA_STATUS_AREA_CONNECT_TO_UNCONFIGURED_NETWORK, + UMA_STATUS_AREA_CONNECT_TO_VPN, + UMA_STATUS_AREA_CHANGED_VOLUME_MENU, + UMA_STATUS_AREA_CHANGED_VOLUME_POPUP, + UMA_STATUS_AREA_DETAILED_ACCESSABILITY, + UMA_STATUS_AREA_DETAILED_AUDIO_VIEW, + UMA_STATUS_AREA_DETAILED_BLUETOOTH_VIEW, + UMA_STATUS_AREA_DETAILED_BRIGHTNESS_VIEW, + UMA_STATUS_AREA_DETAILED_DRIVE_VIEW, + UMA_STATUS_AREA_DETAILED_NETWORK_VIEW, + UMA_STATUS_AREA_DETAILED_VPN_VIEW, + UMA_STATUS_AREA_DISABLE_AUTO_CLICK, + UMA_STATUS_AREA_DISABLE_HIGH_CONTRAST, + UMA_STATUS_AREA_DISABLE_LARGE_CURSOR, + UMA_STATUS_AREA_DISABLE_MAGNIFIER, + UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK, + UMA_STATUS_AREA_DISABLE_WIFI, + UMA_STATUS_AREA_DRIVE_CANCEL_OPERATION, + UMA_STATUS_AREA_DRIVE_SETTINGS, + UMA_STATUS_AREA_ENABLE_AUTO_CLICK, + UMA_STATUS_AREA_ENABLE_HIGH_CONTRAST, + UMA_STATUS_AREA_ENABLE_LARGE_CURSOR, + UMA_STATUS_AREA_ENABLE_MAGNIFIER, + UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK, + UMA_STATUS_AREA_ENABLE_WIFI, + UMA_STATUS_AREA_IME_SHOW_DETAILED, + UMA_STATUS_AREA_IME_SWITCH_MODE, + UMA_STATUS_AREA_MENU_OPENED, + UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED, + UMA_STATUS_AREA_NETWORK_SETTINGS_CLICKED, + UMA_STATUS_AREA_SHOW_NETWORK_CONNECTION_DETAILS, + UMA_STATUS_AREA_SHOW_VPN_CONNECTION_DETAILS, + UMA_STATUS_AREA_SIGN_OUT, + UMA_STATUS_AREA_VPN_JOIN_OTHER_CLICKED, + UMA_STATUS_AREA_VPN_SETTINGS_CLICKED, + UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK, + UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE, + UMA_TOUCHPAD_GESTURE_OVERVIEW, + UMA_TOUCHSCREEN_TAP_DOWN, + UMA_TRAY_HELP, + UMA_TRAY_LOCK_SCREEN, + UMA_TRAY_SHUT_DOWN, + UMA_WINDOW_APP_CLOSE_BUTTON_CLICK, + UMA_WINDOW_CLOSE_BUTTON_CLICK, + UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN, + UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE, + UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE, + UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE, + UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE, + UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT, + UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT, + UMA_WINDOW_MAXIMIZE_BUTTON_MINIMIZE, + UMA_WINDOW_MAXIMIZE_BUTTON_RESTORE, + UMA_WINDOW_MAXIMIZE_BUTTON_SHOW_BUBBLE, + + // Thumbnail sized overview of windows triggered. This is a subset of + // UMA_WINDOW_SELECTION triggered by lingering during alt+tab cycles or + // pressing the overview key. + UMA_WINDOW_OVERVIEW, + + // Window selection started by beginning an alt+tab cycle or pressing the + // overview key. This does not count each step through an alt+tab cycle. + UMA_WINDOW_SELECTION, +}; + +// User Metrics Recorder provides a repeating callback (RecordPeriodicMetrics) +// on a timer to allow recording of state data over time to the UMA records. +// Any additional states (in ash) that require monitoring can be added to +// this class. As well calls to record on action metrics +// (RecordUserMetricsAction) are passed through the UserMetricsRecorder. +class ASH_EXPORT UserMetricsRecorder { + public: + UserMetricsRecorder(); + ~UserMetricsRecorder(); + + void RecordUserMetricsAction(ash::UserMetricsAction action); + private: + void RecordPeriodicMetrics(); + + base::RepeatingTimer<UserMetricsRecorder> timer_; +}; + +} // namespace ash + +#endif // ASH_USER_METRICS_RECORDER_H_ diff --git a/ash/periodic_metrics_recorder.cc b/ash/periodic_metrics_recorder.cc deleted file mode 100644 index 93f83a4..0000000 --- a/ash/periodic_metrics_recorder.cc +++ /dev/null @@ -1,82 +0,0 @@ -// 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/periodic_metrics_recorder.h" - -#include "ash/shelf/shelf_layout_manager.h" -#include "ash/shelf/shelf_view.h" -#include "ash/shelf/shelf_widget.h" -#include "ash/shell.h" -#include "ash/wm/window_state.h" -#include "base/metrics/histogram.h" - -namespace ash { - -// Time in seconds between calls to "RecordMetrics". -const int kAshPeriodicMetricsTimeInSeconds = 30 * 60; - -PeriodicMetricsRecorder::PeriodicMetricsRecorder() { - timer_.Start(FROM_HERE, - base::TimeDelta::FromSeconds(kAshPeriodicMetricsTimeInSeconds), - this, - &PeriodicMetricsRecorder::RecordMetrics); -} - -PeriodicMetricsRecorder::~PeriodicMetricsRecorder() { - timer_.Stop(); -} - -void PeriodicMetricsRecorder::RecordMetrics() { - internal::ShelfLayoutManager* manager = - internal::ShelfLayoutManager::ForLauncher(Shell::GetPrimaryRootWindow()); - if (manager) { - UMA_HISTOGRAM_ENUMERATION("Ash.ShelfAlignmentOverTime", - manager->SelectValueForShelfAlignment( - internal::SHELF_ALIGNMENT_UMA_ENUM_VALUE_BOTTOM, - internal::SHELF_ALIGNMENT_UMA_ENUM_VALUE_LEFT, - internal::SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT, - -1), - internal::SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT); - } - - enum ActiveWindowShowType { - ACTIVE_WINDOW_SHOW_TYPE_NO_ACTIVE_WINDOW, - ACTIVE_WINDOW_SHOW_TYPE_OTHER, - ACTIVE_WINDOW_SHOW_TYPE_MAXIMIZED, - ACTIVE_WINDOW_SHOW_TYPE_FULLSCREEN, - ACTIVE_WINDOW_SHOW_TYPE_SNAPPED, - ACTIVE_WINDOW_SHOW_TYPE_COUNT - }; - ActiveWindowShowType active_window_show_type = - ACTIVE_WINDOW_SHOW_TYPE_NO_ACTIVE_WINDOW; - wm::WindowState* active_window_state = ash::wm::GetActiveWindowState(); - if (active_window_state) { - switch(active_window_state->window_show_type()) { - case wm::SHOW_TYPE_MAXIMIZED: - active_window_show_type = ACTIVE_WINDOW_SHOW_TYPE_MAXIMIZED; - break; - case wm::SHOW_TYPE_FULLSCREEN: - active_window_show_type = ACTIVE_WINDOW_SHOW_TYPE_FULLSCREEN; - break; - case wm::SHOW_TYPE_LEFT_SNAPPED: - case wm::SHOW_TYPE_RIGHT_SNAPPED: - active_window_show_type = ACTIVE_WINDOW_SHOW_TYPE_SNAPPED; - break; - case wm::SHOW_TYPE_DEFAULT: - case wm::SHOW_TYPE_NORMAL: - case wm::SHOW_TYPE_MINIMIZED: - case wm::SHOW_TYPE_INACTIVE: - case wm::SHOW_TYPE_DETACHED: - case wm::SHOW_TYPE_END: - case wm::SHOW_TYPE_AUTO_POSITIONED: - active_window_show_type = ACTIVE_WINDOW_SHOW_TYPE_OTHER; - break; - } - UMA_HISTOGRAM_ENUMERATION("Ash.ActiveWindowShowTypeOverTime", - active_window_show_type, - ACTIVE_WINDOW_SHOW_TYPE_COUNT); - } -} - -} // namespace ash diff --git a/ash/periodic_metrics_recorder.h b/ash/periodic_metrics_recorder.h deleted file mode 100644 index 9b081ab..0000000 --- a/ash/periodic_metrics_recorder.h +++ /dev/null @@ -1,29 +0,0 @@ -// 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_PERIODIC_METRICS_RECORDER_H_ -#define ASH_PERIODIC_METRICS_RECORDER_H_ - -#include "base/timer/timer.h" - -namespace ash { - -// Periodic Metrics Recorder provides a repeating callback (RecordMetrics) -// on a timer to allow recording of state data over time to the UMA records. -// Any additional states (in ash) that require monitoring can be added to -// this class. -class PeriodicMetricsRecorder { - public: - PeriodicMetricsRecorder(); - ~PeriodicMetricsRecorder(); - - private: - void RecordMetrics(); - - base::RepeatingTimer<PeriodicMetricsRecorder> timer_; -}; - -} // namespace ash - -#endif // ASH_PERIODIC_METRICS_RECORDER_H_ diff --git a/ash/shelf/shelf_alignment_menu.cc b/ash/shelf/shelf_alignment_menu.cc index d6cd384..3f77da1 100644 --- a/ash/shelf/shelf_alignment_menu.cc +++ b/ash/shelf/shelf_alignment_menu.cc @@ -4,10 +4,10 @@ #include "ash/shelf/shelf_alignment_menu.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shelf/shelf_layout_manager.h" #include "ash/shelf/shelf_types.h" #include "ash/shell.h" -#include "ash/shell_delegate.h" #include "grit/ash_strings.h" #include "ui/aura/window.h" #include "ui/base/l10n/l10n_util.h" @@ -55,20 +55,20 @@ bool ShelfAlignmentMenu::GetAcceleratorForCommandId( void ShelfAlignmentMenu::ExecuteCommand(int command_id, int event_flags) { switch (static_cast<MenuItem>(command_id)) { case MENU_ALIGN_LEFT: - Shell::GetInstance()->delegate()->RecordUserMetricsAction( - UMA_SHELF_ALIGNMENT_SET_LEFT); + Shell::GetInstance()->metrics()-> + RecordUserMetricsAction(UMA_SHELF_ALIGNMENT_SET_LEFT); Shell::GetInstance()->SetShelfAlignment(SHELF_ALIGNMENT_LEFT, root_window_); break; case MENU_ALIGN_BOTTOM: - Shell::GetInstance()->delegate()->RecordUserMetricsAction( - UMA_SHELF_ALIGNMENT_SET_BOTTOM); + Shell::GetInstance()->metrics()-> + RecordUserMetricsAction(UMA_SHELF_ALIGNMENT_SET_BOTTOM); Shell::GetInstance()->SetShelfAlignment(SHELF_ALIGNMENT_BOTTOM, root_window_); break; case MENU_ALIGN_RIGHT: - Shell::GetInstance()->delegate()->RecordUserMetricsAction( - UMA_SHELF_ALIGNMENT_SET_RIGHT); + Shell::GetInstance()->metrics()-> + RecordUserMetricsAction(UMA_SHELF_ALIGNMENT_SET_RIGHT); Shell::GetInstance()->SetShelfAlignment(SHELF_ALIGNMENT_RIGHT, root_window_); break; diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc index feab088..38550e0 100644 --- a/ash/shelf/shelf_view.cc +++ b/ash/shelf/shelf_view.cc @@ -9,6 +9,7 @@ #include "ash/ash_constants.h" #include "ash/ash_switches.h" #include "ash/drag_drop/drag_image_view.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/root_window_controller.h" #include "ash/scoped_target_root_window.h" #include "ash/shelf/alternate_app_list_button.h" @@ -26,7 +27,7 @@ #include "ash/shelf/shelf_model.h" #include "ash/shelf/shelf_tooltip_manager.h" #include "ash/shelf/shelf_widget.h" -#include "ash/shell_delegate.h" +#include "ash/shell.h" #include "ash/wm/coordinate_conversion.h" #include "base/auto_reset.h" #include "base/memory/scoped_ptr.h" @@ -1776,12 +1777,12 @@ void ShelfView::ButtonPressed(views::Button* sender, const ui::Event& event) { case TYPE_WINDOWED_APP: case TYPE_PLATFORM_APP: case TYPE_BROWSER_SHORTCUT: - Shell::GetInstance()->delegate()->RecordUserMetricsAction( + Shell::GetInstance()->metrics()->RecordUserMetricsAction( UMA_LAUNCHER_CLICK_ON_APP); break; case TYPE_APP_LIST: - Shell::GetInstance()->delegate()->RecordUserMetricsAction( + Shell::GetInstance()->metrics()->RecordUserMetricsAction( UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON); break; diff --git a/ash/shell.cc b/ash/shell.cc index d7b18ca..3242a16 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -83,6 +83,7 @@ #include "base/command_line.h" #include "base/debug/leak_annotations.h" #include "base/debug/trace_event.h" +#include "content/public/browser/user_metrics.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/user_action_client.h" #include "ui/aura/env.h" @@ -576,7 +577,7 @@ Shell::Shell(ShellDelegate* delegate) gpu::GPU_FEATURE_TYPE_PANEL_FITTING); output_configurator_->Init(!is_panel_fitting_disabled); - periodic_metrics_recorder_.reset(new PeriodicMetricsRecorder); + user_metrics_recorder_.reset(new UserMetricsRecorder); base::MessagePumpX11::Current()->AddDispatcherForRootWindow( output_configurator()); diff --git a/ash/shell.h b/ash/shell.h index 5c49f6b..339c68c 100644 --- a/ash/shell.h +++ b/ash/shell.h @@ -9,7 +9,7 @@ #include <vector> #include "ash/ash_export.h" -#include "ash/periodic_metrics_recorder.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shelf/shelf_types.h" #include "ash/system/user/login_status.h" #include "ash/wm/system_modal_container_event_filter_delegate.h" @@ -514,6 +514,10 @@ class ASH_EXPORT Shell // Returns the launcher delegate, creating if necesary. ShelfDelegate* GetShelfDelegate(); + UserMetricsRecorder* metrics() { + return user_metrics_recorder_.get(); + } + void SetTouchHudProjectionEnabled(bool enabled); bool is_touch_hud_projection_enabled() const { @@ -587,7 +591,7 @@ class ASH_EXPORT Shell std::vector<WindowAndBoundsPair> to_restore_; - scoped_ptr<PeriodicMetricsRecorder> periodic_metrics_recorder_; + scoped_ptr<UserMetricsRecorder> user_metrics_recorder_; scoped_ptr<keyboard::KeyboardController> keyboard_controller_; scoped_ptr<NestedDispatcherController> nested_dispatcher_controller_; scoped_ptr<AcceleratorController> accelerator_controller_; diff --git a/ash/shell/shell_delegate_impl.cc b/ash/shell/shell_delegate_impl.cc index 0d5d2ad..6c95839 100644 --- a/ash/shell/shell_delegate_impl.cc +++ b/ash/shell/shell_delegate_impl.cc @@ -158,9 +158,6 @@ aura::client::UserActionClient* ShellDelegateImpl::CreateUserActionClient() { return NULL; } -void ShellDelegateImpl::RecordUserMetricsAction(UserMetricsAction action) { -} - ui::MenuModel* ShellDelegateImpl::CreateContextMenu(aura::Window* root) { return new ContextMenu(root); } diff --git a/ash/shell/shell_delegate_impl.h b/ash/shell/shell_delegate_impl.h index 9a95ee6..473c42c 100644 --- a/ash/shell/shell_delegate_impl.h +++ b/ash/shell/shell_delegate_impl.h @@ -54,7 +54,6 @@ class ShellDelegateImpl : public ash::ShellDelegate { virtual ash::NewWindowDelegate* CreateNewWindowDelegate() OVERRIDE; virtual ash::MediaDelegate* CreateMediaDelegate() OVERRIDE; virtual aura::client::UserActionClient* CreateUserActionClient() OVERRIDE; - virtual void RecordUserMetricsAction(UserMetricsAction action) OVERRIDE; virtual ui::MenuModel* CreateContextMenu( aura::Window* root_window) OVERRIDE; virtual RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE; diff --git a/ash/shell_delegate.h b/ash/shell_delegate.h index 4a20ddf..5fc991e 100644 --- a/ash/shell_delegate.h +++ b/ash/shell_delegate.h @@ -54,54 +54,6 @@ class SystemTrayDelegate; class UserWallpaperDelegate; struct LauncherItem; -enum UserMetricsAction { - UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6, - UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7, - UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON, - UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON, - UMA_ACCEL_MAXIMIZE_RESTORE_F4, - UMA_ACCEL_PREVWINDOW_F5, - UMA_ACCEL_EXIT_FIRST_Q, - UMA_ACCEL_EXIT_SECOND_Q, - UMA_ACCEL_SHUT_DOWN_POWER_BUTTON, - UMA_CLOSE_THROUGH_CONTEXT_MENU, - UMA_GESTURE_OVERVIEW, - UMA_LAUNCHER_CLICK_ON_APP, - UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON, - UMA_MOUSE_DOWN, - UMA_SHELF_ALIGNMENT_SET_BOTTOM, - UMA_SHELF_ALIGNMENT_SET_LEFT, - UMA_SHELF_ALIGNMENT_SET_RIGHT, - UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK, - UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE, - UMA_TOUCHPAD_GESTURE_OVERVIEW, - UMA_TOUCHSCREEN_TAP_DOWN, - UMA_TRAY_HELP, - UMA_TRAY_LOCK_SCREEN, - UMA_TRAY_SHUT_DOWN, - UMA_WINDOW_APP_CLOSE_BUTTON_CLICK, - UMA_WINDOW_CLOSE_BUTTON_CLICK, - UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN, - UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE, - UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE, - UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE, - UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE, - UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT, - UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT, - UMA_WINDOW_MAXIMIZE_BUTTON_MINIMIZE, - UMA_WINDOW_MAXIMIZE_BUTTON_RESTORE, - UMA_WINDOW_MAXIMIZE_BUTTON_SHOW_BUBBLE, - - // Thumbnail sized overview of windows triggered. This is a subset of - // UMA_WINDOW_SELECTION triggered by lingering during alt+tab cycles or - // pressing the overview key. - UMA_WINDOW_OVERVIEW, - - // Window selection started by beginning an alt+tab cycle or pressing the - // overview key. This does not count each step through an alt+tab cycle. - UMA_WINDOW_SELECTION, -}; - // Delegate of the Shell. class ASH_EXPORT ShellDelegate { public: @@ -173,9 +125,6 @@ class ASH_EXPORT ShellDelegate { // Creates a user action client. Shell takes ownership of the object. virtual aura::client::UserActionClient* CreateUserActionClient() = 0; - // Records that the user performed an action. - virtual void RecordUserMetricsAction(UserMetricsAction action) = 0; - // Creates a menu model of the context for the |root_window|. virtual ui::MenuModel* CreateContextMenu(aura::Window* root_window) = 0; diff --git a/ash/system/bluetooth/tray_bluetooth.cc b/ash/system/bluetooth/tray_bluetooth.cc index e9b042d..9114118 100644 --- a/ash/system/bluetooth/tray_bluetooth.cc +++ b/ash/system/bluetooth/tray_bluetooth.cc @@ -357,6 +357,10 @@ class BluetoothDetailedView : public TrayDetailsView, } else if (sender == manage_devices_) { delegate->ManageBluetoothDevices(); } else if (sender == enable_bluetooth_) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + delegate->GetBluetoothEnabled() ? + ash::UMA_STATUS_AREA_BLUETOOTH_DISABLED : + ash::UMA_STATUS_AREA_BLUETOOTH_ENABLED); delegate->ToggleBluetooth(); } else { if (!delegate->GetBluetoothEnabled()) @@ -427,6 +431,8 @@ views::View* TrayBluetooth::CreateDefaultView(user::LoginStatus status) { views::View* TrayBluetooth::CreateDetailedView(user::LoginStatus status) { if (!Shell::GetInstance()->system_tray_delegate()->GetBluetoothAvailable()) return NULL; + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_DETAILED_BLUETOOTH_VIEW); CHECK(detailed_ == NULL); detailed_ = new tray::BluetoothDetailedView(this, status); return detailed_; diff --git a/ash/system/chromeos/audio/tray_audio.cc b/ash/system/chromeos/audio/tray_audio.cc index 5922f00..3d77ed1 100644 --- a/ash/system/chromeos/audio/tray_audio.cc +++ b/ash/system/chromeos/audio/tray_audio.cc @@ -8,6 +8,7 @@ #include "ash/ash_constants.h" #include "ash/ash_switches.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" #include "ash/system/tray/actionable_view.h" #include "ash/system/tray/fixed_sized_scroll_view.h" @@ -380,6 +381,10 @@ class VolumeView : public ActionableView, // 1%, which is beyond cras audio api's granularity for output volume. if (std::abs(volume - old_volume) < 1) return; + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + is_default_view_ ? + ash::UMA_STATUS_AREA_CHANGED_VOLUME_MENU : + ash::UMA_STATUS_AREA_CHANGED_VOLUME_POPUP); if (volume > old_volume) HandleVolumeUp(volume); else @@ -388,7 +393,7 @@ class VolumeView : public ActionableView, icon_->Update(); } - // Overriden from ActinableView. + // Overriden from ActionableView. virtual bool PerformAction(const ui::Event& event) OVERRIDE { if (!more_->visible()) return false; @@ -567,6 +572,8 @@ views::View* TrayAudio::CreateDetailedView(user::LoginStatus status) { volume_view_ = new tray::VolumeView(this, false); return volume_view_; } else { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_DETAILED_AUDIO_VIEW); audio_detail_ = new tray::AudioDetailedView(this, status); return audio_detail_; } diff --git a/ash/system/chromeos/brightness/tray_brightness.cc b/ash/system/chromeos/brightness/tray_brightness.cc index cfe3ca9..98cace08 100644 --- a/ash/system/chromeos/brightness/tray_brightness.cc +++ b/ash/system/chromeos/brightness/tray_brightness.cc @@ -6,6 +6,7 @@ #include "ash/accelerators/accelerator_controller.h" #include "ash/ash_constants.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" #include "ash/system/brightness_control_delegate.h" #include "ash/system/tray/fixed_sized_image_view.h" @@ -173,6 +174,8 @@ views::View* TrayBrightness::CreateDefaultView(user::LoginStatus status) { views::View* TrayBrightness::CreateDetailedView(user::LoginStatus status) { CHECK(brightness_view_ == NULL); + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_DETAILED_BRIGHTNESS_VIEW); brightness_view_ = new tray::BrightnessView(current_percent_); is_default_view_ = false; return brightness_view_; @@ -203,6 +206,8 @@ bool TrayBrightness::ShouldShowLauncher() const { } void TrayBrightness::BrightnessChanged(int level, bool user_initiated) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_BRIGHTNESS_CHANGED); double percent = static_cast<double>(level); HandleBrightnessChanged(percent, user_initiated); } diff --git a/ash/system/chromeos/keyboard_brightness_controller.cc b/ash/system/chromeos/keyboard_brightness_controller.cc index bad8d09..15f91ed 100644 --- a/ash/system/chromeos/keyboard_brightness_controller.cc +++ b/ash/system/chromeos/keyboard_brightness_controller.cc @@ -4,8 +4,8 @@ #include "ash/system/chromeos/keyboard_brightness_controller.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" -#include "ash/shell_delegate.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power_manager_client.h" #include "content/public/browser/user_metrics.h" @@ -16,7 +16,7 @@ namespace ash { bool KeyboardBrightnessController::HandleKeyboardBrightnessDown( const ui::Accelerator& accelerator) { if (accelerator.key_code() == ui::VKEY_BRIGHTNESS_DOWN) { - Shell::GetInstance()->delegate()->RecordUserMetricsAction( + Shell::GetInstance()->metrics()->RecordUserMetricsAction( UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6); } @@ -28,7 +28,7 @@ bool KeyboardBrightnessController::HandleKeyboardBrightnessDown( bool KeyboardBrightnessController::HandleKeyboardBrightnessUp( const ui::Accelerator& accelerator) { if (accelerator.key_code() == ui::VKEY_BRIGHTNESS_UP) { - Shell::GetInstance()->delegate()->RecordUserMetricsAction( + Shell::GetInstance()->metrics()->RecordUserMetricsAction( UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7); } diff --git a/ash/system/chromeos/network/network_state_list_detailed_view.cc b/ash/system/chromeos/network/network_state_list_detailed_view.cc index ff45d77..ed2d038 100644 --- a/ash/system/chromeos/network/network_state_list_detailed_view.cc +++ b/ash/system/chromeos/network/network_state_list_detailed_view.cc @@ -5,8 +5,10 @@ #include "ash/system/chromeos/network/network_state_list_detailed_view.h" #include "ash/ash_switches.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/root_window_controller.h" #include "ash/shell.h" +#include "ash/shell_delegate.h" #include "ash/shell_window_ids.h" #include "ash/system/chromeos/network/network_connect.h" #include "ash/system/chromeos/network/network_icon.h" @@ -273,6 +275,10 @@ void NetworkStateListDetailedView::ButtonPressed(views::Button* sender, } else if (sender == button_mobile_) { ToggleMobile(); } else if (sender == settings_) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + list_type_ == LIST_TYPE_VPN ? + ash::UMA_STATUS_AREA_VPN_SETTINGS_CLICKED : + ash::UMA_STATUS_AREA_NETWORK_SETTINGS_CLICKED); delegate->ShowNetworkSettings(""); } else if (sender == proxy_settings_) { delegate->ChangeProxySettings(); @@ -286,8 +292,12 @@ void NetworkStateListDetailedView::ButtonPressed(views::Button* sender, FROM_HERE, base::Bind(&NetworkStateListDetailedView::Init, AsWeakPtr())); } else if (sender == other_wifi_) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED); delegate->ShowOtherNetworkDialog(shill::kTypeWifi); } else if (sender == other_vpn_) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_VPN_JOIN_OTHER_CLICKED); delegate->ShowOtherNetworkDialog(shill::kTypeVPN); } else { NOTREACHED(); @@ -323,9 +333,17 @@ void NetworkStateListDetailedView::OnViewClicked(views::View* sender) { const NetworkState* network = NetworkHandler::Get()->network_state_handler()-> GetNetworkState(service_path); if (!network || network->IsConnectedState() || network->IsConnectingState()) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + list_type_ == LIST_TYPE_VPN ? + ash::UMA_STATUS_AREA_SHOW_NETWORK_CONNECTION_DETAILS : + ash::UMA_STATUS_AREA_SHOW_VPN_CONNECTION_DETAILS); Shell::GetInstance()->system_tray_delegate()->ShowNetworkSettings( service_path); } else { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + list_type_ == LIST_TYPE_VPN ? + ash::UMA_STATUS_AREA_CONNECT_TO_VPN : + ash::UMA_STATUS_AREA_CONNECT_TO_CONFIGURED_NETWORK); ash::network_connect::ConnectToNetwork(service_path, NULL); } } diff --git a/ash/system/chromeos/network/tray_network.cc b/ash/system/chromeos/network/tray_network.cc index 130ff16..4d2c82a 100644 --- a/ash/system/chromeos/network/tray_network.cc +++ b/ash/system/chromeos/network/tray_network.cc @@ -5,6 +5,7 @@ #include "ash/system/chromeos/network/tray_network.h" #include "ash/ash_switches.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" #include "ash/system/chromeos/network/network_icon_animation.h" #include "ash/system/chromeos/network/network_state_list_detailed_view.h" @@ -289,6 +290,8 @@ views::View* TrayNetwork::CreateDefaultView(user::LoginStatus status) { views::View* TrayNetwork::CreateDetailedView(user::LoginStatus status) { CHECK(detailed_ == NULL); + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_DETAILED_NETWORK_VIEW); if (!chromeos::NetworkHandler::IsInitialized()) return NULL; if (request_wifi_view_) { @@ -333,6 +336,10 @@ void TrayNetwork::RequestToggleWifi() { } NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); bool enabled = handler->IsTechnologyEnabled(NetworkTypePattern::WiFi()); + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + enabled ? + ash::UMA_STATUS_AREA_DISABLE_WIFI : + ash::UMA_STATUS_AREA_ENABLE_WIFI); handler->SetTechnologyEnabled(NetworkTypePattern::WiFi(), !enabled, chromeos::network_handler::ErrorCallback()); diff --git a/ash/system/chromeos/network/tray_vpn.cc b/ash/system/chromeos/network/tray_vpn.cc index c9f9e74..d150626 100644 --- a/ash/system/chromeos/network/tray_vpn.cc +++ b/ash/system/chromeos/network/tray_vpn.cc @@ -4,6 +4,7 @@ #include "ash/system/chromeos/network/tray_vpn.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" #include "ash/system/chromeos/network/network_icon_animation.h" #include "ash/system/chromeos/network/network_state_list_detailed_view.h" @@ -134,6 +135,8 @@ views::View* TrayVPN::CreateDetailedView(user::LoginStatus status) { if (!chromeos::NetworkHandler::IsInitialized()) return NULL; + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_DETAILED_VPN_VIEW); detailed_ = new tray::NetworkStateListDetailedView( this, tray::NetworkStateListDetailedView::LIST_TYPE_VPN, status); detailed_->Init(); diff --git a/ash/system/date/tray_date.cc b/ash/system/date/tray_date.cc index c05c475..c2a4b92 100644 --- a/ash/system/date/tray_date.cc +++ b/ash/system/date/tray_date.cc @@ -4,6 +4,7 @@ #include "ash/system/date/tray_date.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/session_state_delegate.h" #include "ash/shell.h" #include "ash/shell_delegate.h" @@ -129,16 +130,15 @@ class DateDefaultView : public views::View, virtual void ButtonPressed(views::Button* sender, const ui::Event& event) OVERRIDE { ash::Shell* shell = ash::Shell::GetInstance(); - ash::ShellDelegate* shell_delegate = shell->delegate(); ash::SystemTrayDelegate* tray_delegate = shell->system_tray_delegate(); if (sender == help_) { - shell_delegate->RecordUserMetricsAction(ash::UMA_TRAY_HELP); + shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_HELP); tray_delegate->ShowHelp(); } else if (sender == shutdown_) { - shell_delegate->RecordUserMetricsAction(ash::UMA_TRAY_SHUT_DOWN); + shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_SHUT_DOWN); tray_delegate->ShutDown(); } else if (sender == lock_) { - shell_delegate->RecordUserMetricsAction(ash::UMA_TRAY_LOCK_SCREEN); + shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_LOCK_SCREEN); tray_delegate->RequestLockScreen(); } else { NOTREACHED(); diff --git a/ash/system/drive/tray_drive.cc b/ash/system/drive/tray_drive.cc index 4305d5a..b246d52 100644 --- a/ash/system/drive/tray_drive.cc +++ b/ash/system/drive/tray_drive.cc @@ -6,6 +6,7 @@ #include <vector> +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" #include "ash/system/tray/fixed_sized_scroll_view.h" #include "ash/system/tray/hover_highlight_view.h" @@ -253,6 +254,8 @@ class DriveDetailedView : public TrayDetailsView, virtual void ButtonPressed(views::Button* sender, const ui::Event& event) OVERRIDE { DCHECK(sender == cancel_button_); + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_DRIVE_CANCEL_OPERATION); container_->OnCancelOperation(operation_id_); } @@ -425,6 +428,8 @@ views::View* TrayDrive::CreateDetailedView(user::LoginStatus status) { if (list->empty() && !tray_view()->visible()) return NULL; + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_DETAILED_DRIVE_VIEW); detailed_ = new tray::DriveDetailedView(this, list.get()); return detailed_; } diff --git a/ash/system/ime/tray_ime.cc b/ash/system/ime/tray_ime.cc index d58b1ef..c558e27 100644 --- a/ash/system/ime/tray_ime.cc +++ b/ash/system/ime/tray_ime.cc @@ -6,6 +6,7 @@ #include <vector> +#include "ash/metrics/user_metrics_recorder.h" #include "ash/root_window_controller.h" #include "ash/shelf/shelf_widget.h" #include "ash/shell.h" @@ -149,11 +150,15 @@ class IMEDetailedView : public TrayDetailsView, if (sender == footer()->content()) { TransitionToDefaultView(); } else if (sender == settings_) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_IME_SHOW_DETAILED); delegate->ShowIMESettings(); } else { std::map<views::View*, std::string>::const_iterator ime_find; ime_find = ime_map_.find(sender); if (ime_find != ime_map_.end()) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_IME_SWITCH_MODE); std::string ime_id = ime_find->second; delegate->SwitchIME(ime_id); GetWidget()->Close(); diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc index b5d8cc3..87cc325 100644 --- a/ash/system/tray/system_tray.cc +++ b/ash/system/tray/system_tray.cc @@ -5,10 +5,10 @@ #include "ash/system/tray/system_tray.h" #include "ash/ash_switches.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shelf/shelf_layout_manager.h" #include "ash/shell.h" #include "ash/shell/panel_window.h" -#include "ash/shell_delegate.h" #include "ash/shell_window_ids.h" #include "ash/system/bluetooth/tray_bluetooth.h" #include "ash/system/date/tray_date.h" @@ -436,6 +436,10 @@ int SystemTray::GetTrayXOffset(SystemTrayItem* item) const { void SystemTray::ShowDefaultViewWithOffset(BubbleCreationType creation_type, int arrow_offset, bool persistent) { + if (creation_type != BUBBLE_USE_EXISTING) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_MENU_OPENED); + } ShowItems(items_.get(), false, true, creation_type, arrow_offset, persistent); } diff --git a/ash/system/tray_accessibility.cc b/ash/system/tray_accessibility.cc index f064a5f..fc77b3e 100644 --- a/ash/system/tray_accessibility.cc +++ b/ash/system/tray_accessibility.cc @@ -5,6 +5,7 @@ #include "ash/system/tray_accessibility.h" #include "ash/accessibility_delegate.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" #include "ash/system/tray/hover_highlight_view.h" #include "ash/system/tray/system_tray.h" @@ -231,14 +232,34 @@ void AccessibilityDetailedView::OnViewClicked(views::View* sender) { if (sender == footer()->content()) { TransitionToDefaultView(); } else if (sender == spoken_feedback_view_) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + delegate->IsSpokenFeedbackEnabled() ? + ash::UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK : + ash::UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK); delegate->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_NONE); } else if (sender == high_contrast_view_) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + delegate->IsHighContrastEnabled() ? + ash::UMA_STATUS_AREA_DISABLE_HIGH_CONTRAST : + ash::UMA_STATUS_AREA_ENABLE_HIGH_CONTRAST); delegate->ToggleHighContrast(); } else if (sender == screen_magnifier_view_) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + delegate->IsMagnifierEnabled() ? + ash::UMA_STATUS_AREA_DISABLE_MAGNIFIER : + ash::UMA_STATUS_AREA_ENABLE_MAGNIFIER); delegate->SetMagnifierEnabled(!delegate->IsMagnifierEnabled()); } else if (large_cursor_view_ && sender == large_cursor_view_) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + delegate->IsLargeCursorEnabled() ? + ash::UMA_STATUS_AREA_DISABLE_LARGE_CURSOR : + ash::UMA_STATUS_AREA_ENABLE_LARGE_CURSOR); delegate->SetLargeCursorEnabled(!delegate->IsLargeCursorEnabled()); } else if (autoclick_view_ && sender == autoclick_view_) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + delegate->IsAutoclickEnabled() ? + ash::UMA_STATUS_AREA_DISABLE_AUTO_CLICK : + ash::UMA_STATUS_AREA_ENABLE_AUTO_CLICK); delegate->SetAutoclickEnabled(!delegate->IsAutoclickEnabled()); } } @@ -326,6 +347,8 @@ views::View* TrayAccessibility::CreateDetailedView(user::LoginStatus status) { request_popup_view_ = false; return detailed_popup_; } else { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_DETAILED_ACCESSABILITY); detailed_menu_ = CreateDetailedMenu(); return detailed_menu_; } diff --git a/ash/system/tray_caps_lock.cc b/ash/system/tray_caps_lock.cc index 89f2747..ce7b976 100644 --- a/ash/system/tray_caps_lock.cc +++ b/ash/system/tray_caps_lock.cc @@ -5,6 +5,7 @@ #include "ash/system/tray_caps_lock.h" #include "ash/caps_lock_delegate.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" #include "ash/system/tray/actionable_view.h" #include "ash/system/tray/fixed_sized_image_view.h" @@ -94,6 +95,10 @@ class CapsLockDefaultView : public ActionableView { // Overridden from ActionableView: virtual bool PerformAction(const ui::Event& event) OVERRIDE { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + Shell::GetInstance()->caps_lock_delegate()->IsCapsLockEnabled() ? + ash::UMA_STATUS_AREA_CAPS_LOCK_DISABLED_BY_CLICK : + ash::UMA_STATUS_AREA_CAPS_LOCK_ENABLED_BY_CLICK); Shell::GetInstance()->caps_lock_delegate()->ToggleCapsLock(); return true; } @@ -154,6 +159,8 @@ views::View* TrayCapsLock::CreateDetailedView(user::LoginStatus status) { label->SetMultiLine(true); label->SetHorizontalAlignment(gfx::ALIGN_LEFT); detailed_->AddChildView(label); + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_CAPS_LOCK_DETAILED); return detailed_; } @@ -179,6 +186,8 @@ void TrayCapsLock::OnCapsLockChanged(bool enabled, } else { if (enabled) { if (!message_shown_) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_CAPS_LOCK_POPUP); PopupDetailedView(kTrayPopupAutoCloseDelayForTextInSeconds, false); message_shown_ = true; } diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc index e0d9587..ff14fe1 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/metrics/user_metrics_recorder.h" #include "ash/multi_profile_uma.h" #include "ash/popup_message.h" #include "ash/root_window_controller.h" @@ -799,6 +800,8 @@ void UserView::Layout() { void UserView::ButtonPressed(views::Button* sender, const ui::Event& event) { if (sender == logout_button_) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_SIGN_OUT); Shell::GetInstance()->system_tray_delegate()->SignOut(); } else if (sender == user_card_view_ && SupportsMultiProfile()) { if (!multiprofile_index_) { diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc index bb10b04..e0d6ac8 100644 --- a/ash/test/test_shell_delegate.cc +++ b/ash/test/test_shell_delegate.cc @@ -139,9 +139,6 @@ aura::client::UserActionClient* TestShellDelegate::CreateUserActionClient() { return NULL; } -void TestShellDelegate::RecordUserMetricsAction(UserMetricsAction action) { -} - ui::MenuModel* TestShellDelegate::CreateContextMenu(aura::Window* root) { return NULL; } diff --git a/ash/test/test_shell_delegate.h b/ash/test/test_shell_delegate.h index 503b114..489b976 100644 --- a/ash/test/test_shell_delegate.h +++ b/ash/test/test_shell_delegate.h @@ -50,7 +50,6 @@ class TestShellDelegate : public ShellDelegate { virtual NewWindowDelegate* CreateNewWindowDelegate() OVERRIDE; virtual MediaDelegate* CreateMediaDelegate() OVERRIDE; virtual aura::client::UserActionClient* CreateUserActionClient() OVERRIDE; - virtual void RecordUserMetricsAction(UserMetricsAction action) OVERRIDE; virtual ui::MenuModel* CreateContextMenu(aura::Window* root) OVERRIDE; virtual RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE; virtual base::string16 GetProductName() const OVERRIDE; diff --git a/ash/touch/touch_uma.cc b/ash/touch/touch_uma.cc index 82fac27..6f970ac 100644 --- a/ash/touch/touch_uma.cc +++ b/ash/touch/touch_uma.cc @@ -4,7 +4,8 @@ #include "ash/touch/touch_uma.h" -#include "ash/shell_delegate.h" +#include "ash/metrics/user_metrics_recorder.h" +#include "ash/shell.h" #include "base/metrics/histogram.h" #include "base/strings/stringprintf.h" #include "ui/aura/env.h" @@ -270,7 +271,7 @@ void TouchUMA::RecordTouchEvent(aura::Window* target, 0, kBucketCountForLocation, kBucketCountForLocation + 1); if (event.type() == ui::ET_TOUCH_PRESSED) { - Shell::GetInstance()->delegate()->RecordUserMetricsAction( + Shell::GetInstance()->metrics()->RecordUserMetricsAction( UMA_TOUCHSCREEN_TAP_DOWN); details->last_start_time_[event.touch_id()] = event.time_stamp(); diff --git a/ash/wm/caption_buttons/alternate_frame_size_button.cc b/ash/wm/caption_buttons/alternate_frame_size_button.cc index 3c5669f..24f9a0a 100644 --- a/ash/wm/caption_buttons/alternate_frame_size_button.cc +++ b/ash/wm/caption_buttons/alternate_frame_size_button.cc @@ -4,8 +4,8 @@ #include "ash/wm/caption_buttons/alternate_frame_size_button.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" -#include "ash/shell_delegate.h" #include "ash/touch/touch_uma.h" #include "ash/wm/window_state.h" #include "ash/wm/workspace/snap_sizer.h" @@ -189,7 +189,7 @@ bool AlternateFrameSizeButton::CommitSnap(const ui::LocatedEvent& event) { SnapSizer::SnapWindow(ash::wm::GetWindowState(frame_->GetNativeWindow()), snap_type_ == SNAP_LEFT ? SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE); - ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction( + ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction( snap_type_ == SNAP_LEFT ? ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT : ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT); diff --git a/ash/wm/caption_buttons/frame_caption_button_container_view.cc b/ash/wm/caption_buttons/frame_caption_button_container_view.cc index 2e4d323..1ac3a26 100644 --- a/ash/wm/caption_buttons/frame_caption_button_container_view.cc +++ b/ash/wm/caption_buttons/frame_caption_button_container_view.cc @@ -5,8 +5,8 @@ #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" #include "ash/ash_switches.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" -#include "ash/shell_delegate.h" #include "ash/wm/caption_buttons/alternate_frame_size_button.h" #include "ash/wm/caption_buttons/frame_caption_button.h" #include "ash/wm/caption_buttons/frame_maximize_button.h" @@ -209,7 +209,7 @@ void FrameCaptionButtonContainerView::ButtonPressed(views::Button* sender, } else { return; } - ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction(action); + ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction(action); } bool FrameCaptionButtonContainerView::IsMinimizeButtonVisible() const { diff --git a/ash/wm/caption_buttons/frame_maximize_button.cc b/ash/wm/caption_buttons/frame_maximize_button.cc index 5a610e5..d2f24f0 100644 --- a/ash/wm/caption_buttons/frame_maximize_button.cc +++ b/ash/wm/caption_buttons/frame_maximize_button.cc @@ -4,10 +4,10 @@ #include "ash/wm/caption_buttons/frame_maximize_button.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/screen_ash.h" #include "ash/shelf/shelf_widget.h" #include "ash/shell.h" -#include "ash/shell_delegate.h" #include "ash/touch/touch_uma.h" #include "ash/wm/caption_buttons/frame_maximize_button_observer.h" #include "ash/wm/caption_buttons/maximize_bubble_controller.h" @@ -530,7 +530,7 @@ void FrameMaximizeButton::Snap(SnapSizer* snap_sizer) { case SNAP_LEFT: case SNAP_RIGHT: { snap_sizer->SnapWindowToTargetBounds(); - shell->delegate()->RecordUserMetricsAction( + shell->metrics()->RecordUserMetricsAction( snap_type_ == SNAP_LEFT ? UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT : UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT); @@ -538,17 +538,17 @@ void FrameMaximizeButton::Snap(SnapSizer* snap_sizer) { } case SNAP_MAXIMIZE: frame_->Maximize(); - shell->delegate()->RecordUserMetricsAction( + shell->metrics()->RecordUserMetricsAction( UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE); break; case SNAP_MINIMIZE: frame_->Minimize(); - shell->delegate()->RecordUserMetricsAction( + shell->metrics()->RecordUserMetricsAction( UMA_WINDOW_MAXIMIZE_BUTTON_MINIMIZE); break; case SNAP_RESTORE: frame_->Restore(); - shell->delegate()->RecordUserMetricsAction( + shell->metrics()->RecordUserMetricsAction( UMA_WINDOW_MAXIMIZE_BUTTON_RESTORE); break; case SNAP_NONE: diff --git a/ash/wm/caption_buttons/maximize_bubble_controller_bubble.cc b/ash/wm/caption_buttons/maximize_bubble_controller_bubble.cc index d6b3329..d109a41 100644 --- a/ash/wm/caption_buttons/maximize_bubble_controller_bubble.cc +++ b/ash/wm/caption_buttons/maximize_bubble_controller_bubble.cc @@ -4,7 +4,8 @@ #include "ash/wm/caption_buttons/maximize_bubble_controller_bubble.h" -#include "ash/shell_delegate.h" +#include "ash/metrics/user_metrics_recorder.h" +#include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/wm/caption_buttons/bubble_contents_button_row.h" #include "ash/wm/caption_buttons/frame_maximize_button.h" @@ -358,7 +359,7 @@ MaximizeBubbleControllerBubble::MaximizeBubbleControllerBubble( else StartFade(true); - ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction( + ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction( ash::UMA_WINDOW_MAXIMIZE_BUTTON_SHOW_BUBBLE); mouse_watcher_.reset(new views::MouseWatcher( diff --git a/ash/wm/gestures/overview_gesture_handler.cc b/ash/wm/gestures/overview_gesture_handler.cc index c47e80d..ebff8e6 100644 --- a/ash/wm/gestures/overview_gesture_handler.cc +++ b/ash/wm/gestures/overview_gesture_handler.cc @@ -4,8 +4,8 @@ #include "ash/wm/gestures/overview_gesture_handler.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" -#include "ash/shell_delegate.h" #include "ash/wm/coordinate_conversion.h" #include "ash/wm/overview/window_selector_controller.h" #include "ui/aura/window.h" @@ -74,7 +74,7 @@ bool OverviewGestureHandler::ProcessScrollEvent(const ui::ScrollEvent& event) { // Reset scroll amount on toggling. scroll_x_ = scroll_y_ = 0; - shell->delegate()->RecordUserMetricsAction(UMA_TOUCHPAD_GESTURE_OVERVIEW); + shell->metrics()->RecordUserMetricsAction(UMA_TOUCHPAD_GESTURE_OVERVIEW); shell->window_selector_controller()->ToggleOverview(); return true; } @@ -101,7 +101,7 @@ bool OverviewGestureHandler::ProcessGestureEvent( } Shell* shell = Shell::GetInstance(); - shell->delegate()->RecordUserMetricsAction(UMA_GESTURE_OVERVIEW); + shell->metrics()->RecordUserMetricsAction(UMA_GESTURE_OVERVIEW); shell->window_selector_controller()->ToggleOverview(); return true; } diff --git a/ash/wm/lock_state_controller.cc b/ash/wm/lock_state_controller.cc index 6c720ce..cffbb6b 100644 --- a/ash/wm/lock_state_controller.cc +++ b/ash/wm/lock_state_controller.cc @@ -9,6 +9,7 @@ #include "ash/accessibility_delegate.h" #include "ash/ash_switches.h" #include "ash/cancel_mode.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" #include "ash/shell_delegate.h" #include "ash/shell_window_ids.h" @@ -402,7 +403,7 @@ void LockStateController::OnRealShutdownTimeout() { } } #endif - Shell::GetInstance()->delegate()->RecordUserMetricsAction( + Shell::GetInstance()->metrics()->RecordUserMetricsAction( UMA_ACCEL_SHUT_DOWN_POWER_BUTTON); delegate_->RequestShutdown(); } @@ -582,7 +583,7 @@ void LockStateController::PreLockAnimationFinished(bool request_lock) { can_cancel_lock_animation_ = false; if (request_lock) { - Shell::GetInstance()->delegate()->RecordUserMetricsAction( + Shell::GetInstance()->metrics()->RecordUserMetricsAction( shutdown_after_lock_ ? UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON : UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON); diff --git a/ash/wm/overview/window_overview.cc b/ash/wm/overview/window_overview.cc index 4542f18..a7df1f7 100644 --- a/ash/wm/overview/window_overview.cc +++ b/ash/wm/overview/window_overview.cc @@ -6,9 +6,9 @@ #include <algorithm> +#include "ash/metrics/user_metrics_recorder.h" #include "ash/screen_ash.h" #include "ash/shell.h" -#include "ash/shell_delegate.h" #include "ash/shell_window_ids.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/overview/scoped_transform_overview_window.h" @@ -144,7 +144,7 @@ WindowOverview::WindowOverview(WindowSelector* window_selector, } ash::Shell::GetInstance()->PrependPreTargetHandler(this); Shell* shell = Shell::GetInstance(); - shell->delegate()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW); + shell->metrics()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW); HideAndTrackNonOverviewWindows(); } diff --git a/ash/wm/overview/window_selector_controller.cc b/ash/wm/overview/window_selector_controller.cc index fcbb9ae..e80490e 100644 --- a/ash/wm/overview/window_selector_controller.cc +++ b/ash/wm/overview/window_selector_controller.cc @@ -4,10 +4,10 @@ #include "ash/wm/overview/window_selector_controller.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/root_window_controller.h" #include "ash/session_state_delegate.h" #include "ash/shell.h" -#include "ash/shell_delegate.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/overview/window_selector.h" #include "ash/wm/window_state.h" @@ -86,7 +86,7 @@ void WindowSelectorController::OnSelectionCanceled() { void WindowSelectorController::OnSelectionStarted() { Shell::GetInstance()->mru_window_tracker()->SetIgnoreActivations(true); Shell* shell = Shell::GetInstance(); - shell->delegate()->RecordUserMetricsAction(UMA_WINDOW_SELECTION); + shell->metrics()->RecordUserMetricsAction(UMA_WINDOW_SELECTION); if (!last_selection_time_.is_null()) { UMA_HISTOGRAM_LONG_TIMES( "Ash.WindowSelector.TimeBetweenUse", diff --git a/ash/wm/system_gesture_event_filter.cc b/ash/wm/system_gesture_event_filter.cc index e9a8393..eb206b9 100644 --- a/ash/wm/system_gesture_event_filter.cc +++ b/ash/wm/system_gesture_event_filter.cc @@ -7,9 +7,9 @@ #include "ash/accelerators/accelerator_controller.h" #include "ash/accelerators/accelerator_table.h" #include "ash/ash_switches.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/root_window_controller.h" #include "ash/shell.h" -#include "ash/shell_delegate.h" #include "ash/shell_window_ids.h" #include "ash/wm/gestures/long_press_affordance_handler.h" #include "ash/wm/gestures/overview_gesture_handler.h" @@ -58,8 +58,7 @@ void SystemGestureEventFilter::OnMouseEvent(ui::MouseEvent* event) { if (event->type() == ui::ET_MOUSE_PRESSED && event->native_event() && ui::TouchFactory::GetInstance()->IsTouchDevicePresent() && Shell::GetInstance()->delegate()) { - Shell::GetInstance()->delegate()->RecordUserMetricsAction( - UMA_MOUSE_DOWN); + Shell::GetInstance()->metrics()->RecordUserMetricsAction(UMA_MOUSE_DOWN); } #endif } diff --git a/ash/wm/workspace/workspace_event_handler.cc b/ash/wm/workspace/workspace_event_handler.cc index 2723bea..ed972ad 100644 --- a/ash/wm/workspace/workspace_event_handler.cc +++ b/ash/wm/workspace/workspace_event_handler.cc @@ -4,9 +4,9 @@ #include "ash/wm/workspace/workspace_event_handler.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/screen_ash.h" #include "ash/shell.h" -#include "ash/shell_delegate.h" #include "ash/touch/touch_uma.h" #include "ash/wm/coordinate_conversion.h" #include "ash/wm/window_state.h" @@ -93,7 +93,7 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) { HTCAPTION) { bool destroyed = false; destroyed_ = &destroyed; - ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction( + ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction( ash::UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK); ToggleMaximizedState(target_state); if (destroyed) @@ -116,7 +116,7 @@ void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event) { target->delegate()->GetNonClientComponent(event->location()) == HTCAPTION) { if (event->details().tap_count() == 2) { - ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction( + ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction( ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE); // Note: TouchUMA::GESTURE_FRAMEVIEW_TAP is counted twice each time // TouchUMA::GESTURE_MAXIMIZE_DOUBLETAP is counted once. diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager.cc b/chrome/browser/chromeos/accessibility/accessibility_manager.cc index b981919..4546fba 100644 --- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc +++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc @@ -6,6 +6,7 @@ #include "ash/autoclick/autoclick_controller.h" #include "ash/high_contrast/high_contrast_controller.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" #include "ash/system/tray/system_tray_notifier.h" #include "ash/wm/event_rewriter_event_filter.h" @@ -415,6 +416,10 @@ void AccessibilityManager::EnableSpokenFeedback( if (!profile_) return; + ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction( + enabled ? ash::UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK + : ash::UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK); + spoken_feedback_notification_ = notify; PrefService* pref_service = profile_->GetPrefs(); diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc index 59c7ca4..094ebe1f 100644 --- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc +++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc @@ -11,6 +11,7 @@ #include "ash/ash_switches.h" #include "ash/desktop_background/desktop_background_controller.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/session_state_delegate.h" #include "ash/session_state_observer.h" #include "ash/shell.h" @@ -689,11 +690,15 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, if (device->IsPaired() && !device->IsConnectable()) return; if (device->IsPaired() || !device->IsPairable()) { + ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_BLUETOOTH_CONNECT_KNOWN_DEVICE); device->Connect( NULL, base::Bind(&base::DoNothing), base::Bind(&BluetoothDeviceConnectError)); } else { // Show paring dialog for the unpaired device. + ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction( + ash::UMA_STATUS_AREA_BLUETOOTH_CONNECT_UNKNOWN_DEVICE); BluetoothPairingDialog* dialog = new BluetoothPairingDialog(GetNativeWindow(), device); // The dialog deletes itself on close. diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc index 452e390..4ef64504 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc @@ -23,14 +23,12 @@ #include "chrome/browser/ui/ash/user_action_handler.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/common/chrome_switches.h" -#include "content/public/browser/user_metrics.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" -#include "chrome/browser/chromeos/login/default_pinned_apps_field_trial.h" #include "chrome/browser/chromeos/login/user_manager.h" #endif @@ -130,147 +128,6 @@ aura::client::UserActionClient* ChromeShellDelegate::CreateUserActionClient() { return new UserActionHandler; } -void ChromeShellDelegate::RecordUserMetricsAction( - ash::UserMetricsAction action) { - switch (action) { - case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6: - content::RecordAction( - content::UserMetricsAction("Accel_KeyboardBrightnessDown_F6")); - break; - case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7: - content::RecordAction( - content::UserMetricsAction("Accel_KeyboardBrightnessUp_F7")); - break; - case ash::UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON: - content::RecordAction( - content::UserMetricsAction("Accel_LockScreen_LockButton")); - break; - case ash::UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON: - content::RecordAction( - content::UserMetricsAction("Accel_LockScreen_PowerButton")); - break; - case ash::UMA_ACCEL_MAXIMIZE_RESTORE_F4: - content::RecordAction( - content::UserMetricsAction("Accel_Maximize_Restore_F4")); - break; - case ash::UMA_ACCEL_PREVWINDOW_F5: - content::RecordAction(content::UserMetricsAction("Accel_PrevWindow_F5")); - break; - case ash::UMA_ACCEL_EXIT_FIRST_Q: - content::RecordAction(content::UserMetricsAction("Accel_Exit_First_Q")); - break; - case ash::UMA_ACCEL_EXIT_SECOND_Q: - content::RecordAction(content::UserMetricsAction("Accel_Exit_Second_Q")); - break; - case ash::UMA_ACCEL_SHUT_DOWN_POWER_BUTTON: - content::RecordAction( - content::UserMetricsAction("Accel_ShutDown_PowerButton")); - break; - case ash::UMA_CLOSE_THROUGH_CONTEXT_MENU: - content::RecordAction(content::UserMetricsAction("CloseFromContextMenu")); - break; - case ash::UMA_GESTURE_OVERVIEW: - content::RecordAction(content::UserMetricsAction("Gesture_Overview")); - break; - case ash::UMA_LAUNCHER_CLICK_ON_APP: - content::RecordAction(content::UserMetricsAction("Launcher_ClickOnApp")); - break; - case ash::UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON: - content::RecordAction( - content::UserMetricsAction("Launcher_ClickOnApplistButton")); -#if defined(OS_CHROMEOS) - chromeos::default_pinned_apps_field_trial::RecordShelfClick( - chromeos::default_pinned_apps_field_trial::APP_LAUNCHER); -#endif - break; - case ash::UMA_MOUSE_DOWN: - content::RecordAction(content::UserMetricsAction("Mouse_Down")); - break; - case ash::UMA_SHELF_ALIGNMENT_SET_BOTTOM: - content::RecordAction( - content::UserMetricsAction("Shelf_AlignmentSetBottom")); - break; - case ash::UMA_SHELF_ALIGNMENT_SET_LEFT: - content::RecordAction( - content::UserMetricsAction("Shelf_AlignmentSetLeft")); - break; - case ash::UMA_SHELF_ALIGNMENT_SET_RIGHT: - content::RecordAction( - content::UserMetricsAction("Shelf_AlignmentSetRight")); - break; - case ash::UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK: - content::RecordAction( - content::UserMetricsAction("Caption_ClickTogglesMaximize")); - break; - case ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE: - content::RecordAction( - content::UserMetricsAction("Caption_GestureTogglesMaximize")); - break; - case ash::UMA_TOUCHPAD_GESTURE_OVERVIEW: - content::RecordAction( - content::UserMetricsAction("Touchpad_Gesture_Overview")); - break; - case ash::UMA_TOUCHSCREEN_TAP_DOWN: - content::RecordAction(content::UserMetricsAction("Touchscreen_Down")); - break; - case ash::UMA_TRAY_HELP: - content::RecordAction(content::UserMetricsAction("Tray_Help")); - break; - case ash::UMA_TRAY_LOCK_SCREEN: - content::RecordAction(content::UserMetricsAction("Tray_LockScreen")); - break; - case ash::UMA_TRAY_SHUT_DOWN: - content::RecordAction(content::UserMetricsAction("Tray_ShutDown")); - break; - case ash::UMA_WINDOW_APP_CLOSE_BUTTON_CLICK: - content::RecordAction(content::UserMetricsAction("AppCloseButton_Clk")); - break; - case ash::UMA_WINDOW_CLOSE_BUTTON_CLICK: - content::RecordAction(content::UserMetricsAction("CloseButton_Clk")); - break; - case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN: - content::RecordAction(content::UserMetricsAction("MaxButton_Clk_ExitFS")); - break; - case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE: - content::RecordAction( - content::UserMetricsAction("MaxButton_Clk_Restore")); - break; - case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE: - content::RecordAction( - content::UserMetricsAction("MaxButton_Clk_Maximize")); - break; - case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE: - content::RecordAction(content::UserMetricsAction("MinButton_Clk")); - break; - case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE: - content::RecordAction(content::UserMetricsAction("MaxButton_Maximize")); - break; - case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT: - content::RecordAction(content::UserMetricsAction("MaxButton_MaxLeft")); - break; - case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT: - content::RecordAction(content::UserMetricsAction("MaxButton_MaxRight")); - break; - case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MINIMIZE: - content::RecordAction(content::UserMetricsAction("MaxButton_Minimize")); - break; - case ash::UMA_WINDOW_MAXIMIZE_BUTTON_RESTORE: - content::RecordAction(content::UserMetricsAction("MaxButton_Restore")); - break; - case ash::UMA_WINDOW_MAXIMIZE_BUTTON_SHOW_BUBBLE: - content::RecordAction(content::UserMetricsAction("MaxButton_ShowBubble")); - break; - case ash::UMA_WINDOW_OVERVIEW: - content::RecordAction( - content::UserMetricsAction("WindowSelector_Overview")); - break; - case ash::UMA_WINDOW_SELECTION: - content::RecordAction( - content::UserMetricsAction("WindowSelector_Selection")); - break; - } -} - ui::MenuModel* ChromeShellDelegate::CreateContextMenu(aura::Window* root) { DCHECK(shelf_delegate_); // Don't show context menu for exclusive app runtime mode. diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.h b/chrome/browser/ui/ash/chrome_shell_delegate.h index b32b8c2..ad360e0 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.h +++ b/chrome/browser/ui/ash/chrome_shell_delegate.h @@ -57,7 +57,6 @@ class ChromeShellDelegate : public ash::ShellDelegate, virtual ash::NewWindowDelegate* CreateNewWindowDelegate() OVERRIDE; virtual ash::MediaDelegate* CreateMediaDelegate() OVERRIDE; virtual aura::client::UserActionClient* CreateUserActionClient() OVERRIDE; - virtual void RecordUserMetricsAction(ash::UserMetricsAction action) OVERRIDE; virtual ui::MenuModel* CreateContextMenu(aura::Window* root) OVERRIDE; virtual ash::RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE; virtual base::string16 GetProductName() const OVERRIDE; diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc index 378b289..80c4d7f 100644 --- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc +++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc @@ -7,10 +7,10 @@ #include <string> #include "ash/desktop_background/user_wallpaper_delegate.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/root_window_controller.h" #include "ash/shelf/shelf_widget.h" #include "ash/shell.h" -#include "ash/shell_delegate.h" #include "base/bind.h" #include "base/command_line.h" #include "base/prefs/pref_service.h" @@ -247,7 +247,7 @@ void LauncherContextMenu::ExecuteCommand(int command_id, int event_flags) { break; case MENU_CLOSE: controller_->Close(item_.id); - ChromeShellDelegate::instance()->RecordUserMetricsAction( + ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction( ash::UMA_CLOSE_THROUGH_CONTEXT_MENU); break; case MENU_PIN: diff --git a/tools/metrics/actions/chromeactions.txt b/tools/metrics/actions/chromeactions.txt index cea30f4..ad32d42 100644 --- a/tools/metrics/actions/chromeactions.txt +++ b/tools/metrics/actions/chromeactions.txt @@ -247,9 +247,11 @@ 0x95a93ad59fa23f78 BookmarkBar_ContextMenu_OpenAllIncognito 0x798f8467fbe49e1e BookmarkBar_ContextMenu_OpenInNewTab 0x14c4432cb3aca04b BookmarkBar_ContextMenu_OpenInNewWindow +0x933a912dd22eacb3 BookmarkBar_ContextMenu_Redo 0xd8a39c089af645f1 BookmarkBar_ContextMenu_Remove 0xa90364ba80763db0 BookmarkBar_ContextMenu_RemoveFromBookmarkBar 0xa905159308ac6adc BookmarkBar_ContextMenu_ShowInFolder +0xb985dcc55f9d73a4 BookmarkBar_ContextMenu_Undo 0x07801d0423d26682 BookmarkBar_CtxMenu 0x8623e5f54147dbe6 BookmarkBar_DragButton 0x4b37738130b32b3e BookmarkBar_DragEnd @@ -1696,6 +1698,56 @@ 0x1a4ebb180ba59b06 Shutdown 0x26f93e6e68e28a69 Star 0x2fbe99005588ef01 StartupTick +0x61d88befbaefa89a StatusArea_Accessability_DetailedView +0x7f426d3c3fc349cb StatusArea_Audio_CurrentInputDevice +0xc08bb03164134793 StatusArea_Audio_CurrentOutputDevice +0x42a8978c0a7e4910 StatusArea_Audio_Detailed +0x0bedcb41ae4e10a2 StatusArea_Audio_SwitchInputDevice +0x8dfc66b302b53c35 StatusArea_Audio_SwitchOutputDevice +0x98219794f13b6f19 StatusArea_AutoClickDisabled +0xdf8318eeee7499a5 StatusArea_AutoClickEnabled +0x4a4880442f78544f StatusArea_Bluetooth_Connect_Known +0xabf7cef9a1865298 StatusArea_Bluetooth_Connect_Unknown +0x39572ab6d4cb1829 StatusArea_Bluetooth_Detailed +0x37df6e0429625056 StatusArea_Bluetooth_Disabled +0x8e695b22dbec8ed8 StatusArea_Bluetooth_Enabled +0xd26c8140dacced4e StatusArea_BrightnessChanged +0x259ed8148e433ff5 StatusArea_Brightness_Detailed +0xb5744d753e598294 StatusArea_CapsLock_Detailed +0xda0423582289f5e3 StatusArea_CapsLock_DisabledByClick +0xaad53fbb4eddba16 StatusArea_CapsLock_EnabledByClick +0xdc5e7fa620ac749b StatusArea_CapsLock_Popup +0xba2d03681372e761 StatusArea_Drive_CancelOperation +0x807ca87245b0bcb8 StatusArea_Drive_Detailed +0x5cae26dc499854d5 StatusArea_Drive_Settings +0xdc358cbb3cd04f74 StatusArea_HighContrastDisabled +0xe15f1e2ffa6ca5a4 StatusArea_HighContrastEnabled +0xc506ef0ccc5f4842 StatusArea_IME_Detailed +0x5ed2d8ae9a4d27d0 StatusArea_IME_SwitchMode +0xa570b1aa4e3c9697 StatusArea_LargeCursorDisabled +0x89aefa3fbcaf90d2 StatusArea_LargeCursorEnabled +0x2e62eefedb24257f StatusArea_MagnifierDisabled +0xc3a8212bc7b08422 StatusArea_MagnifierEnabled +0x36388e1a16db228e StatusArea_MenuOpened +0x9ef9e0169d6c451c StatusArea_Network_ConnectConfigured +0x907b1216d95ddabd StatusArea_Network_ConnectToConfigured +0x4917e98c05c24323 StatusArea_Network_ConnectUnconfigured +0xd019e5bcf6a2be27 StatusArea_Network_ConnectionDetails +0x778eb25e08d1a0c6 StatusArea_Network_Detailed +0xf3cea7bbfa9f216b StatusArea_Network_JoinOther +0x7c0afaedc976b5e2 StatusArea_Network_Settings +0x4491cf3c0806bf66 StatusArea_Network_WifiDisabled +0x789ff2ba9f3872c8 StatusArea_Network_WifiEnabled +0xb43a5a7909331d06 StatusArea_SignOut +0xff9eaf2114140f32 StatusArea_SpokenFeedbackDisabled +0x90669ba72028bb72 StatusArea_SpokenFeedbackEnabled +0xf080e59c449d63cc StatusArea_VPN_ConnectToNetwork +0x3650d060cba6101c StatusArea_VPN_ConnectionDetails +0x1bf61eee704c2807 StatusArea_VPN_Detailed +0x6a55be1b0e62adec StatusArea_VPN_JoinOther +0x4e887baf440f63fd StatusArea_VPN_Settings +0xc0e9f67eb7dda1ac StatusArea_Volume_ChangedMenu +0x6c76189fc7f0b318 StatusArea_Volume_ChangedPopup 0x11a755d598c0c417 Stop 0x926a51baad949d12 Strikethrough 0x055a197053882ccd SuspiciousExtensionBubbleDismissed |