| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
| 10 #include "ash/launcher/background_animator.h" |
| 10 #include "ash/wm/shelf_auto_hide_behavior.h" | 11 #include "ash/wm/shelf_auto_hide_behavior.h" |
| 11 #include "ui/views/widget/widget.h" | 12 #include "ui/views/widget/widget.h" |
| 12 | 13 |
| 13 namespace ash { | 14 namespace ash { |
| 14 | 15 |
| 15 class ShellDelegate; | 16 class ShellDelegate; |
| 16 class SystemTray; | 17 class SystemTray; |
| 17 class SystemTrayDelegate; | 18 class SystemTrayDelegate; |
| 19 class WebNotificationTray; |
| 18 | 20 |
| 19 namespace internal { | 21 namespace internal { |
| 20 | 22 |
| 21 class StatusAreaWidgetDelegate; | 23 class StatusAreaWidgetDelegate; |
| 22 | 24 |
| 23 class ASH_EXPORT StatusAreaWidget : public views::Widget { | 25 class ASH_EXPORT StatusAreaWidget : public views::Widget { |
| 24 public: | 26 public: |
| 27 enum UserAction { |
| 28 NON_USER_ACTION, |
| 29 USER_ACTION |
| 30 }; |
| 31 |
| 25 StatusAreaWidget(); | 32 StatusAreaWidget(); |
| 26 virtual ~StatusAreaWidget(); | 33 virtual ~StatusAreaWidget(); |
| 27 | 34 |
| 28 // Creates the SystemTray. | 35 // Creates the SystemTray and the WebNotificationTray. |
| 29 void CreateTrayViews(ShellDelegate* shell_delegate); | 36 void CreateTrayViews(ShellDelegate* shell_delegate); |
| 30 | 37 |
| 31 // Destroys the system tray. Called before tearing down the windows to avoid | 38 // Destroys the system tray and web notification tray. Called before |
| 32 // shutdown ordering issues. | 39 // tearing down the windows to avoid shutdown ordering issues. |
| 33 void Shutdown(); | 40 void Shutdown(); |
| 34 | 41 |
| 42 // Update the alignment of the widget and tray views. |
| 35 void SetShelfAlignment(ShelfAlignment alignment); | 43 void SetShelfAlignment(ShelfAlignment alignment); |
| 36 | 44 |
| 45 // Update whether to paint a background for each tray view. |
| 46 void SetPaintsBackground( |
| 47 bool value, |
| 48 internal::BackgroundAnimator::ChangeType change_type); |
| 49 |
| 50 // Always used to show/hide the web notification tray. These handle any logic |
| 51 // with hiding/supressing notifications from the system tray. |
| 52 void ShowWebNotificationBubble(UserAction user_action); |
| 53 void HideWebNotificationBubble(); |
| 54 |
| 37 SystemTray* system_tray() { return system_tray_; } | 55 SystemTray* system_tray() { return system_tray_; } |
| 38 SystemTrayDelegate* system_tray_delegate() { | 56 SystemTrayDelegate* system_tray_delegate() { |
| 39 return system_tray_delegate_.get(); | 57 return system_tray_delegate_.get(); |
| 40 } | 58 } |
| 59 WebNotificationTray* web_notification_tray() { |
| 60 return web_notification_tray_; |
| 61 } |
| 41 | 62 |
| 42 private: | 63 private: |
| 43 void AddSystemTray(SystemTray* system_tray, ShellDelegate* shell_delegate); | 64 void AddSystemTray(SystemTray* system_tray, ShellDelegate* shell_delegate); |
| 65 void AddWebNotificationTray(WebNotificationTray* web_notification_tray); |
| 44 | 66 |
| 45 scoped_ptr<SystemTrayDelegate> system_tray_delegate_; | 67 scoped_ptr<SystemTrayDelegate> system_tray_delegate_; |
| 46 // Weak pointers to View classes that are parented to StatusAreaWidget: | 68 // Weak pointers to View classes that are parented to StatusAreaWidget: |
| 47 internal::StatusAreaWidgetDelegate* widget_delegate_; | 69 internal::StatusAreaWidgetDelegate* widget_delegate_; |
| 48 SystemTray* system_tray_; | 70 SystemTray* system_tray_; |
| 71 WebNotificationTray* web_notification_tray_; |
| 49 | 72 |
| 50 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); | 73 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); |
| 51 }; | 74 }; |
| 52 | 75 |
| 53 } // namespace internal | 76 } // namespace internal |
| 54 } // namespace ash | 77 } // namespace ash |
| 55 | 78 |
| 56 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_H_ | 79 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_H_ |
| OLD | NEW |