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

Unified Diff: ash/system/date/tray_date.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell_delegate.h ('k') | ash/wm/session_state_controller_impl2.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/date/tray_date.cc
diff --git a/ash/system/date/tray_date.cc b/ash/system/date/tray_date.cc
index c603b2683ae0febc15d173f2517c388cfacb0550..60f8ce30ab41e83c6927ab7a9094923b7b02f638 100644
--- a/ash/system/date/tray_date.cc
+++ b/ash/system/date/tray_date.cc
@@ -5,6 +5,7 @@
#include "ash/system/date/tray_date.h"
#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/system/date/date_view.h"
#include "ash/system/tray/system_tray.h"
#include "ash/system/tray/system_tray_delegate.h"
@@ -107,16 +108,21 @@ class DateDefaultView : public views::View,
// Overridden from views::ButtonListener.
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE {
- ash::SystemTrayDelegate* tray =
- ash::Shell::GetInstance()->system_tray_delegate();
- if (sender == help_)
- tray->ShowHelp();
- else if (sender == shutdown_)
- tray->ShutDown();
- else if (sender == lock_)
- tray->RequestLockScreen();
- else
+ 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);
+ tray_delegate->ShowHelp();
+ } else if (sender == shutdown_) {
+ shell_delegate->RecordUserMetricsAction(ash::UMA_TRAY_SHUT_DOWN);
+ tray_delegate->ShutDown();
+ } else if (sender == lock_) {
+ shell_delegate->RecordUserMetricsAction(ash::UMA_TRAY_LOCK_SCREEN);
+ tray_delegate->RequestLockScreen();
+ } else {
NOTREACHED();
+ }
}
ash::internal::TrayPopupHeaderButton* help_;
« no previous file with comments | « ash/shell_delegate.h ('k') | ash/wm/session_state_controller_impl2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698