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

Unified Diff: ash/system/chromeos/tray_display.cc

Issue 2130923002: Added UMA metrics for display settings UI in the status area. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/metrics/user_metrics_recorder.cc ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « ash/metrics/user_metrics_recorder.cc ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698