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 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/system/user/login_status.h" | 9 #include "ash/system/user/login_status.h" |
10 #include "ash/wm/shelf_types.h" | 10 #include "ash/wm/shelf_types.h" |
(...skipping 21 matching lines...) Expand all Loading... | |
32 // Returns a view to be displayed in the system tray. If this returns NULL, | 32 // Returns a view to be displayed in the system tray. If this returns NULL, |
33 // then this item is not displayed in the tray. | 33 // then this item is not displayed in the tray. |
34 // NOTE: The returned view should almost always be a TrayItemView, which | 34 // NOTE: The returned view should almost always be a TrayItemView, which |
35 // automatically resizes the widget when the size of the view changes, and | 35 // automatically resizes the widget when the size of the view changes, and |
36 // adds animation when the visibility of the view changes. If a view wants to | 36 // adds animation when the visibility of the view changes. If a view wants to |
37 // avoid these behaviour, then it should not be a TrayItemView. | 37 // avoid these behaviour, then it should not be a TrayItemView. |
38 virtual views::View* CreateTrayView(user::LoginStatus status); | 38 virtual views::View* CreateTrayView(user::LoginStatus status); |
39 | 39 |
40 // Returns a view for the item to be displayed in the list. This view can be | 40 // Returns a view for the item to be displayed in the list. This view can be |
41 // displayed with a number of other tray items, so this should not be too | 41 // displayed with a number of other tray items, so this should not be too |
42 // big. | 42 // big. |bubble_width| is the current width of the bubble. |
43 virtual views::View* CreateDefaultView(user::LoginStatus status); | 43 virtual views::View* CreateDefaultView(user::LoginStatus status, |
44 int bubble_width); | |
stevenjb
2012/11/15 21:42:04
This is a lot of changes for one use case, and see
bartfab (slow)
2012/11/16 14:56:24
Done. This is a much bigger refactor than I had be
stevenjb
2012/11/16 17:46:55
Yeah, sorry about that, but really appreciate it.
| |
44 | 45 |
45 // Returns a detailed view for the item. This view is displayed standalone. | 46 // Returns a detailed view for the item. This view is displayed standalone. |
46 virtual views::View* CreateDetailedView(user::LoginStatus status); | 47 virtual views::View* CreateDetailedView(user::LoginStatus status); |
47 | 48 |
48 // Returns a notification view for the item. This view is displayed with | 49 // Returns a notification view for the item. This view is displayed with |
49 // other notifications and should be the same size as default views. | 50 // other notifications and should be the same size as default views. |
50 virtual views::View* CreateNotificationView(user::LoginStatus status); | 51 virtual views::View* CreateNotificationView(user::LoginStatus status); |
51 | 52 |
52 // These functions are called when the corresponding view item is about to be | 53 // These functions are called when the corresponding view item is about to be |
53 // removed. An item should do appropriate cleanup in these functions. | 54 // removed. An item should do appropriate cleanup in these functions. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 // Shows a notification for this item. | 94 // Shows a notification for this item. |
94 void ShowNotificationView(); | 95 void ShowNotificationView(); |
95 | 96 |
96 // Hides the notification for this item. | 97 // Hides the notification for this item. |
97 void HideNotificationView(); | 98 void HideNotificationView(); |
98 | 99 |
99 // Returns true if this item needs to force the launcher to be visible when | 100 // Returns true if this item needs to force the launcher to be visible when |
100 // the launcher is in the auto-hide state. Default is true. | 101 // the launcher is in the auto-hide state. Default is true. |
101 virtual bool ShouldShowLauncher() const; | 102 virtual bool ShouldShowLauncher() const; |
102 | 103 |
104 // For views displayed in a bubble, the width is normally determined by a | |
105 // fixed bubble with. If this returns true, the bubble width is adjusted when | |
msw
2012/11/15 21:08:48
nit: s/with/width
| |
106 // displaying this item's default view so that the view can be assigned at | |
107 // least its entire preferred size. Default is false. | |
stevenjb
2012/11/15 21:42:04
This feels awkward. How about a GetMinWidth() that
bartfab (slow)
2012/11/16 14:56:24
Now that Tray*View can walk up the pointer chain a
stevenjb
2012/11/16 17:46:55
That sounds reasonable also.
| |
108 virtual bool GuaranteeDefaultViewPreferredSize( | |
109 user::LoginStatus status) const; | |
110 | |
103 private: | 111 private: |
104 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); | 112 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); |
105 }; | 113 }; |
106 | 114 |
107 } // namespace ash | 115 } // namespace ash |
108 | 116 |
109 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ | 117 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ |
OLD | NEW |