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 WebNotificationTray; | 19 class WebNotificationTray; |
20 class WmShelf; | 20 class WmShelf; |
21 class WmWindow; | 21 class WmWindow; |
22 #if defined(OS_CHROMEOS) | |
23 class ImeMenuTray; | 22 class ImeMenuTray; |
James Cook
2016/12/20 00:02:24
nit: alphabetize
Evan Stade
2016/12/20 18:25:21
Done.
| |
24 class LogoutButtonTray; | 23 class LogoutButtonTray; |
25 class PaletteTray; | 24 class PaletteTray; |
26 class VirtualKeyboardTray; | 25 class VirtualKeyboardTray; |
27 #endif | |
28 | 26 |
29 class ASH_EXPORT StatusAreaWidget : public views::Widget, | 27 class ASH_EXPORT StatusAreaWidget : public views::Widget, |
30 public ShelfBackgroundAnimatorObserver { | 28 public ShelfBackgroundAnimatorObserver { |
31 public: | 29 public: |
32 StatusAreaWidget(WmWindow* status_container, WmShelf* wm_shelf); | 30 StatusAreaWidget(WmWindow* status_container, WmShelf* wm_shelf); |
33 ~StatusAreaWidget() override; | 31 ~StatusAreaWidget() override; |
34 | 32 |
35 // Creates the SystemTray, WebNotificationTray and LogoutButtonTray. | 33 // Creates the SystemTray, WebNotificationTray and LogoutButtonTray. |
36 void CreateTrayViews(); | 34 void CreateTrayViews(); |
37 | 35 |
(...skipping 11 matching lines...) Expand all Loading... | |
49 | 47 |
50 StatusAreaWidgetDelegate* status_area_widget_delegate() { | 48 StatusAreaWidgetDelegate* status_area_widget_delegate() { |
51 return status_area_widget_delegate_; | 49 return status_area_widget_delegate_; |
52 } | 50 } |
53 SystemTray* system_tray() { return system_tray_; } | 51 SystemTray* system_tray() { return system_tray_; } |
54 WebNotificationTray* web_notification_tray() { | 52 WebNotificationTray* web_notification_tray() { |
55 return web_notification_tray_; | 53 return web_notification_tray_; |
56 } | 54 } |
57 OverviewButtonTray* overview_button_tray() { return overview_button_tray_; } | 55 OverviewButtonTray* overview_button_tray() { return overview_button_tray_; } |
58 | 56 |
59 #if defined(OS_CHROMEOS) | |
60 PaletteTray* palette_tray() { return palette_tray_; } | 57 PaletteTray* palette_tray() { return palette_tray_; } |
61 | 58 |
62 ImeMenuTray* ime_menu_tray() { return ime_menu_tray_; } | 59 ImeMenuTray* ime_menu_tray() { return ime_menu_tray_; } |
63 #endif | |
64 | 60 |
65 WmShelf* wm_shelf() { return wm_shelf_; } | 61 WmShelf* wm_shelf() { return wm_shelf_; } |
66 | 62 |
67 LoginStatus login_status() const { return login_status_; } | 63 LoginStatus login_status() const { return login_status_; } |
68 | 64 |
69 // Returns true if the shelf should be visible. This is used when the | 65 // Returns true if the shelf should be visible. This is used when the |
70 // shelf is configured to auto-hide and test if the shelf should force | 66 // shelf is configured to auto-hide and test if the shelf should force |
71 // the shelf to remain visible. | 67 // the shelf to remain visible. |
72 bool ShouldShowShelf() const; | 68 bool ShouldShowShelf() const; |
73 | 69 |
74 // True if any message bubble is shown. | 70 // True if any message bubble is shown. |
75 bool IsMessageBubbleShown() const; | 71 bool IsMessageBubbleShown() const; |
76 | 72 |
77 // Notifies child trays, and the |status_area_widget_delegate_| to schedule a | 73 // Notifies child trays, and the |status_area_widget_delegate_| to schedule a |
78 // paint. | 74 // paint. |
79 void SchedulePaint(); | 75 void SchedulePaint(); |
80 | 76 |
81 // Overridden from views::Widget: | 77 // Overridden from views::Widget: |
82 const ui::NativeTheme* GetNativeTheme() const override; | 78 const ui::NativeTheme* GetNativeTheme() const override; |
83 void OnNativeWidgetActivationChanged(bool active) override; | 79 void OnNativeWidgetActivationChanged(bool active) override; |
84 | 80 |
85 // ShelfBackgroundAnimatorObserver: | 81 // ShelfBackgroundAnimatorObserver: |
86 void UpdateShelfItemBackground(int alpha) override; | 82 void UpdateShelfItemBackground(int alpha) override; |
87 | 83 |
88 private: | 84 private: |
89 void AddSystemTray(); | 85 void AddSystemTray(); |
90 void AddWebNotificationTray(); | 86 void AddWebNotificationTray(); |
91 #if defined(OS_CHROMEOS) | |
92 void AddLogoutButtonTray(); | 87 void AddLogoutButtonTray(); |
93 void AddPaletteTray(); | 88 void AddPaletteTray(); |
94 void AddVirtualKeyboardTray(); | 89 void AddVirtualKeyboardTray(); |
95 void AddImeMenuTray(); | 90 void AddImeMenuTray(); |
96 #endif | |
97 void AddOverviewButtonTray(); | 91 void AddOverviewButtonTray(); |
98 | 92 |
99 // Weak pointers to View classes that are parented to StatusAreaWidget: | 93 // Weak pointers to View classes that are parented to StatusAreaWidget: |
100 StatusAreaWidgetDelegate* status_area_widget_delegate_; | 94 StatusAreaWidgetDelegate* status_area_widget_delegate_; |
101 OverviewButtonTray* overview_button_tray_; | 95 OverviewButtonTray* overview_button_tray_; |
102 SystemTray* system_tray_; | 96 SystemTray* system_tray_; |
103 WebNotificationTray* web_notification_tray_; | 97 WebNotificationTray* web_notification_tray_; |
104 #if defined(OS_CHROMEOS) | |
105 LogoutButtonTray* logout_button_tray_; | 98 LogoutButtonTray* logout_button_tray_; |
106 PaletteTray* palette_tray_; | 99 PaletteTray* palette_tray_; |
107 VirtualKeyboardTray* virtual_keyboard_tray_; | 100 VirtualKeyboardTray* virtual_keyboard_tray_; |
108 ImeMenuTray* ime_menu_tray_; | 101 ImeMenuTray* ime_menu_tray_; |
109 #endif | |
110 LoginStatus login_status_; | 102 LoginStatus login_status_; |
111 | 103 |
112 WmShelf* wm_shelf_; | 104 WmShelf* wm_shelf_; |
113 | 105 |
114 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); | 106 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); |
115 }; | 107 }; |
116 | 108 |
117 } // namespace ash | 109 } // namespace ash |
118 | 110 |
119 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ | 111 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ |
OLD | NEW |