Chromium Code Reviews| Index: ash/system/tray/system_tray_bubble.h |
| diff --git a/ash/system/tray/system_tray_bubble.h b/ash/system/tray/system_tray_bubble.h |
| index fbb2bc0eca3903c06970729faca7f2680cea219b..d21978d105ec721d00059361cdc7f1a3526283d6 100644 |
| --- a/ash/system/tray/system_tray_bubble.h |
| +++ b/ash/system/tray/system_tray_bubble.h |
| @@ -6,12 +6,12 @@ |
| #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ |
| #pragma once |
| +#include "ash/system/tray/system_tray_bubble_view.h" |
| #include "ash/system/user/login_status.h" |
| #include "ash/wm/shelf_auto_hide_behavior.h" |
| #include "base/base_export.h" |
| #include "base/timer.h" |
| #include "ui/aura/event_filter.h" |
| -#include "ui/views/bubble/bubble_delegate.h" |
| #include "ui/views/widget/widget.h" |
| #include <vector> |
| @@ -27,52 +27,9 @@ class SystemTrayItem; |
| namespace internal { |
| -class SystemTrayBubble; |
| - |
| -class SystemTrayBubbleView : public views::BubbleDelegateView { |
| - public: |
| - SystemTrayBubbleView(views::View* anchor, |
| - views::BubbleBorder::ArrowLocation arrow_location, |
| - SystemTrayBubble* host, |
| - bool can_activate); |
| - virtual ~SystemTrayBubbleView(); |
| - |
| - void SetBubbleBorder(views::BubbleBorder* border); |
| - |
| - void UpdateAnchor(); |
| - |
| - // Called when the host is destroyed. |
| - void reset_host() { host_ = NULL; } |
| - |
| - private: |
| - friend class SystemTrayBubble; |
| - |
| - // Overridden from views::BubbleDelegateView. |
| - virtual void Init() OVERRIDE; |
| - virtual gfx::Rect GetAnchorRect() OVERRIDE; |
| - virtual bool CanActivate() const OVERRIDE; |
| - |
| - // Overridden from views::View. |
| - virtual gfx::Size GetPreferredSize() OVERRIDE; |
| - virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; |
| - virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; |
| - virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
| - virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; |
| - virtual void ViewHierarchyChanged(bool is_add, |
| - views::View* parent, |
| - views::View* child) OVERRIDE; |
| - |
| - void set_max_height(int height) { max_height_ = height; } |
| - |
| - SystemTrayBubble* host_; |
| - bool can_activate_; |
| - int max_height_; |
| - |
| - DISALLOW_COPY_AND_ASSIGN(SystemTrayBubbleView); |
| -}; |
| - |
| class SystemTrayBubble : public aura::EventFilter, |
| - public views::Widget::Observer { |
| + public views::Widget::Observer, |
| + public SystemTrayBubbleView::Host { |
| public: |
| enum BubbleType { |
| BUBBLE_TYPE_DEFAULT, |
| @@ -109,7 +66,11 @@ class SystemTrayBubble : public aura::EventFilter, |
| // Also creates |bubble_widget_| and sets up animations. |
| void InitView(const InitParams& init_params); |
| - gfx::Rect GetAnchorRect() const; |
| + // Overridden from SystemTrayBubbleView::Host. |
| + virtual void BubbleViewDestroyed() OVERRIDE; |
| + virtual gfx::Rect GetAnchorRect() const OVERRIDE; |
| + virtual void OnMouseEnteredView() OVERRIDE; |
| + virtual void OnMoiseExitedView() OVERRIDE; |
|
jennyz
2012/06/06 21:04:38
Typo: OnMoiseExitedView->OnMouseExitedView
stevenjb
2012/06/06 23:12:15
Yikes! Nice catch, thanks!
|
| BubbleType bubble_type() const { return bubble_type_; } |
| SystemTrayBubbleView* bubble_view() const { return bubble_view_; } |
| @@ -119,6 +80,8 @@ class SystemTrayBubble : public aura::EventFilter, |
| void StopAutoCloseTimer(); |
| void RestartAutoCloseTimer(); |
| void Close(); |
| + void SetVisible(bool is_visible); |
| + bool IsVisible() { return bubble_widget_ && bubble_widget_->IsVisible(); } |
|
jennyz
2012/06/06 21:04:38
Should this be moved to system_tray_bubble.cc file
stevenjb
2012/06/06 23:12:15
Done.
|
| private: |
| void CreateItemViews(user::LoginStatus login_status); |