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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. |
59 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) = 0; | 59 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) = 0; |
60 | 60 |
| 61 // Shows the detailed view for this item. If the main popup for the tray is |
| 62 // currently visible, then making this call would use the existing window to |
| 63 // display the detailed item. The detailed item will inherit the bounds of the |
| 64 // existing window. |
| 65 // If there is no existing view, then this is equivalent to calling |
| 66 // PopupDetailedView(0, true). |
| 67 void TransitionDetailedView(); |
| 68 |
61 // Pops up the detailed view for this item. An item can request to show its | 69 // 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 | 70 // detailed view using this function (e.g. from an observer callback when |
63 // something, e.g. volume, network availability etc. changes). If | 71 // something, e.g. volume, network availability etc. changes). If |
64 // |for_seconds| is non-zero, then the popup is closed after the specified | 72 // |for_seconds| is non-zero, then the popup is closed after the specified |
65 // time. | 73 // time. |
66 void PopupDetailedView(int for_seconds, bool activate); | 74 void PopupDetailedView(int for_seconds, bool activate); |
67 | 75 |
68 // Continue showing the currently-shown detailed view, if any, for | 76 // Continue showing the currently-shown detailed view, if any, for |
69 // |for_seconds| seconds. The caller is responsible for checking that the | 77 // |for_seconds| seconds. The caller is responsible for checking that the |
70 // currently-shown view is for this item. | 78 // currently-shown view is for this item. |
71 void SetDetailedViewCloseDelay(int for_seconds); | 79 void SetDetailedViewCloseDelay(int for_seconds); |
72 | 80 |
73 // Shows a notification for this item. | 81 // Shows a notification for this item. |
74 void ShowNotificationView(); | 82 void ShowNotificationView(); |
75 | 83 |
76 // Hides the notification for this item. | 84 // Hides the notification for this item. |
77 void HideNotificationView(); | 85 void HideNotificationView(); |
78 | 86 |
79 private: | 87 private: |
80 | 88 |
81 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); | 89 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); |
82 }; | 90 }; |
83 | 91 |
84 } // namespace ash | 92 } // namespace ash |
85 | 93 |
86 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ | 94 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ |
OLD | NEW |