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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // Returns a detailed view for the item. This view is displayed standalone. | 38 // Returns a detailed view for the item. This view is displayed standalone. |
39 virtual views::View* CreateDetailedView(user::LoginStatus status) = 0; | 39 virtual views::View* CreateDetailedView(user::LoginStatus status) = 0; |
40 | 40 |
41 // These functions are called when the corresponding view item is about to be | 41 // These functions are called when the corresponding view item is about to be |
42 // removed. An item should do appropriate cleanup in these functions. | 42 // removed. An item should do appropriate cleanup in these functions. |
43 virtual void DestroyTrayView() = 0; | 43 virtual void DestroyTrayView() = 0; |
44 virtual void DestroyDefaultView() = 0; | 44 virtual void DestroyDefaultView() = 0; |
45 virtual void DestroyDetailedView() = 0; | 45 virtual void DestroyDetailedView() = 0; |
46 | 46 |
| 47 // Updates the tray view (if applicable) when the user's login status changes. |
| 48 // It is not necessary the update the default or detailed view, since the |
| 49 // default/detailed popup is closed when login status changes. |
| 50 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) = 0; |
| 51 |
47 // Pops up the detailed view for this item. An item can request to show its | 52 // Pops up the detailed view for this item. An item can request to show its |
48 // detailed view using this function (e.g. from an observer callback when | 53 // detailed view using this function (e.g. from an observer callback when |
49 // something, e.g. volume, network availability etc. changes). If | 54 // something, e.g. volume, network availability etc. changes). If |
50 // |for_seconds| is non-zero, then the popup is closed after the specified | 55 // |for_seconds| is non-zero, then the popup is closed after the specified |
51 // time. | 56 // time. |
52 void PopupDetailedView(int for_seconds, bool activate); | 57 void PopupDetailedView(int for_seconds, bool activate); |
53 | 58 |
54 // Continue showing the currently-shown detailed view, if any, for | 59 // Continue showing the currently-shown detailed view, if any, for |
55 // |for_seconds| seconds. The caller is responsible for checking that the | 60 // |for_seconds| seconds. The caller is responsible for checking that the |
56 // currently-shown view is for this item. | 61 // currently-shown view is for this item. |
57 void SetDetailedViewCloseDelay(int for_seconds); | 62 void SetDetailedViewCloseDelay(int for_seconds); |
58 | 63 |
59 private: | 64 private: |
60 | 65 |
61 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); | 66 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); |
62 }; | 67 }; |
63 | 68 |
64 } // namespace ash | 69 } // namespace ash |
65 | 70 |
66 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ | 71 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ |
OLD | NEW |