Chromium Code Reviews| Index: chrome/browser/ui/views/fullscreen_exit_bubble_views.h |
| diff --git a/chrome/browser/ui/views/fullscreen_exit_bubble_views.h b/chrome/browser/ui/views/fullscreen_exit_bubble_views.h |
| index e1a8f63686425641eb1309ae7c79d7ce9a95575f..a8e213dac4f41d1bcad80fa3820ff579d8427b33 100644 |
| --- a/chrome/browser/ui/views/fullscreen_exit_bubble_views.h |
| +++ b/chrome/browser/ui/views/fullscreen_exit_bubble_views.h |
| @@ -8,6 +8,11 @@ |
| #include "base/compiler_specific.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble.h" |
| +#include "chrome/browser/ui/views/frame/browser_view.h" |
| +#include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
|
Ben Goodger (Google)
2013/04/18 17:56:01
seems like these two #includes above can be pushed
|
| +#include "content/public/browser/notification_observer.h" |
| +#include "content/public/browser/notification_registrar.h" |
| +#include "ui/views/widget/widget_observer.h" |
| class GURL; |
| namespace ui { |
| @@ -22,10 +27,11 @@ class Widget; |
| // screen in fullscreen mode, telling users how to exit and providing a click |
| // target. The bubble auto-hides, and re-shows when the user moves to the |
| // screen top. |
| -class FullscreenExitBubbleViews : public FullscreenExitBubble { |
| +class FullscreenExitBubbleViews : public FullscreenExitBubble, |
| + public content::NotificationObserver, |
| + public views::WidgetObserver { |
| public: |
| - FullscreenExitBubbleViews(views::Widget* frame, |
| - Browser* browser, |
| + FullscreenExitBubbleViews(BrowserView* browser, |
| const GURL& url, |
| FullscreenExitBubbleType bubble_type); |
| virtual ~FullscreenExitBubbleViews(); |
| @@ -35,7 +41,26 @@ class FullscreenExitBubbleViews : public FullscreenExitBubble { |
| private: |
| class FullscreenExitView; |
| - // FullScreenExitBubble |
| + enum AnimatedAttribute { |
| + ANIMATED_ATTRIBUTE_BOUNDS, |
| + ANIMATED_ATTRIBUTE_OPACITY |
| + }; |
| + |
| + // Starts or stops polling the mouse location based on |popup_| and |
| + // |bubble_type_|. |
| + void UpdateMouseWatcher(); |
| + |
| + // Updates any state which depends on whether the user is in immersive |
| + // fullscreen. |
| + void UpdateForImmersiveState(); |
| + |
| + // Updates |popup|'s bounds given |animation_| and |animated_attribute_|. |
| + void UpdateBounds(); |
| + |
| + // Returns the root view containing |browser_view_|. |
| + views::View* GetBrowserRootView() const; |
| + |
| + // FullScreenExitBubble overrides: |
| virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
| virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; |
| virtual gfx::Rect GetPopupRect(bool ignore_animation_state) const OVERRIDE; |
| @@ -45,20 +70,32 @@ class FullscreenExitBubbleViews : public FullscreenExitBubble { |
| virtual void Hide() OVERRIDE; |
| virtual void Show() OVERRIDE; |
| virtual bool IsAnimating() OVERRIDE; |
| + virtual bool CanMouseTriggerSlideIn() const OVERRIDE; |
| + |
| + // content::NotificationObserver override: |
| + virtual void Observe(int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) OVERRIDE; |
| - void StartWatchingMouseIfNecessary(); |
| + // views::WidgetObserver override: |
| + virtual void OnWidgetVisibilityChanged(views::Widget* widget, |
| + bool visible) OVERRIDE; |
| - // The root view containing us. |
| - views::View* root_view_; |
| + BrowserView* browser_view_; |
| views::Widget* popup_; |
| - // Animation controlling sliding into/out of the top of the screen. |
| - scoped_ptr<ui::SlideAnimation> size_animation_; |
| + // Animation controlling showing/hiding of the exit bubble. |
| + scoped_ptr<ui::SlideAnimation> animation_; |
| + |
| + // Attribute animated by |animation_|. |
| + AnimatedAttribute animated_attribute_; |
| // The contents of the popup. |
| FullscreenExitView* view_; |
| + content::NotificationRegistrar registrar_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(FullscreenExitBubbleViews); |
| }; |