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" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.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 ASH_EXPORT SystemTrayItem { | 20 class ASH_EXPORT SystemTrayItem { |
21 public: | 21 public: |
22 SystemTrayItem(); | 22 SystemTrayItem(); |
23 virtual ~SystemTrayItem(); | 23 virtual ~SystemTrayItem(); |
24 | 24 |
25 // Returns a view to be displayed in the system tray. If this returns NULL, | 25 // Returns a view to be displayed in the system tray. If this returns NULL, |
26 // then this item is not displayed in the tray. | 26 // then this item is not displayed in the tray. |
| 27 // NOTE: The returned view should almost always be a TrayItemView, which |
| 28 // automatically resizes the widget when the size of the view changes, and |
| 29 // adds animation when the visibility of the view changes. If a view wants to |
| 30 // avoid these behaviour, then it should not be a TrayItemView. |
27 virtual views::View* CreateTrayView(user::LoginStatus status) = 0; | 31 virtual views::View* CreateTrayView(user::LoginStatus status) = 0; |
28 | 32 |
29 // Returns a view for the item to be displayed in the list. This view can be | 33 // Returns a view for the item to be displayed in the list. This view can be |
30 // displayed with a number of other tray items, so this should not be too | 34 // displayed with a number of other tray items, so this should not be too |
31 // big. | 35 // big. |
32 virtual views::View* CreateDefaultView(user::LoginStatus status) = 0; | 36 virtual views::View* CreateDefaultView(user::LoginStatus status) = 0; |
33 | 37 |
34 // 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. |
35 virtual views::View* CreateDetailedView(user::LoginStatus status) = 0; | 39 virtual views::View* CreateDetailedView(user::LoginStatus status) = 0; |
36 | 40 |
(...skipping 16 matching lines...) Expand all Loading... |
53 void SetDetailedViewCloseDelay(int for_seconds); | 57 void SetDetailedViewCloseDelay(int for_seconds); |
54 | 58 |
55 private: | 59 private: |
56 | 60 |
57 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); | 61 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); |
58 }; | 62 }; |
59 | 63 |
60 } // namespace ash | 64 } // namespace ash |
61 | 65 |
62 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ | 66 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ |
OLD | NEW |