Commit c858acfa authored by pkotwicz@chromium.org's avatar pkotwicz@chromium.org

Animate the fullscreen exit bubble's opacity instead of its bounds when in immersive fullscreen.

BUG=188567
Test=Manual, see instructions below.

1) Run Chrome with --ash-immersive-fullscreen
2) Go to http://html5-demos.appspot.com/static/fullscreen.html
3) Use F11 to toggle immersive fullscreen
4) With the top-of-window views closed, click on the "Toggle Fullscreen" button on the web page.
5) Hover at the top of the screen till the top-of-window views reveal. (Do this before the exit bubble fades out) Check that the exit fullscreen bubble animates with the top-of-window views.
6) Once the exit bubble disappears, check that it cannot be brought back by hovering at the top of the screen.
7) Exit tab fullscreen and browser fullscreen.
8) Enter tab fullscreen again by pressing the "Toggle fullscreen" button on the web page
9) Check that the exit fullscreen bubble slides in and out.
   (Note that when the exit bubble is initially shown it does not animate at all)
10) Go to chrome://settings > Show advanced settings... > Content settings... > Mouse cursor > Manage exceptions...
11) Remove an exception for www.html5rocks.com if there is one
12) Go to www.html5rocks.com/en/tutorials/pointerlock/intro
13) Use F11 to toggle immersive fullscreen
14) With the top-of-window views closed, click on the "Click me!" yellow box on the web page. (in the Interactive Example) section.
15) Hover at the top of the screen till the top-of-window views reveal. Check that the mouse lock bubble animates with the top-of-window views.
16) Click on the "Allow" button in the bubble.
17) Check that the mouse lock bubble fades out (as opposed to sliding out).
18) Press Escape and F11 to exit mouse lock and fullscreen
19) Click on the "Click me!" yellow box again. Check that the bubble slides out.

