| Index: chrome/browser/ui/fullscreen_exit_bubble.h
|
| diff --git a/chrome/browser/ui/views/fullscreen_exit_bubble.h b/chrome/browser/ui/fullscreen_exit_bubble.h
|
| similarity index 64%
|
| rename from chrome/browser/ui/views/fullscreen_exit_bubble.h
|
| rename to chrome/browser/ui/fullscreen_exit_bubble.h
|
| index facf771b0b469061d668731909867cd7c997aab3..0f2c14c094ad1e9aa38c42c22b3d9a90943ede7c 100644
|
| --- a/chrome/browser/ui/views/fullscreen_exit_bubble.h
|
| +++ b/chrome/browser/ui/fullscreen_exit_bubble.h
|
| @@ -2,47 +2,33 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_UI_VIEWS_FULLSCREEN_EXIT_BUBBLE_H_
|
| -#define CHROME_BROWSER_UI_VIEWS_FULLSCREEN_EXIT_BUBBLE_H_
|
| +#ifndef CHROME_BROWSER_UI_FULLSCREEN_EXIT_BUBBLE_H_
|
| +#define CHROME_BROWSER_UI_FULLSCREEN_EXIT_BUBBLE_H_
|
| #pragma once
|
|
|
| -#include "base/basictypes.h"
|
| -#include "base/compiler_specific.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/timer.h"
|
| #include "chrome/browser/command_updater.h"
|
| #include "ui/base/animation/animation_delegate.h"
|
| #include "ui/gfx/point.h"
|
| -#include "views/controls/link_listener.h"
|
| -
|
| -namespace gfx {
|
| -class Rect;
|
| -}
|
|
|
| namespace ui {
|
| class SlideAnimation;
|
| }
|
|
|
| -namespace views {
|
| -class View;
|
| -class Widget;
|
| +namespace gfx {
|
| +class Rect;
|
| }
|
|
|
| -// FullscreenExitBubble is responsible for showing a bubble atop the 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 FullscreenExitBubble : public views::LinkListener,
|
| - public ui::AnimationDelegate {
|
| +class FullscreenExitBubble : public ui::AnimationDelegate {
|
| public:
|
| explicit FullscreenExitBubble(
|
| - views::Widget* frame,
|
| CommandUpdater::CommandUpdaterDelegate* delegate);
|
| virtual ~FullscreenExitBubble();
|
|
|
| - private:
|
| - class FullscreenExitView;
|
| -
|
| + protected:
|
| static const double kOpacity; // Opacity of the bubble, 0.0 - 1.0
|
| + static const int kPaddingPx; // Amount of padding around the link
|
| static const int kInitialDelayMs; // Initial time bubble remains onscreen
|
| static const int kIdleTimeMs; // Time before mouse idle triggers hide
|
| static const int kPositionCheckHz; // How fast to check the mouse position
|
| @@ -51,40 +37,39 @@ class FullscreenExitBubble : public views::LinkListener,
|
| static const int kSlideInDurationMs; // Duration of slide-in animation
|
| static const int kSlideOutDurationMs; // Duration of slide-out animation
|
|
|
| - // views::LinkListener:
|
| - virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
|
| + // Returns the current desirable rect for the popup window. If
|
| + // |ignore_animation_state| is true this returns the rect assuming the popup
|
| + // is fully onscreen.
|
| + virtual gfx::Rect GetPopupRect(bool ignore_animation_state) const = 0;
|
|
|
| - // ui::AnimationDelegate:
|
| - virtual void AnimationProgressed(const ui::Animation* animation);
|
| - virtual void AnimationEnded(const ui::Animation* animation);
|
| + virtual gfx::Point GetCursorScreenPoint() = 0;
|
|
|
| - // Called repeatedly to get the current mouse position and animate the bubble
|
| - // on or off the screen as appropriate.
|
| - void CheckMousePosition();
|
| + virtual bool WindowContainsPoint(gfx::Point pos) = 0;
|
| +
|
| + // Returns true if the window is active.
|
| + virtual bool IsWindowActive() = 0;
|
|
|
| // Hides the bubble. This is a separate function so it can be called by a
|
| // timer.
|
| - void Hide();
|
| + virtual void Hide() = 0;
|
|
|
| - // Returns the current desirable rect for the popup window. If
|
| - // |ignore_animation_state| is true this returns the rect assuming the popup
|
| - // is fully onscreen.
|
| - gfx::Rect GetPopupRect(bool ignore_animation_state) const;
|
| + // Shows the bubble.
|
| + virtual void Show() = 0;
|
|
|
| - // The root view containing us.
|
| - views::View* root_view_;
|
| + virtual bool IsAnimating() = 0;
|
|
|
| - // Someone who can toggle fullscreen mode on and off when the user requests
|
| - // it.
|
| - CommandUpdater::CommandUpdaterDelegate* delegate_;
|
| + // Called repeatedly to get the current mouse position and animate the bubble
|
| + // on or off the screen as appropriate.
|
| + void CheckMousePosition();
|
|
|
| - views::Widget* popup_;
|
| + void StartWatchingMouse();
|
|
|
| - // The contents of the popup.
|
| - FullscreenExitView* view_;
|
| + void ToggleFullscreen();
|
|
|
| - // Animation controlling sliding into/out of the top of the screen.
|
| - scoped_ptr<ui::SlideAnimation> size_animation_;
|
| + private:
|
| + // Someone who can toggle fullscreen mode on and off when the user requests
|
| + // it.
|
| + CommandUpdater::CommandUpdaterDelegate* delegate_;
|
|
|
| // Timer to delay before allowing the bubble to hide after it's initially
|
| // shown.
|
| @@ -102,8 +87,6 @@ class FullscreenExitBubble : public views::LinkListener,
|
| // The most recently seen mouse position, in screen coordinates. Used to see
|
| // if the mouse has moved since our last check.
|
| gfx::Point last_mouse_pos_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(FullscreenExitBubble);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_UI_VIEWS_FULLSCREEN_EXIT_BUBBLE_H_
|
| +#endif // CHROME_BROWSER_UI_FULLSCREEN_EXIT_BUBBLE_H_
|
|
|