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_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" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 virtual views::View* CreateTrayView(LoginStatus status); | 82 virtual views::View* CreateTrayView(LoginStatus status); |
83 | 83 |
84 // 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 |
85 // 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 |
86 // big. | 86 // big. |
87 virtual views::View* CreateDefaultView(LoginStatus status); | 87 virtual views::View* CreateDefaultView(LoginStatus status); |
88 | 88 |
89 // 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. |
90 virtual views::View* CreateDetailedView(LoginStatus status); | 90 virtual views::View* CreateDetailedView(LoginStatus status); |
91 | 91 |
92 // Returns a notification view for the item. This view is displayed with | |
93 // other notifications and should be the same size as default views. | |
94 // DEPRECATED. Use the message center instead. | |
95 virtual views::View* CreateNotificationView(LoginStatus status); | |
96 | |
97 // These functions are called when the corresponding view item is about to be | 92 // These functions are called when the corresponding view item is about to be |
98 // removed. An item should do appropriate cleanup in these functions. | 93 // removed. An item should do appropriate cleanup in these functions. |
99 // The default implementation does nothing. | 94 // The default implementation does nothing. |
100 virtual void DestroyTrayView(); | 95 virtual void DestroyTrayView(); |
101 virtual void DestroyDefaultView(); | 96 virtual void DestroyDefaultView(); |
102 virtual void DestroyDetailedView(); | 97 virtual void DestroyDetailedView(); |
103 virtual void DestroyNotificationView(); | |
104 | 98 |
105 // Updates the tray view (if applicable) when the user's login status changes. | 99 // Updates the tray view (if applicable) when the user's login status changes. |
106 // It is not necessary the update the default or detailed view, since the | 100 // It is not necessary the update the default or detailed view, since the |
107 // default/detailed popup is closed when login status changes. The default | 101 // default/detailed popup is closed when login status changes. The default |
108 // implementation does nothing. | 102 // implementation does nothing. |
109 virtual void UpdateAfterLoginStatusChange(LoginStatus status); | 103 virtual void UpdateAfterLoginStatusChange(LoginStatus status); |
110 | 104 |
111 // Updates the tray view (if applicable) when shelf's alignment changes. | 105 // Updates the tray view (if applicable) when shelf's alignment changes. |
112 // The default implementation does nothing. | 106 // The default implementation does nothing. |
113 virtual void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment); | 107 virtual void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment); |
(...skipping 16 matching lines...) Expand all Loading... |
130 | 124 |
131 // Continue showing the currently-shown detailed view, if any, for | 125 // Continue showing the currently-shown detailed view, if any, for |
132 // |for_seconds| seconds. The caller is responsible for checking that the | 126 // |for_seconds| seconds. The caller is responsible for checking that the |
133 // currently-shown view is for this item. | 127 // currently-shown view is for this item. |
134 void SetDetailedViewCloseDelay(int for_seconds); | 128 void SetDetailedViewCloseDelay(int for_seconds); |
135 | 129 |
136 // Hides the detailed view for this item. Disable hiding animation if | 130 // Hides the detailed view for this item. Disable hiding animation if |
137 // |animate| is false. | 131 // |animate| is false. |
138 void HideDetailedView(bool animate); | 132 void HideDetailedView(bool animate); |
139 | 133 |
140 // Shows a notification for this item. | |
141 void ShowNotificationView(); | |
142 | |
143 // Hides the notification for this item. | |
144 void HideNotificationView(); | |
145 | |
146 // Returns true if this item needs to force the shelf to be visible when | 134 // Returns true if this item needs to force the shelf to be visible when |
147 // the shelf is in the auto-hide state. Default is true. | 135 // the shelf is in the auto-hide state. Default is true. |
148 virtual bool ShouldShowShelf() const; | 136 virtual bool ShouldShowShelf() const; |
149 | 137 |
150 // Returns the system tray that this item belongs to. | 138 // Returns the system tray that this item belongs to. |
151 SystemTray* system_tray() const { return system_tray_; } | 139 SystemTray* system_tray() const { return system_tray_; } |
152 | 140 |
153 bool restore_focus() const { return restore_focus_; } | 141 bool restore_focus() const { return restore_focus_; } |
154 void set_restore_focus(bool restore_focus) { restore_focus_ = restore_focus; } | 142 void set_restore_focus(bool restore_focus) { restore_focus_ = restore_focus; } |
155 | 143 |
(...skipping 12 matching lines...) Expand all Loading... |
168 | 156 |
169 // Used to delay the transition to the detailed view. | 157 // Used to delay the transition to the detailed view. |
170 std::unique_ptr<base::OneShotTimer> transition_delay_timer_; | 158 std::unique_ptr<base::OneShotTimer> transition_delay_timer_; |
171 | 159 |
172 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); | 160 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); |
173 }; | 161 }; |
174 | 162 |
175 } // namespace ash | 163 } // namespace ash |
176 | 164 |
177 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ | 165 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ |
OLD | NEW |