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

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

Issue 2558043006: ash: Use system tray mojo interface to show system update tray icon (Closed)
Patch Set: fix gcc Created 4 years 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_ITEM_H_ 5 #ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_
6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ 6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "ash/common/login_status.h" 11 #include "ash/common/login_status.h"
12 #include "ash/public/cpp/shelf_types.h" 12 #include "ash/public/cpp/shelf_types.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 14
15 namespace base { 15 namespace base {
16 class OneShotTimer; 16 class OneShotTimer;
17 } // namespace base 17 } // namespace base
18 18
19 namespace views { 19 namespace views {
20 class View; 20 class View;
21 } 21 }
22 22
23 namespace ash { 23 namespace ash {
24 class SystemTray; 24 class SystemTray;
25 class SystemTrayBubble; 25 class SystemTrayBubble;
26 class TrayItemView; 26 class TrayItemView;
27 27
28 // Controller for an item in the system tray. Each item can create these views:
29 // Tray view - The icon in the status area in the shelf.
30 // Default view - The row in the top-level menu.
31 // Detailed view - The submenu shown when the top-level menu row is clicked.
28 class ASH_EXPORT SystemTrayItem { 32 class ASH_EXPORT SystemTrayItem {
29 public: 33 public:
30 // The different types of SystemTrayItems. 34 // The different types of SystemTrayItems.
31 // 35 //
32 // NOTE: These values are used for UMA metrics so do NOT re-order this enum 36 // NOTE: These values are used for UMA metrics so do NOT re-order this enum
33 // and only insert items before the COUNT item. 37 // and only insert items before the COUNT item.
34 enum UmaType { 38 enum UmaType {
35 // SystemTrayItem's with this type are not recorded in the histogram. 39 // SystemTrayItem's with this type are not recorded in the histogram.
36 UMA_NOT_RECORDED = 0, 40 UMA_NOT_RECORDED = 0,
37 // Used for testing purposes only. 41 // Used for testing purposes only.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // Returns a view for the item to be displayed in the list. This view can be 84 // Returns a view for the item to be displayed in the list. This view can be
81 // displayed with a number of other tray items, so this should not be too 85 // displayed with a number of other tray items, so this should not be too
82 // big. 86 // big.
83 virtual views::View* CreateDefaultView(LoginStatus status); 87 virtual views::View* CreateDefaultView(LoginStatus status);
84 88
85 // Returns a detailed view for the item. This view is displayed standalone. 89 // Returns a detailed view for the item. This view is displayed standalone.
86 virtual views::View* CreateDetailedView(LoginStatus status); 90 virtual views::View* CreateDetailedView(LoginStatus status);
87 91
88 // Returns a notification view for the item. This view is displayed with 92 // Returns a notification view for the item. This view is displayed with
89 // other notifications and should be the same size as default views. 93 // other notifications and should be the same size as default views.
94 // DEPRECATED. Use the message center instead.
90 virtual views::View* CreateNotificationView(LoginStatus status); 95 virtual views::View* CreateNotificationView(LoginStatus status);
91 96
92 // These functions are called when the corresponding view item is about to be 97 // These functions are called when the corresponding view item is about to be
93 // removed. An item should do appropriate cleanup in these functions. 98 // removed. An item should do appropriate cleanup in these functions.
94 // The default implementation does nothing. 99 // The default implementation does nothing.
95 virtual void DestroyTrayView(); 100 virtual void DestroyTrayView();
96 virtual void DestroyDefaultView(); 101 virtual void DestroyDefaultView();
97 virtual void DestroyDetailedView(); 102 virtual void DestroyDetailedView();
98 virtual void DestroyNotificationView(); 103 virtual void DestroyNotificationView();
99 104
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 168
164 // Used to delay the transition to the detailed view. 169 // Used to delay the transition to the detailed view.
165 std::unique_ptr<base::OneShotTimer> transition_delay_timer_; 170 std::unique_ptr<base::OneShotTimer> transition_delay_timer_;
166 171
167 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); 172 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem);
168 }; 173 };
169 174
170 } // namespace ash 175 } // namespace ash
171 176
172 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ 177 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_
OLDNEW
« no previous file with comments | « ash/common/system/tray/system_tray_delegate.cc ('k') | ash/common/system/tray/system_tray_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698