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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
10 #include "ash/system/user/login_status.h" | 10 #include "ash/system/user/login_status.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // These functions are called when the corresponding view item is about to be | 48 // These functions are called when the corresponding view item is about to be |
49 // removed. An item should do appropriate cleanup in these functions. | 49 // removed. An item should do appropriate cleanup in these functions. |
50 // The default implementation does nothing. | 50 // The default implementation does nothing. |
51 virtual void DestroyTrayView(); | 51 virtual void DestroyTrayView(); |
52 virtual void DestroyDefaultView(); | 52 virtual void DestroyDefaultView(); |
53 virtual void DestroyDetailedView(); | 53 virtual void DestroyDetailedView(); |
54 virtual void DestroyNotificationView(); | 54 virtual void DestroyNotificationView(); |
55 | 55 |
56 // Updates the tray view (if applicable) when the user's login status changes. | 56 // Updates the tray view (if applicable) when the user's login status changes. |
57 // It is not necessary the update the default or detailed view, since the | 57 // It is not necessary the update the default or detailed view, since the |
58 // default/detailed popup is closed when login status changes. | 58 // default/detailed popup is closed when login status changes. The default |
59 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) = 0; | 59 // implementation does nothing. |
| 60 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status); |
60 | 61 |
61 // Pops up the detailed view for this item. An item can request to show its | 62 // Pops up the detailed view for this item. An item can request to show its |
62 // detailed view using this function (e.g. from an observer callback when | 63 // detailed view using this function (e.g. from an observer callback when |
63 // something, e.g. volume, network availability etc. changes). If | 64 // something, e.g. volume, network availability etc. changes). If |
64 // |for_seconds| is non-zero, then the popup is closed after the specified | 65 // |for_seconds| is non-zero, then the popup is closed after the specified |
65 // time. | 66 // time. |
66 void PopupDetailedView(int for_seconds, bool activate); | 67 void PopupDetailedView(int for_seconds, bool activate); |
67 | 68 |
68 // Continue showing the currently-shown detailed view, if any, for | 69 // Continue showing the currently-shown detailed view, if any, for |
69 // |for_seconds| seconds. The caller is responsible for checking that the | 70 // |for_seconds| seconds. The caller is responsible for checking that the |
70 // currently-shown view is for this item. | 71 // currently-shown view is for this item. |
71 void SetDetailedViewCloseDelay(int for_seconds); | 72 void SetDetailedViewCloseDelay(int for_seconds); |
72 | 73 |
| 74 // Hides the detailed view for this item. |
| 75 void HideDetailedView(); |
| 76 |
73 // Shows a notification for this item. | 77 // Shows a notification for this item. |
74 void ShowNotificationView(); | 78 void ShowNotificationView(); |
75 | 79 |
76 // Hides the notification for this item. | 80 // Hides the notification for this item. |
77 void HideNotificationView(); | 81 void HideNotificationView(); |
78 | 82 |
79 private: | 83 private: |
80 | 84 |
81 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); | 85 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); |
82 }; | 86 }; |
83 | 87 |
84 } // namespace ash | 88 } // namespace ash |
85 | 89 |
86 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ | 90 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ |
OLD | NEW |