Review URL: https://chromiumcodereview.appspot.com/13866033

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195281 0039d316-1c4b-4281-b951-d872f2087c98
parent 2862df46
...@@ -60,6 +60,10 @@ void FullscreenExitBubble::StopWatchingMouse() { ...@@ -60,6 +60,10 @@ void FullscreenExitBubble::StopWatchingMouse() {
mouse_position_checker_.Stop(); mouse_position_checker_.Stop();
} }
bool FullscreenExitBubble::IsWatchingMouse() const {
return mouse_position_checker_.IsRunning();
}
void FullscreenExitBubble::CheckMousePosition() { void FullscreenExitBubble::CheckMousePosition() {
// Desired behavior: // Desired behavior:
// //
...@@ -101,10 +105,12 @@ void FullscreenExitBubble::CheckMousePosition() { ...@@ -101,10 +105,12 @@ void FullscreenExitBubble::CheckMousePosition() {
if (!initial_delay_.IsRunning()) { if (!initial_delay_.IsRunning()) {
Hide(); Hide();
} }
} else if ((cursor_pos.y() < kSlideInRegionHeightPx) || } else if (cursor_pos.y() < kSlideInRegionHeightPx &&
IsAnimating()) { CanMouseTriggerSlideIn()) {
// The cursor is not idle, and either it's in the slide-in region or it's in Show();
// the neutral region and we're sliding out. } else if (IsAnimating()) {
// The cursor is not idle and either it's in the slide-in region or it's in
// the neutral region and we're sliding in or out.
Show(); Show();
} }
} }
......
...@@ -56,12 +56,17 @@ class FullscreenExitBubble : public ui::AnimationDelegate { ...@@ -56,12 +56,17 @@ class FullscreenExitBubble : public ui::AnimationDelegate {
virtual bool IsAnimating() = 0; virtual bool IsAnimating() = 0;
// Called repeatedly to get the current mouse position and animate the bubble // True if the mouse position can trigger sliding in the exit fullscreen
// on or off the screen as appropriate. // bubble when the bubble is hidden.
void CheckMousePosition(); virtual bool CanMouseTriggerSlideIn() const = 0;
void StartWatchingMouse(); void StartWatchingMouse();
void StopWatchingMouse(); void StopWatchingMouse();
bool IsWatchingMouse() const;
// Called repeatedly to get the current mouse position and animate the bubble
// on or off the screen as appropriate.
void CheckMousePosition();
void ToggleFullscreen(); void ToggleFullscreen();
// Accepts the request. Can cause FullscreenExitBubble to be deleted. // Accepts the request. Can cause FullscreenExitBubble to be deleted.
......
...@@ -225,6 +225,10 @@ bool FullscreenExitBubbleGtk::IsAnimating() { ...@@ -225,6 +225,10 @@ bool FullscreenExitBubbleGtk::IsAnimating() {
return slide_widget_->IsAnimating(); return slide_widget_->IsAnimating();
} }
bool FullscreenExitBubbleGtk::CanMouseTriggerSlideIn() const {
return true;
}
void FullscreenExitBubbleGtk::StartWatchingMouseIfNecessary() { void FullscreenExitBubbleGtk::StartWatchingMouseIfNecessary() {
if (!fullscreen_bubble::ShowButtonsForType(bubble_type_)) if (!fullscreen_bubble::ShowButtonsForType(bubble_type_))
StartWatchingMouse(); StartWatchingMouse();
......
...@@ -42,6 +42,7 @@ class FullscreenExitBubbleGtk : public FullscreenExitBubble, ...@@ -42,6 +42,7 @@ class FullscreenExitBubbleGtk : public FullscreenExitBubble,
virtual void Hide() OVERRIDE; virtual void Hide() OVERRIDE;
virtual void Show() OVERRIDE; virtual void Show() OVERRIDE;
virtual bool IsAnimating() OVERRIDE; virtual bool IsAnimating() OVERRIDE;
virtual bool CanMouseTriggerSlideIn() const OVERRIDE;
private: private:
void InitWidgets(); void InitWidgets();
......
...@@ -809,7 +809,7 @@ void BrowserView::UpdateFullscreenExitBubbleContent( ...@@ -809,7 +809,7 @@ void BrowserView::UpdateFullscreenExitBubbleContent(
fullscreen_bubble_->UpdateContent(url, bubble_type); fullscreen_bubble_->UpdateContent(url, bubble_type);
} else { } else {
fullscreen_bubble_.reset(new FullscreenExitBubbleViews( fullscreen_bubble_.reset(new FullscreenExitBubbleViews(
GetWidget(), browser_.get(), url, bubble_type)); this, url, bubble_type));
} }
} }
...@@ -2319,7 +2319,7 @@ void BrowserView::ProcessFullscreen(bool fullscreen, ...@@ -2319,7 +2319,7 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
type != FOR_METRO && type != FOR_METRO &&
!UseImmersiveFullscreenForUrl(url)) { !UseImmersiveFullscreenForUrl(url)) {
fullscreen_bubble_.reset(new FullscreenExitBubbleViews( fullscreen_bubble_.reset(new FullscreenExitBubbleViews(
GetWidget(), browser_.get(), url, bubble_type)); this, url, bubble_type));
} }
} else { } else {
#if defined(OS_WIN) && !defined(USE_AURA) #if defined(OS_WIN) && !defined(USE_AURA)
......
...@@ -218,7 +218,7 @@ class BrowserView : public BrowserWindow, ...@@ -218,7 +218,7 @@ class BrowserView : public BrowserWindow,
void FullScreenStateChanged(); void FullScreenStateChanged();
// See ImmersiveModeController for description. // See ImmersiveModeController for description.
ImmersiveModeController* immersive_mode_controller() { ImmersiveModeController* immersive_mode_controller() const {
return immersive_mode_controller_.get(); return immersive_mode_controller_.get();
} }
......
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
#include "base/message_loop.h" #include "base/message_loop.h"
#include "base/utf_string_conversions.h" #include "base/utf_string_conversions.h"
#include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
#include "chrome/browser/ui/views/frame/top_container_view.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/notification_service.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
#include "grit/generated_resources.h" #include "grit/generated_resources.h"
#include "grit/ui_strings.h" #include "grit/ui_strings.h"
...@@ -249,19 +255,20 @@ void FullscreenExitBubbleViews::FullscreenExitView::UpdateContent( ...@@ -249,19 +255,20 @@ void FullscreenExitBubbleViews::FullscreenExitView::UpdateContent(
// FullscreenExitBubbleViews --------------------------------------------------- // FullscreenExitBubbleViews ---------------------------------------------------
FullscreenExitBubbleViews::FullscreenExitBubbleViews( FullscreenExitBubbleViews::FullscreenExitBubbleViews(
views::Widget* frame, BrowserView* browser_view,
Browser* browser,
const GURL& url, const GURL& url,
FullscreenExitBubbleType bubble_type) FullscreenExitBubbleType bubble_type)
: FullscreenExitBubble(browser, url, bubble_type), : FullscreenExitBubble(browser_view->browser(), url, bubble_type),
root_view_(frame->GetRootView()), browser_view_(browser_view),
popup_(NULL), popup_(NULL),
size_animation_(new ui::SlideAnimation(this)) { animation_(new ui::SlideAnimation(this)),
size_animation_->Reset(1); animated_attribute_(ANIMATED_ATTRIBUTE_BOUNDS) {
animation_->Reset(1);
// Create the contents view. // Create the contents view.
ui::Accelerator accelerator(ui::VKEY_UNKNOWN, ui::EF_NONE); ui::Accelerator accelerator(ui::VKEY_UNKNOWN, ui::EF_NONE);
bool got_accelerator = frame->GetAccelerator(IDC_FULLSCREEN, &accelerator); bool got_accelerator = browser_view_->GetWidget()->GetAccelerator(
IDC_FULLSCREEN, &accelerator);
DCHECK(got_accelerator); DCHECK(got_accelerator);
view_ = new FullscreenExitView( view_ = new FullscreenExitView(
this, accelerator.GetShortcutText(), url, bubble_type_); this, accelerator.GetShortcutText(), url, bubble_type_);
...@@ -273,7 +280,7 @@ FullscreenExitBubbleViews::FullscreenExitBubbleViews( ...@@ -273,7 +280,7 @@ FullscreenExitBubbleViews::FullscreenExitBubbleViews(
params.transparent = true; params.transparent = true;
params.can_activate = false; params.can_activate = false;
params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
params.parent = frame->GetNativeView(); params.parent = browser_view_->GetWidget()->GetNativeView();
params.bounds = GetPopupRect(false); params.bounds = GetPopupRect(false);
popup_->Init(params); popup_->Init(params);
gfx::Size size = GetPopupRect(true).size(); gfx::Size size = GetPopupRect(true).size();
...@@ -286,10 +293,25 @@ FullscreenExitBubbleViews::FullscreenExitBubbleViews( ...@@ -286,10 +293,25 @@ FullscreenExitBubbleViews::FullscreenExitBubbleViews(
view_->SetBounds(0, 0, size.width(), size.height()); view_->SetBounds(0, 0, size.width(), size.height());
popup_->Show(); // This does not activate the popup. popup_->Show(); // This does not activate the popup.
StartWatchingMouseIfNecessary(); popup_->AddObserver(this);
registrar_.Add(
this,
chrome::NOTIFICATION_FULLSCREEN_CHANGED,
content::Source<FullscreenController>(
browser_view_->browser()->fullscreen_controller()));
UpdateForImmersiveState();
} }
FullscreenExitBubbleViews::~FullscreenExitBubbleViews() { FullscreenExitBubbleViews::~FullscreenExitBubbleViews() {
popup_->RemoveObserver(this);
ImmersiveModeController* immersive_controller =
browser_view_->immersive_mode_controller();
// |immersive_controller| may already have been destroyed.
if (immersive_controller)
immersive_controller->UnanchorWidgetFromTopContainer(popup_);
// This is tricky. We may be in an ATL message handler stack, in which case // This is tricky. We may be in an ATL message handler stack, in which case
// the popup cannot be deleted yet. We also can't set the popup's ownership // the popup cannot be deleted yet. We also can't set the popup's ownership
// model to NATIVE_WIDGET_OWNS_WIDGET because if the user closed the last tab // model to NATIVE_WIDGET_OWNS_WIDGET because if the user closed the last tab
...@@ -319,12 +341,68 @@ void FullscreenExitBubbleViews::UpdateContent( ...@@ -319,12 +341,68 @@ void FullscreenExitBubbleViews::UpdateContent(
popup_->SetBounds(GetPopupRect(false)); popup_->SetBounds(GetPopupRect(false));
Show(); Show();
// Stop watching the mouse even if UpdateMouseWatcher() will start watching
// it again so that the popup with the new content is visible for at least
// |kInitialDelayMs|.
StopWatchingMouse(); StopWatchingMouse();
StartWatchingMouseIfNecessary();
UpdateMouseWatcher();
} }
void FullscreenExitBubbleViews::AnimationProgressed( void FullscreenExitBubbleViews::UpdateMouseWatcher() {
const ui::Animation* animation) { bool should_watch_mouse = false;
if (popup_->IsVisible())
should_watch_mouse = !fullscreen_bubble::ShowButtonsForType(bubble_type_);
else
should_watch_mouse = CanMouseTriggerSlideIn();
if (should_watch_mouse == IsWatchingMouse())
return;
if (should_watch_mouse)
StartWatchingMouse();
else
StopWatchingMouse();
}
void FullscreenExitBubbleViews::UpdateForImmersiveState() {
ImmersiveModeController* immersive_controller =
browser_view_->immersive_mode_controller();
AnimatedAttribute expected_animated_attribute =
immersive_controller->IsEnabled() ?
ANIMATED_ATTRIBUTE_OPACITY : ANIMATED_ATTRIBUTE_BOUNDS;
if (animated_attribute_ != expected_animated_attribute) {
// If an animation is currently in progress, skip to the end because
// switching the animated attribute midway through the animation looks
// weird.
animation_->End();
animated_attribute_ = expected_animated_attribute;
// We may have finished hiding |popup_|. However, the bounds animation
// assumes |popup_| has the opacity when it is fully shown and the opacity
// animation assumes |popup_| has the bounds when |popup_| is fully shown.
if (animated_attribute_ == ANIMATED_ATTRIBUTE_BOUNDS)
popup_->SetOpacity(255);
else
UpdateBounds();
}
if (immersive_controller->IsEnabled()) {
// In immersive mode, anchor |popup_| to the top container. This repositions
// the top container so that it stays |kPopupTopPx| below the top container
// when the top container animates its position (top container reveals /
// unreveals) or the top container bounds change (eg bookmark bar is shown).
immersive_controller->AnchorWidgetToTopContainer(popup_, kPopupTopPx);
} else {
immersive_controller->UnanchorWidgetFromTopContainer(popup_);
}
UpdateMouseWatcher();
}
void FullscreenExitBubbleViews::UpdateBounds() {
gfx::Rect popup_rect(GetPopupRect(false)); gfx::Rect popup_rect(GetPopupRect(false));
if (popup_rect.IsEmpty()) { if (popup_rect.IsEmpty()) {
popup_->Hide(); popup_->Hide();
...@@ -335,6 +413,25 @@ void FullscreenExitBubbleViews::AnimationProgressed( ...@@ -335,6 +413,25 @@ void FullscreenExitBubbleViews::AnimationProgressed(
} }
} }
views::View* FullscreenExitBubbleViews::GetBrowserRootView() const {
return browser_view_->GetWidget()->GetRootView();
}
void FullscreenExitBubbleViews::AnimationProgressed(
const ui::Animation* animation) {
if (animated_attribute_ == ANIMATED_ATTRIBUTE_OPACITY) {
int opacity = animation_->CurrentValueBetween(0, 255);
if (opacity == 0) {
popup_->Hide();
} else {
popup_->Show();
popup_->SetOpacity(opacity);
}
} else {
UpdateBounds();
}
}
void FullscreenExitBubbleViews::AnimationEnded( void FullscreenExitBubbleViews::AnimationEnded(
const ui::Animation* animation) { const ui::Animation* animation) {
AnimationProgressed(animation); AnimationProgressed(animation);
...@@ -343,56 +440,84 @@ void FullscreenExitBubbleViews::AnimationEnded( ...@@ -343,56 +440,84 @@ void FullscreenExitBubbleViews::AnimationEnded(
gfx::Rect FullscreenExitBubbleViews::GetPopupRect( gfx::Rect FullscreenExitBubbleViews::GetPopupRect(
bool ignore_animation_state) const { bool ignore_animation_state) const {
gfx::Size size(view_->GetPreferredSize()); gfx::Size size(view_->GetPreferredSize());
// NOTE: don't use the bounds of the root_view_. On linux changing window // NOTE: don't use the bounds of the root_view_. On linux GTK changing window
// size is async. Instead we use the size of the screen. // size is async. Instead we use the size of the screen.
gfx::Screen* screen = gfx::Screen* screen =
gfx::Screen::GetScreenFor(root_view_->GetWidget()->GetNativeView()); gfx::Screen::GetScreenFor(browser_view_->GetWidget()->GetNativeView());
gfx::Rect screen_bounds = screen->GetDisplayNearestWindow( gfx::Rect screen_bounds = screen->GetDisplayNearestWindow(
root_view_->GetWidget()->GetNativeView()).bounds(); browser_view_->GetWidget()->GetNativeView()).bounds();
gfx::Point origin(screen_bounds.x() + int x = screen_bounds.x() + (screen_bounds.width() - size.width()) / 2;
(screen_bounds.width() - size.width()) / 2,
kPopupTopPx + screen_bounds.y()); int top_container_bottom = screen_bounds.y();
if (!ignore_animation_state) { if (browser_view_->immersive_mode_controller()->IsEnabled()) {
// Skip querying the top container height in non-immersive fullscreen
// because:
// - The top container height is always zero in non-immersive fullscreen.
// - Querying the top container height may return the height before entering
// fullscreen because layout is disabled while entering fullscreen.
// A visual glitch due to the delayed layout is avoided in immersive
// fullscreen because entering fullscreen starts with the top container
// revealed. When revealed, the top container has the same height as before
// entering fullscreen.
top_container_bottom =
browser_view_->top_container()->GetTargetBoundsInScreen().bottom();
}
int y = top_container_bottom + kPopupTopPx;
if (!ignore_animation_state &&
animated_attribute_ == ANIMATED_ATTRIBUTE_BOUNDS) {
int total_height = size.height() + kPopupTopPx; int total_height = size.height() + kPopupTopPx;
int popup_bottom = size_animation_->CurrentValueBetween( int popup_bottom = animation_->CurrentValueBetween(total_height, 0);
static_cast<double>(total_height), 0.0f);
int y_offset = std::min(popup_bottom, kPopupTopPx); int y_offset = std::min(popup_bottom, kPopupTopPx);
size.set_height(size.height() - popup_bottom + y_offset); size.set_height(size.height() - popup_bottom + y_offset);
origin.set_y(origin.y() - y_offset); y -= y_offset;
} }
return gfx::Rect(origin, size); return gfx::Rect(gfx::Point(x, y), size);
} }
gfx::Point FullscreenExitBubbleViews::GetCursorScreenPoint() { gfx::Point FullscreenExitBubbleViews::GetCursorScreenPoint() {
gfx::Point cursor_pos = gfx::Screen::GetScreenFor( gfx::Point cursor_pos = gfx::Screen::GetScreenFor(
root_view_->GetWidget()->GetNativeView())->GetCursorScreenPoint(); browser_view_->GetWidget()->GetNativeView())->GetCursorScreenPoint();
views::View::ConvertPointToTarget(NULL, root_view_, &cursor_pos); views::View::ConvertPointToTarget(NULL, GetBrowserRootView(), &cursor_pos);
return cursor_pos; return cursor_pos;
} }
bool FullscreenExitBubbleViews::WindowContainsPoint(gfx::Point pos) { bool FullscreenExitBubbleViews::WindowContainsPoint(gfx::Point pos) {
return root_view_->HitTestPoint(pos); return GetBrowserRootView()->HitTestPoint(pos);
} }
bool FullscreenExitBubbleViews::IsWindowActive() { bool FullscreenExitBubbleViews::IsWindowActive() {
return root_view_->GetWidget()->IsActive(); return browser_view_->GetWidget()->IsActive();
} }
void FullscreenExitBubbleViews::Hide() { void FullscreenExitBubbleViews::Hide() {
size_animation_->SetSlideDuration(kSlideOutDurationMs); animation_->SetSlideDuration(kSlideOutDurationMs);
size_animation_->Hide(); animation_->Hide();
} }
void FullscreenExitBubbleViews::Show() { void FullscreenExitBubbleViews::Show() {
size_animation_->SetSlideDuration(kSlideInDurationMs); animation_->SetSlideDuration(kSlideInDurationMs);
size_animation_->Show(); animation_->Show();
} }
bool FullscreenExitBubbleViews::IsAnimating() { bool FullscreenExitBubbleViews::IsAnimating() {
return size_animation_->GetCurrentValue() != 0; return animation_->is_animating();
} }
void FullscreenExitBubbleViews::StartWatchingMouseIfNecessary() { bool FullscreenExitBubbleViews::CanMouseTriggerSlideIn() const {
if (!fullscreen_bubble::ShowButtonsForType(bubble_type_)) return !browser_view_->immersive_mode_controller()->IsEnabled();
StartWatchingMouse(); }
void FullscreenExitBubbleViews::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type);
UpdateForImmersiveState();
}
void FullscreenExitBubbleViews::OnWidgetVisibilityChanged(
views::Widget* widget,
bool visible) {
UpdateMouseWatcher();
} }
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble.h" #include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "ui/views/widget/widget_observer.h"
class BrowserView;
class GURL; class GURL;
namespace ui { namespace ui {
class SlideAnimation; class SlideAnimation;
...@@ -22,10 +26,11 @@ class Widget; ...@@ -22,10 +26,11 @@ class Widget;
// screen in fullscreen mode, telling users how to exit and providing a click // 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 // target. The bubble auto-hides, and re-shows when the user moves to the
// screen top. // screen top.
class FullscreenExitBubbleViews : public FullscreenExitBubble { class FullscreenExitBubbleViews : public FullscreenExitBubble,
public content::NotificationObserver,
public views::WidgetObserver {
public: public:
FullscreenExitBubbleViews(views::Widget* frame, FullscreenExitBubbleViews(BrowserView* browser,
Browser* browser,
const GURL& url, const GURL& url,
FullscreenExitBubbleType bubble_type); FullscreenExitBubbleType bubble_type);
virtual ~FullscreenExitBubbleViews(); virtual ~FullscreenExitBubbleViews();
...@@ -35,7 +40,26 @@ class FullscreenExitBubbleViews : public FullscreenExitBubble { ...@@ -35,7 +40,26 @@ class FullscreenExitBubbleViews : public FullscreenExitBubble {
private: private:
class FullscreenExitView; 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 AnimationProgressed(const ui::Animation* animation) OVERRIDE;
virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
virtual gfx::Rect GetPopupRect(bool ignore_animation_state) const OVERRIDE; virtual gfx::Rect GetPopupRect(bool ignore_animation_state) const OVERRIDE;
...@@ -45,20 +69,32 @@ class FullscreenExitBubbleViews : public FullscreenExitBubble { ...@@ -45,20 +69,32 @@ class FullscreenExitBubbleViews : public FullscreenExitBubble {
virtual void Hide() OVERRIDE; virtual void Hide() OVERRIDE;
virtual void Show() OVERRIDE; virtual void Show() OVERRIDE;
virtual bool IsAnimating() 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. BrowserView* browser_view_;
views::View* root_view_;
views::Widget* popup_; views::Widget* popup_;
// Animation controlling sliding into/out of the top of the screen. // Animation controlling showing/hiding of the exit bubble.
scoped_ptr<ui::SlideAnimation> size_animation_; scoped_ptr<ui::SlideAnimation> animation_;
// Attribute animated by |animation_|.
AnimatedAttribute animated_attribute_;
// The contents of the popup. // The contents of the popup.
FullscreenExitView* view_; FullscreenExitView* view_;
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(FullscreenExitBubbleViews); DISALLOW_COPY_AND_ASSIGN(FullscreenExitBubbleViews);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment