Chromium Code Reviews| 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/login_status.h" | 9 #include "ash/common/login_status.h" |
| 10 #include "ash/common/shelf/shelf_types.h" | 10 #include "ash/common/shelf/shelf_types.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "ui/views/widget/widget.h" | 12 #include "ui/views/widget/widget.h" |
| 13 | 13 |
| 14 namespace ash { | 14 namespace ash { |
| 15 class OverviewButtonTray; | 15 class OverviewButtonTray; |
| 16 class ShellDelegate; | 16 class ShellDelegate; |
| 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) | 22 #if defined(OS_CHROMEOS) |
| 23 class ImeMenuTray; | |
| 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 { |
| 28 public: | 29 public: |
| 29 StatusAreaWidget(WmWindow* status_container, WmShelf* wm_shelf); | 30 StatusAreaWidget(WmWindow* status_container, WmShelf* wm_shelf); |
| 30 ~StatusAreaWidget() override; | 31 ~StatusAreaWidget() override; |
| 31 | 32 |
| 32 // Creates the SystemTray, WebNotificationTray and LogoutButtonTray. | 33 // Creates the SystemTray, WebNotificationTray and LogoutButtonTray. |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 49 } | 50 } |
| 50 SystemTray* system_tray() { return system_tray_; } | 51 SystemTray* system_tray() { return system_tray_; } |
| 51 WebNotificationTray* web_notification_tray() { | 52 WebNotificationTray* web_notification_tray() { |
| 52 return web_notification_tray_; | 53 return web_notification_tray_; |
| 53 } | 54 } |
| 54 OverviewButtonTray* overview_button_tray() { return overview_button_tray_; } | 55 OverviewButtonTray* overview_button_tray() { return overview_button_tray_; } |
| 55 WmShelf* wm_shelf() { return wm_shelf_; } | 56 WmShelf* wm_shelf() { return wm_shelf_; } |
| 56 | 57 |
| 57 LoginStatus login_status() const { return login_status_; } | 58 LoginStatus login_status() const { return login_status_; } |
| 58 | 59 |
| 60 #if defined(OS_CHROMEOS) | |
| 61 ImeMenuTray* ime_menu_tray() { return ime_menu_tray_; } | |
|
James Cook
2016/07/12 17:53:37
nit: Because this is only used in tests, rename to
Azure Wei
2016/07/14 02:57:02
Removed this as it has not been used for now. Will
| |
| 62 #endif | |
| 63 | |
| 59 // Returns true if the shelf should be visible. This is used when the | 64 // Returns true if the shelf should be visible. This is used when the |
| 60 // shelf is configured to auto-hide and test if the shelf should force | 65 // shelf is configured to auto-hide and test if the shelf should force |
| 61 // the shelf to remain visible. | 66 // the shelf to remain visible. |
| 62 bool ShouldShowShelf() const; | 67 bool ShouldShowShelf() const; |
| 63 | 68 |
| 64 // True if any message bubble is shown. | 69 // True if any message bubble is shown. |
| 65 bool IsMessageBubbleShown() const; | 70 bool IsMessageBubbleShown() const; |
| 66 | 71 |
| 67 // Notifies child trays, and the |status_area_widget_delegate_| to schedule a | 72 // Notifies child trays, and the |status_area_widget_delegate_| to schedule a |
| 68 // paint. | 73 // paint. |
| 69 void SchedulePaint(); | 74 void SchedulePaint(); |
| 70 | 75 |
| 71 // Overridden from views::Widget: | 76 // Overridden from views::Widget: |
| 72 void OnNativeWidgetActivationChanged(bool active) override; | 77 void OnNativeWidgetActivationChanged(bool active) override; |
| 73 void OnMouseEvent(ui::MouseEvent* event) override; | 78 void OnMouseEvent(ui::MouseEvent* event) override; |
| 74 void OnGestureEvent(ui::GestureEvent* event) override; | 79 void OnGestureEvent(ui::GestureEvent* event) override; |
| 75 | 80 |
| 76 private: | 81 private: |
| 77 void AddSystemTray(); | 82 void AddSystemTray(); |
| 78 void AddWebNotificationTray(); | 83 void AddWebNotificationTray(); |
| 79 #if defined(OS_CHROMEOS) | 84 #if defined(OS_CHROMEOS) |
| 80 void AddLogoutButtonTray(); | 85 void AddLogoutButtonTray(); |
| 81 void AddVirtualKeyboardTray(); | 86 void AddVirtualKeyboardTray(); |
| 87 void AddImeMenuTray(); | |
| 82 #endif | 88 #endif |
| 83 void AddOverviewButtonTray(); | 89 void AddOverviewButtonTray(); |
| 84 | 90 |
| 85 // Weak pointers to View classes that are parented to StatusAreaWidget: | 91 // Weak pointers to View classes that are parented to StatusAreaWidget: |
| 86 StatusAreaWidgetDelegate* status_area_widget_delegate_; | 92 StatusAreaWidgetDelegate* status_area_widget_delegate_; |
| 87 OverviewButtonTray* overview_button_tray_; | 93 OverviewButtonTray* overview_button_tray_; |
| 88 SystemTray* system_tray_; | 94 SystemTray* system_tray_; |
| 89 WebNotificationTray* web_notification_tray_; | 95 WebNotificationTray* web_notification_tray_; |
| 90 #if defined(OS_CHROMEOS) | 96 #if defined(OS_CHROMEOS) |
| 91 LogoutButtonTray* logout_button_tray_; | 97 LogoutButtonTray* logout_button_tray_; |
| 92 VirtualKeyboardTray* virtual_keyboard_tray_; | 98 VirtualKeyboardTray* virtual_keyboard_tray_; |
| 99 ImeMenuTray* ime_menu_tray_; | |
| 93 #endif | 100 #endif |
| 94 LoginStatus login_status_; | 101 LoginStatus login_status_; |
| 95 | 102 |
| 96 WmShelf* wm_shelf_; | 103 WmShelf* wm_shelf_; |
| 97 | 104 |
| 98 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); | 105 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); |
| 99 }; | 106 }; |
| 100 | 107 |
| 101 } // namespace ash | 108 } // namespace ash |
| 102 | 109 |
| 103 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_H_ | 110 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_H_ |
| OLD | NEW |