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_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ | 5 #ifndef ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ |
6 #define ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ | 6 #define ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/common/login_status.h" | 9 #include "ash/common/login_status.h" |
10 #include "ash/common/shelf/shelf_background_animator_observer.h" | 10 #include "ash/common/shelf/shelf_background_animator_observer.h" |
11 #include "ash/public/cpp/shelf_types.h" | 11 #include "ash/public/cpp/shelf_types.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
14 | 14 |
15 namespace ash { | 15 namespace ash { |
16 class OverviewButtonTray; | 16 class OverviewButtonTray; |
17 class StatusAreaWidgetDelegate; | 17 class StatusAreaWidgetDelegate; |
18 class SystemTray; | 18 class SystemTray; |
19 class TrayBackgroundView; | |
20 class WebNotificationTray; | 19 class WebNotificationTray; |
21 class WmShelf; | 20 class WmShelf; |
22 class WmWindow; | 21 class WmWindow; |
23 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
24 class ImeMenuTray; | 23 class ImeMenuTray; |
25 class LogoutButtonTray; | 24 class LogoutButtonTray; |
26 class PaletteTray; | 25 class PaletteTray; |
27 class VirtualKeyboardTray; | 26 class VirtualKeyboardTray; |
28 #endif | 27 #endif |
29 | 28 |
(...skipping 11 matching lines...) Expand all Loading... |
41 void Shutdown(); | 40 void Shutdown(); |
42 | 41 |
43 // Update the alignment of the widget and tray views. | 42 // Update the alignment of the widget and tray views. |
44 void SetShelfAlignment(ShelfAlignment alignment); | 43 void SetShelfAlignment(ShelfAlignment alignment); |
45 | 44 |
46 // Called by the client when the login status changes. Caches login_status | 45 // Called by the client when the login status changes. Caches login_status |
47 // and calls UpdateAfterLoginStatusChange for the system tray and the web | 46 // and calls UpdateAfterLoginStatusChange for the system tray and the web |
48 // notification tray. | 47 // notification tray. |
49 void UpdateAfterLoginStatusChange(LoginStatus login_status); | 48 void UpdateAfterLoginStatusChange(LoginStatus login_status); |
50 | 49 |
51 // Based on visibility of |tray| and a tray item on its right, sets |tray|'s | |
52 // separator visibility either to true or false. Note that no leading | |
53 // separator is required before the logout_button_tray because that | |
54 // button's red background is distinctive on its own. | |
55 void OnTrayVisibilityChanged(TrayBackgroundView* tray); | |
56 | |
57 StatusAreaWidgetDelegate* status_area_widget_delegate() { | 50 StatusAreaWidgetDelegate* status_area_widget_delegate() { |
58 return status_area_widget_delegate_; | 51 return status_area_widget_delegate_; |
59 } | 52 } |
60 SystemTray* system_tray() { return system_tray_; } | 53 SystemTray* system_tray() { return system_tray_; } |
61 WebNotificationTray* web_notification_tray() { | 54 WebNotificationTray* web_notification_tray() { |
62 return web_notification_tray_; | 55 return web_notification_tray_; |
63 } | 56 } |
64 OverviewButtonTray* overview_button_tray() { return overview_button_tray_; } | 57 OverviewButtonTray* overview_button_tray() { return overview_button_tray_; } |
65 | 58 |
66 #if defined(OS_CHROMEOS) | 59 #if defined(OS_CHROMEOS) |
(...skipping 26 matching lines...) Expand all Loading... |
93 void UpdateShelfItemBackground(int alpha) override; | 86 void UpdateShelfItemBackground(int alpha) override; |
94 | 87 |
95 private: | 88 private: |
96 void AddSystemTray(); | 89 void AddSystemTray(); |
97 void AddWebNotificationTray(); | 90 void AddWebNotificationTray(); |
98 #if defined(OS_CHROMEOS) | 91 #if defined(OS_CHROMEOS) |
99 void AddLogoutButtonTray(); | 92 void AddLogoutButtonTray(); |
100 void AddPaletteTray(); | 93 void AddPaletteTray(); |
101 void AddVirtualKeyboardTray(); | 94 void AddVirtualKeyboardTray(); |
102 void AddImeMenuTray(); | 95 void AddImeMenuTray(); |
103 | |
104 // Checks if |tray| is the next visible tray to the left of | |
105 // |logout_button_tray_|. Returns true if both are visible, false otherwise. | |
106 bool IsNextVisibleTrayToLogout(TrayBackgroundView* tray) const; | |
107 #endif | 96 #endif |
108 void AddOverviewButtonTray(); | 97 void AddOverviewButtonTray(); |
109 | 98 |
110 // Weak pointers to View classes that are parented to StatusAreaWidget: | 99 // Weak pointers to View classes that are parented to StatusAreaWidget: |
111 StatusAreaWidgetDelegate* status_area_widget_delegate_; | 100 StatusAreaWidgetDelegate* status_area_widget_delegate_; |
112 OverviewButtonTray* overview_button_tray_; | 101 OverviewButtonTray* overview_button_tray_; |
113 SystemTray* system_tray_; | 102 SystemTray* system_tray_; |
114 WebNotificationTray* web_notification_tray_; | 103 WebNotificationTray* web_notification_tray_; |
115 #if defined(OS_CHROMEOS) | 104 #if defined(OS_CHROMEOS) |
116 LogoutButtonTray* logout_button_tray_; | 105 LogoutButtonTray* logout_button_tray_; |
117 PaletteTray* palette_tray_; | 106 PaletteTray* palette_tray_; |
118 VirtualKeyboardTray* virtual_keyboard_tray_; | 107 VirtualKeyboardTray* virtual_keyboard_tray_; |
119 ImeMenuTray* ime_menu_tray_; | 108 ImeMenuTray* ime_menu_tray_; |
120 #endif | 109 #endif |
121 LoginStatus login_status_; | 110 LoginStatus login_status_; |
122 | 111 |
123 WmShelf* wm_shelf_; | 112 WmShelf* wm_shelf_; |
124 | 113 |
125 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); | 114 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); |
126 }; | 115 }; |
127 | 116 |
128 } // namespace ash | 117 } // namespace ash |
129 | 118 |
130 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ | 119 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ |
OLD | NEW |