Chromium Code Reviews| Index: ash/system/chromeos/tray_display.cc |
| diff --git a/ash/system/chromeos/tray_display.cc b/ash/system/chromeos/tray_display.cc |
| index 8bf2f602d99be57c9115f5c8d59962eff7ade0ca..67e8443b740dc9c5edcac4932b4a2f00d8c6fda2 100644 |
| --- a/ash/system/chromeos/tray_display.cc |
| +++ b/ash/system/chromeos/tray_display.cc |
| @@ -8,6 +8,7 @@ |
| #include <utility> |
| #include <vector> |
| +#include "ash/common/metrics/user_metrics_action.h" |
| #include "ash/common/system/chromeos/devicetype_utils.h" |
| #include "ash/common/system/system_notifier.h" |
| #include "ash/common/system/tray/actionable_view.h" |
| @@ -112,7 +113,7 @@ base::string16 GetAllDisplayInfo() { |
| return base::JoinString(lines, base::ASCIIToUTF16("\n")); |
| } |
| -void OpenSettings() { |
| +void OpenSettings(UserMetricsAction action) { |
|
tdanderson
2016/07/07 21:41:39
nit: Add a brief explanation to the documentation
bruthig
2016/07/08 17:12:51
This got reworked a little bit.
|
| // switch is intentionally introduced without default, to cause an error when |
| // a new type of login status is introduced. |
| switch (WmShell::Get()->system_tray_delegate()->GetUserLoginStatus()) { |
| @@ -130,6 +131,8 @@ void OpenSettings() { |
| if (delegate->ShouldShowSettings()) |
| delegate->ShowDisplaySettings(); |
| } |
| + |
| + WmShell::Get()->RecordUserMetricsAction(action); |
| } |
| } // namespace |
| @@ -280,7 +283,7 @@ class DisplayView : public ActionableView { |
| // Overridden from ActionableView. |
| bool PerformAction(const ui::Event& event) override { |
| - OpenSettings(); |
| + OpenSettings(UMA_STATUS_AREA_DISPLAY_DEFAULT_CLICKED); |
| return true; |
| } |
| @@ -404,8 +407,8 @@ void TrayDisplay::CreateOrUpdateNotification( |
| message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
| system_notifier::kNotifierDisplay), |
| message_center::RichNotificationData(), |
| - new message_center::HandleNotificationClickedDelegate( |
| - base::Bind(&OpenSettings)))); |
| + new message_center::HandleNotificationClickedDelegate(base::Bind( |
| + &OpenSettings, UMA_STATUS_AREA_DISPLAY_NOTIFICATION_CLICKED)))); |
| message_center::MessageCenter::Get()->AddNotification( |
| std::move(notification)); |