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

Unified Diff: ash/common/system/tray/system_tray_item.h

Issue 2162153002: Added Ash.SystemMenu.DefaultView.VisibleItems histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary includes after self review. 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
Index: ash/common/system/tray/system_tray_item.h
diff --git a/ash/common/system/tray/system_tray_item.h b/ash/common/system/tray/system_tray_item.h
index 09c5f82d7112e85599fcfc318b4d4bdf1fca17f6..87935abac1c867dd9131315a205b6ba83396c4fa 100644
--- a/ash/common/system/tray/system_tray_item.h
+++ b/ash/common/system/tray/system_tray_item.h
@@ -16,11 +16,46 @@ class View;
namespace ash {
class SystemTray;
+class SystemTrayBubble;
class TrayItemView;
class ASH_EXPORT SystemTrayItem {
public:
- explicit SystemTrayItem(SystemTray* system_tray);
+ // The different types of SystemTrayItems.
+ //
+ // *** IMPORTANT *** - These values are used for UMA metrics so do NOT
James Cook 2016/07/20 20:13:49 nit: This probably doesn't need to be "**** IMPORT
bruthig 2016/07/21 14:34:58 Done.
+ // re-order this enum and only insert items before the COUNT item.
+ enum UmaType {
+ TEST, // 0 - Used for test only.
James Cook 2016/07/20 20:13:49 I would either give these all a prefix (like UMA_T
bruthig 2016/07/21 14:34:58 Done.
+ ACCESSIBILITY, // 1
James Cook 2016/07/20 20:13:49 nit: Don't explicitly number the enum in comments.
bruthig 2016/07/21 14:34:58 Done.
+ AUDIO, // 2
+ BLUETOOTH, // 3
+ CAPS_LOCK, // 4
+ CAST, // 5
+ DATE, // 6
+ DISPLAY, // 7
+ DISPLAY_BRIGHTNESS, // 8
+ ENTERPRISE, // 9
+ IME, // 10
+ MULTI_PROFILE_MEDIA, // 11
+ NETWORK, // 12
+ SETTINGS, // 13
+ UPDATE, // 14
+ POWER, // 15
+ ROTATION_LOCK, // 16
+ SCREEN_CAPTURE, // 17
+ SCREEN_SHARE, // 18
+ SESSION_LENGTH_LIMIT, // 19
+ SMS, // 20
+ SUPERVISED_USER, // 21
+ TRACING, // 22
+ USER, // 23
+ USER_SEPARATOR, // 24
+ VPN, // 25
+ COUNT // 26
+ };
+
+ SystemTrayItem(SystemTray* system_tray, UmaType type);
virtual ~SystemTrayItem();
// Create* functions may return NULL if nothing should be displayed for the
@@ -107,7 +142,13 @@ class ASH_EXPORT SystemTrayItem {
void set_restore_focus(bool restore_focus) { restore_focus_ = restore_focus; }
private:
+ // Accesses uma_type().
+ friend class SystemTrayBubble;
+
+ UmaType uma_type() const { return uma_type_; }
James Cook 2016/07/20 20:13:49 nit: If this is only used in test, eliminate and d
bruthig 2016/07/21 14:34:58 This is used by the SystemTrayBubble class in prod
+
SystemTray* system_tray_;
+ UmaType uma_type_;
bool restore_focus_;
DISALLOW_COPY_AND_ASSIGN(SystemTrayItem);

Powered by Google App Engine
This is Rietveld 408576698