}
namespace ash {
-namespace internal {
class StatusAreaWidget;
class WebNotificationBubbleWrapper;
class WebNotificationButton;
-class WorkAreaObserver;
-}
+class AshPopupAlignmentDelegate;
class ASH_EXPORT WebNotificationTray
- : public internal::TrayBackgroundView,
+ : public TrayBackgroundView,
public views::TrayBubbleView::Delegate,
public message_center::MessageCenterTrayDelegate,
public views::ButtonListener,
public base::SupportsWeakPtr<WebNotificationTray>,
public ui::SimpleMenuModel::Delegate {
public:
- explicit WebNotificationTray(
- internal::StatusAreaWidget* status_area_widget);
- virtual ~WebNotificationTray();
+ explicit WebNotificationTray(StatusAreaWidget* status_area_widget);
+ ~WebNotificationTray() override;
// Sets the height of the system tray from the edge of the work area so that
// the notification popups don't overlap with the tray. Passes 0 if no UI is
// shown in the system tray side.
void SetSystemTrayHeight(int height);
- // Returns true if it should block the auto hide behavior of the launcher.
- bool ShouldBlockLauncherAutoHide() const;
+ // Returns true if it should block the auto hide behavior of the shelf.
+ bool ShouldBlockShelfAutoHide() const;
// Returns true if the message center bubble is visible.
bool IsMessageCenterBubbleVisible() const;
// Shows the message center bubble.
void ShowMessageCenterBubble();
+ // Called when the login status is changed.
+ void UpdateAfterLoginStatusChange(user::LoginStatus login_status);
+
// Overridden from TrayBackgroundView.
- virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE;
- virtual void AnchorUpdated() OVERRIDE;
- virtual base::string16 GetAccessibleNameForTray() OVERRIDE;
- virtual void HideBubbleWithView(
- const views::TrayBubbleView* bubble_view) OVERRIDE;
- virtual bool ClickedOutsideBubble() OVERRIDE;
+ void SetShelfAlignment(ShelfAlignment alignment) override;
+ void AnchorUpdated() override;
+ base::string16 GetAccessibleNameForTray() override;
+ void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override;
+ bool ClickedOutsideBubble() override;
- // Overridden from internal::ActionableView.
- virtual bool PerformAction(const ui::Event& event) OVERRIDE;
+ // Overridden from ActionableView.
+ bool PerformAction(const ui::Event& event) override;
// Overridden from views::TrayBubbleView::Delegate.
- virtual void BubbleViewDestroyed() OVERRIDE;
- virtual void OnMouseEnteredView() OVERRIDE;
- virtual void OnMouseExitedView() OVERRIDE;
- virtual base::string16 GetAccessibleNameForBubble() OVERRIDE;
- virtual gfx::Rect GetAnchorRect(views::Widget* anchor_widget,
- AnchorType anchor_type,
- AnchorAlignment anchor_alignment) OVERRIDE;
- virtual void HideBubble(const views::TrayBubbleView* bubble_view) OVERRIDE;
+ void BubbleViewDestroyed() override;
+ void OnMouseEnteredView() override;
+ void OnMouseExitedView() override;
+ base::string16 GetAccessibleNameForBubble() override;
+ gfx::Rect GetAnchorRect(views::Widget* anchor_widget,
+ AnchorType anchor_type,
+ AnchorAlignment anchor_alignment) const override;
+ void HideBubble(const views::TrayBubbleView* bubble_view) override;
// Overridden from ButtonListener.
- virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override;
// Overridden from MessageCenterTrayDelegate.
- virtual void OnMessageCenterTrayChanged() OVERRIDE;
- virtual bool ShowMessageCenter() OVERRIDE;
- virtual void HideMessageCenter() OVERRIDE;
- virtual bool ShowPopups() OVERRIDE;
- virtual void HidePopups() OVERRIDE;
- virtual bool ShowNotifierSettings() OVERRIDE;
- virtual message_center::MessageCenterTray* GetMessageCenterTray() OVERRIDE;
+ void OnMessageCenterTrayChanged() override;
+ bool ShowMessageCenter() override;
+ void HideMessageCenter() override;
+ bool ShowPopups() override;
+ void HidePopups() override;
+ bool ShowNotifierSettings() override;
+ bool IsContextMenuEnabled() const override;
+ message_center::MessageCenterTray* GetMessageCenterTray() override;
// Overridden from SimpleMenuModel::Delegate.
- virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
- virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
- virtual bool GetAcceleratorForCommandId(
- int command_id,
- ui::Accelerator* accelerator) OVERRIDE;
- virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
+ bool IsCommandIdChecked(int command_id) const override;
+ bool IsCommandIdEnabled(int command_id) const override;
+ bool GetAcceleratorForCommandId(int command_id,
+ ui::Accelerator* accelerator) override;
+ void ExecuteCommand(int command_id, int event_flags) override;
message_center::MessageCenter* message_center() const;
// Creates the menu model for quiet mode and returns it.
ui::MenuModel* CreateQuietModeMenu();
- internal::WebNotificationBubbleWrapper* message_center_bubble() const {
+ WebNotificationBubbleWrapper* message_center_bubble() const {
return message_center_bubble_.get();
}
message_center::MessageCenterBubble* GetMessageCenterBubbleForTest();
scoped_ptr<message_center::MessageCenterTray> message_center_tray_;
- scoped_ptr<internal::WebNotificationBubbleWrapper> message_center_bubble_;
+ scoped_ptr<WebNotificationBubbleWrapper> message_center_bubble_;
scoped_ptr<message_center::MessagePopupCollection> popup_collection_;
- internal::WebNotificationButton* button_;
+ WebNotificationButton* button_;
bool show_message_center_on_unlock_;
// flickers of the shelf from hidden to shown. See: crbug.com/181213
bool should_block_shelf_auto_hide_;
- // Observes the work area for |popup_collection_| and notifies to it.
- scoped_ptr<internal::WorkAreaObserver> work_area_observer_;
+ scoped_ptr<AshPopupAlignmentDelegate> popup_alignment_delegate_;
DISALLOW_COPY_AND_ASSIGN(WebNotificationTray);
};