OLD | NEW |
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_ITEM_H_ | 5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ |
6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ | 6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/system/user/login_status.h" | 9 #include "ash/system/user/login_status.h" |
10 #include "ash/wm/shelf_types.h" | 10 #include "ash/wm/shelf_types.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 | 13 |
14 namespace views { | 14 namespace views { |
15 class View; | 15 class View; |
16 } | 16 } |
17 | 17 |
18 namespace ash { | 18 namespace ash { |
19 | 19 |
| 20 class SystemTray; |
| 21 |
20 namespace internal { | 22 namespace internal { |
21 class TrayItemView; | 23 class TrayItemView; |
22 } | 24 } |
23 | 25 |
24 class ASH_EXPORT SystemTrayItem { | 26 class ASH_EXPORT SystemTrayItem { |
25 public: | 27 public: |
26 SystemTrayItem(); | 28 explicit SystemTrayItem(SystemTray* system_tray); |
27 virtual ~SystemTrayItem(); | 29 virtual ~SystemTrayItem(); |
28 | 30 |
29 // Create* functions may return NULL if nothing should be displayed for the | 31 // Create* functions may return NULL if nothing should be displayed for the |
30 // type of view. The default implementations return NULL. | 32 // type of view. The default implementations return NULL. |
31 | 33 |
32 // Returns a view to be displayed in the system tray. If this returns NULL, | 34 // Returns a view to be displayed in the system tray. If this returns NULL, |
33 // then this item is not displayed in the tray. | 35 // then this item is not displayed in the tray. |
34 // NOTE: The returned view should almost always be a TrayItemView, which | 36 // NOTE: The returned view should almost always be a TrayItemView, which |
35 // automatically resizes the widget when the size of the view changes, and | 37 // automatically resizes the widget when the size of the view changes, and |
36 // adds animation when the visibility of the view changes. If a view wants to | 38 // adds animation when the visibility of the view changes. If a view wants to |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Shows a notification for this item. | 95 // Shows a notification for this item. |
94 void ShowNotificationView(); | 96 void ShowNotificationView(); |
95 | 97 |
96 // Hides the notification for this item. | 98 // Hides the notification for this item. |
97 void HideNotificationView(); | 99 void HideNotificationView(); |
98 | 100 |
99 // Returns true if this item needs to force the launcher to be visible when | 101 // Returns true if this item needs to force the launcher to be visible when |
100 // the launcher is in the auto-hide state. Default is true. | 102 // the launcher is in the auto-hide state. Default is true. |
101 virtual bool ShouldShowLauncher() const; | 103 virtual bool ShouldShowLauncher() const; |
102 | 104 |
| 105 // Returns the system tray that this item belongs to. |
| 106 SystemTray* system_tray() const { return system_tray_; } |
| 107 |
103 private: | 108 private: |
| 109 SystemTray* system_tray_; |
| 110 |
104 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); | 111 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); |
105 }; | 112 }; |
106 | 113 |
107 } // namespace ash | 114 } // namespace ash |
108 | 115 |
109 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ | 116 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ |
OLD | NEW |