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

Side by Side Diff: ash/common/system/tray/system_tray_bubble.h

Issue 2162153002: Added Ash.SystemMenu.DefaultView.VisibleItems histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed ash_unittests compile errors. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ 5 #ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_
6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ 6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_
7 7
8 #include <map>
8 #include <memory> 9 #include <memory>
9 #include <vector> 10 #include <vector>
10 11
11 #include "ash/common/login_status.h" 12 #include "ash/common/login_status.h"
13 #include "ash/common/system/tray/system_tray_item.h"
12 #include "base/macros.h" 14 #include "base/macros.h"
13 #include "base/timer/timer.h" 15 #include "base/timer/timer.h"
14 #include "ui/views/bubble/tray_bubble_view.h" 16 #include "ui/views/bubble/tray_bubble_view.h"
15 17
16 namespace ash { 18 namespace ash {
17 class SystemTray; 19 class SystemTray;
18 class SystemTrayItem; 20 class SystemTrayItem;
19 21
20 class SystemTrayBubble { 22 class SystemTrayBubble {
21 public: 23 public:
(...skipping 30 matching lines...) Expand all
52 void StopAutoCloseTimer(); 54 void StopAutoCloseTimer();
53 void RestartAutoCloseTimer(); 55 void RestartAutoCloseTimer();
54 void Close(); 56 void Close();
55 void SetVisible(bool is_visible); 57 void SetVisible(bool is_visible);
56 bool IsVisible(); 58 bool IsVisible();
57 59
58 // Returns true if any of the SystemTrayItems return true from 60 // Returns true if any of the SystemTrayItems return true from
59 // ShouldShowShelf(). 61 // ShouldShowShelf().
60 bool ShouldShowShelf() const; 62 bool ShouldShowShelf() const;
61 63
64 // Records metrics for visible system menu rows. Only implemented for the
65 // BUBBLE_TYPE_DEFAULT BubbleType.
66 void RecordVisibleRowMetrics();
67
62 private: 68 private:
63 void CreateItemViews(LoginStatus login_status); 69 void CreateItemViews(LoginStatus login_status);
64 70
65 ash::SystemTray* tray_; 71 ash::SystemTray* tray_;
66 views::TrayBubbleView* bubble_view_; 72 views::TrayBubbleView* bubble_view_;
67 std::vector<ash::SystemTrayItem*> items_; 73 std::vector<ash::SystemTrayItem*> items_;
68 BubbleType bubble_type_; 74 BubbleType bubble_type_;
69 75
76 // Tracks the View's created in the last call to CreateItemViews().
tdanderson 2016/07/19 21:58:40 View's->views
bruthig 2016/07/20 18:15:52 Done.
77 std::map<SystemTrayItem::ItemType, views::View*> tray_item_view_map_;
78
70 int autoclose_delay_; 79 int autoclose_delay_;
71 base::OneShotTimer autoclose_; 80 base::OneShotTimer autoclose_;
72 81
73 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubble); 82 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubble);
74 }; 83 };
75 84
76 } // namespace ash 85 } // namespace ash
77 86
78 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ 87 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698