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_STATUS_AREA_WIDGET_H_ | 5 #ifndef ASH_SYSTEM_STATUS_AREA_WIDGET_H_ |
6 #define ASH_SYSTEM_STATUS_AREA_WIDGET_H_ | 6 #define ASH_SYSTEM_STATUS_AREA_WIDGET_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/common/shelf/shelf_background_animator_observer.h" |
9 #include "ash/common/shelf/shelf_types.h" | 10 #include "ash/common/shelf/shelf_types.h" |
10 #include "ash/system/user/login_status.h" | 11 #include "ash/system/user/login_status.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
13 | 14 |
14 namespace ash { | 15 namespace ash { |
15 class OverviewButtonTray; | 16 class OverviewButtonTray; |
16 class ShelfWidget; | 17 class ShelfWidget; |
17 class ShellDelegate; | 18 class ShellDelegate; |
18 class StatusAreaWidgetDelegate; | 19 class StatusAreaWidgetDelegate; |
19 class SystemTray; | 20 class SystemTray; |
20 class WebNotificationTray; | 21 class WebNotificationTray; |
21 class WmWindow; | 22 class WmWindow; |
22 #if defined(OS_CHROMEOS) | 23 #if defined(OS_CHROMEOS) |
23 class LogoutButtonTray; | 24 class LogoutButtonTray; |
24 class VirtualKeyboardTray; | 25 class VirtualKeyboardTray; |
25 #endif | 26 #endif |
26 | 27 |
27 class ASH_EXPORT StatusAreaWidget : public views::Widget { | 28 class ASH_EXPORT StatusAreaWidget : public views::Widget, |
| 29 public ShelfBackgroundAnimatorObserver { |
28 public: | 30 public: |
29 StatusAreaWidget(WmWindow* status_container, ShelfWidget* shelf_widget); | 31 StatusAreaWidget(WmWindow* status_container, ShelfWidget* shelf_widget); |
30 ~StatusAreaWidget() override; | 32 ~StatusAreaWidget() override; |
31 | 33 |
32 // Creates the SystemTray, WebNotificationTray and LogoutButtonTray. | 34 // Creates the SystemTray, WebNotificationTray and LogoutButtonTray. |
33 void CreateTrayViews(); | 35 void CreateTrayViews(); |
34 | 36 |
35 // Destroys the system tray and web notification tray. Called before | 37 // Destroys the system tray and web notification tray. Called before |
36 // tearing down the windows to avoid shutdown ordering issues. | 38 // tearing down the windows to avoid shutdown ordering issues. |
37 void Shutdown(); | 39 void Shutdown(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 73 |
72 // Notifies child trays, and the |status_area_widget_delegate_| to schedule a | 74 // Notifies child trays, and the |status_area_widget_delegate_| to schedule a |
73 // paint. | 75 // paint. |
74 void SchedulePaint(); | 76 void SchedulePaint(); |
75 | 77 |
76 // Overridden from views::Widget: | 78 // Overridden from views::Widget: |
77 void OnNativeWidgetActivationChanged(bool active) override; | 79 void OnNativeWidgetActivationChanged(bool active) override; |
78 void OnMouseEvent(ui::MouseEvent* event) override; | 80 void OnMouseEvent(ui::MouseEvent* event) override; |
79 void OnGestureEvent(ui::GestureEvent* event) override; | 81 void OnGestureEvent(ui::GestureEvent* event) override; |
80 | 82 |
| 83 // ShelfBackgroundAnimatorObserver: |
| 84 void UpdateShelfItemBackground(int alpha) override; |
| 85 |
81 private: | 86 private: |
82 void AddSystemTray(); | 87 void AddSystemTray(); |
83 void AddWebNotificationTray(); | 88 void AddWebNotificationTray(); |
84 #if defined(OS_CHROMEOS) | 89 #if defined(OS_CHROMEOS) |
85 void AddLogoutButtonTray(); | 90 void AddLogoutButtonTray(); |
86 void AddVirtualKeyboardTray(); | 91 void AddVirtualKeyboardTray(); |
87 #endif | 92 #endif |
88 void AddOverviewButtonTray(); | 93 void AddOverviewButtonTray(); |
89 | 94 |
90 // Weak pointers to View classes that are parented to StatusAreaWidget: | 95 // Weak pointers to View classes that are parented to StatusAreaWidget: |
91 StatusAreaWidgetDelegate* status_area_widget_delegate_; | 96 StatusAreaWidgetDelegate* status_area_widget_delegate_; |
92 OverviewButtonTray* overview_button_tray_; | 97 OverviewButtonTray* overview_button_tray_; |
93 SystemTray* system_tray_; | 98 SystemTray* system_tray_; |
94 WebNotificationTray* web_notification_tray_; | 99 WebNotificationTray* web_notification_tray_; |
95 #if defined(OS_CHROMEOS) | 100 #if defined(OS_CHROMEOS) |
96 LogoutButtonTray* logout_button_tray_; | 101 LogoutButtonTray* logout_button_tray_; |
97 VirtualKeyboardTray* virtual_keyboard_tray_; | 102 VirtualKeyboardTray* virtual_keyboard_tray_; |
98 #endif | 103 #endif |
99 LoginStatus login_status_; | 104 LoginStatus login_status_; |
100 | 105 |
101 ShelfWidget* shelf_widget_; | 106 ShelfWidget* shelf_widget_; |
102 | 107 |
103 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); | 108 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); |
104 }; | 109 }; |
105 | 110 |
106 } // namespace ash | 111 } // namespace ash |
107 | 112 |
108 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_H_ | 113 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_H_ |
OLD | NEW |