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

Side by Side Diff: ash/system/tray/system_tray.h

Issue 2060003002: ash: Add a unit test for the system update tray item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@movetraydelegate
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « ash/ash.gyp ('k') | ash/system/tray/system_tray.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_SYSTEM_TRAY_SYSTEM_TRAY_H_ 5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_
6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ 6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
11 11
12 #include "ash/ash_export.h" 12 #include "ash/ash_export.h"
13 #include "ash/system/cast/tray_cast.h" 13 #include "ash/system/cast/tray_cast.h"
14 #include "ash/system/tray/system_tray_bubble.h" 14 #include "ash/system/tray/system_tray_bubble.h"
15 #include "ash/system/tray/tray_background_view.h" 15 #include "ash/system/tray/tray_background_view.h"
16 #include "ash/system/user/login_status.h" 16 #include "ash/system/user/login_status.h"
17 #include "base/compiler_specific.h" 17 #include "base/compiler_specific.h"
18 #include "base/macros.h" 18 #include "base/macros.h"
19 #include "base/memory/scoped_vector.h" 19 #include "base/memory/scoped_vector.h"
20 #include "ui/views/bubble/tray_bubble_view.h" 20 #include "ui/views/bubble/tray_bubble_view.h"
21 #include "ui/views/view.h" 21 #include "ui/views/view.h"
22 22
23 namespace ash { 23 namespace ash {
24 class ScreenTrayItem; 24 class ScreenTrayItem;
25 class SystemBubbleWrapper; 25 class SystemBubbleWrapper;
26 class SystemTrayDelegate; 26 class SystemTrayDelegate;
27 class SystemTrayItem; 27 class SystemTrayItem;
28 class TrayAccessibility; 28 class TrayAccessibility;
29 class TrayDate; 29 class TrayDate;
30 class TrayUpdate;
30 class TrayUser; 31 class TrayUser;
31 32
32 // There are different methods for creating bubble views. 33 // There are different methods for creating bubble views.
33 enum BubbleCreationType { 34 enum BubbleCreationType {
34 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. 35 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one.
35 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one. 36 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one.
36 }; 37 };
37 38
38 class ASH_EXPORT SystemTray : public TrayBackgroundView, 39 class ASH_EXPORT SystemTray : public TrayBackgroundView,
39 public views::TrayBubbleView::Delegate { 40 public views::TrayBubbleView::Delegate {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 151
151 // Get the tray item view (or NULL) for a given |tray_item| in a unit test. 152 // Get the tray item view (or NULL) for a given |tray_item| in a unit test.
152 views::View* GetTrayItemViewForTest(SystemTrayItem* tray_item); 153 views::View* GetTrayItemViewForTest(SystemTrayItem* tray_item);
153 154
154 // Gets tray_cast_ for browser tests. 155 // Gets tray_cast_ for browser tests.
155 TrayCast* GetTrayCastForTesting() const; 156 TrayCast* GetTrayCastForTesting() const;
156 157
157 // Gets tray_date_ for browser tests. 158 // Gets tray_date_ for browser tests.
158 TrayDate* GetTrayDateForTesting() const; 159 TrayDate* GetTrayDateForTesting() const;
159 160
161 TrayUpdate* GetTrayUpdateForTesting() const;
stevenjb 2016/06/10 22:56:30 nit: Replace the comments in 155 and 158 with "Uni
James Cook 2016/06/10 23:15:03 I removed the comments, the method names are enoug
162
160 private: 163 private:
161 // Creates the default set of items for the sytem tray. 164 // Creates the default set of items for the sytem tray.
162 void CreateItems(SystemTrayDelegate* delegate); 165 void CreateItems(SystemTrayDelegate* delegate);
163 166
164 // Resets |system_bubble_| and clears any related state. 167 // Resets |system_bubble_| and clears any related state.
165 void DestroySystemBubble(); 168 void DestroySystemBubble();
166 169
167 // Resets |notification_bubble_| and clears any related state. 170 // Resets |notification_bubble_| and clears any related state.
168 void DestroyNotificationBubble(); 171 void DestroyNotificationBubble();
169 172
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 bool hide_notifications_; 238 bool hide_notifications_;
236 239
237 // This is true when the displayed system tray menu is a full tray menu, 240 // This is true when the displayed system tray menu is a full tray menu,
238 // otherwise a single line item menu like the volume slider is shown. 241 // otherwise a single line item menu like the volume slider is shown.
239 // Note that the value is only valid when |system_bubble_| is true. 242 // Note that the value is only valid when |system_bubble_| is true.
240 bool full_system_tray_menu_; 243 bool full_system_tray_menu_;
241 244
242 TrayAccessibility* tray_accessibility_; // not owned 245 TrayAccessibility* tray_accessibility_; // not owned
243 TrayCast* tray_cast_; 246 TrayCast* tray_cast_;
244 TrayDate* tray_date_; 247 TrayDate* tray_date_;
248 TrayUpdate* tray_update_;
245 249
246 // A reference to the Screen share and capture item. 250 // A reference to the Screen share and capture item.
247 ScreenTrayItem* screen_capture_tray_item_; // not owned 251 ScreenTrayItem* screen_capture_tray_item_; // not owned
248 ScreenTrayItem* screen_share_tray_item_; // not owned 252 ScreenTrayItem* screen_share_tray_item_; // not owned
249 253
250 DISALLOW_COPY_AND_ASSIGN(SystemTray); 254 DISALLOW_COPY_AND_ASSIGN(SystemTray);
251 }; 255 };
252 256
253 } // namespace ash 257 } // namespace ash
254 258
255 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ 259 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_
OLDNEW
« no previous file with comments | « ash/ash.gyp ('k') | ash/system/tray/system_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698