From 0aac8882b412e2f08b251e706e64ced35e3e6b14 Mon Sep 17 00:00:00 2001 From: "mukai@chromium.org" Date: Wed, 28 Aug 2013 08:08:40 +0000 Subject: Adds AnimateToFullscreen window property for the transition animation to fullscreen. BUG=279455 R=oshima@chromium.org, sky@chromium.org TEST=manually Review URL: https://chromiumcodereview.appspot.com/23453005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219959 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/wm/window_properties.cc | 1 + ash/wm/window_properties.h | 4 ++++ ash/wm/window_util.cc | 4 ++++ ash/wm/window_util.h | 3 +++ ash/wm/workspace/workspace_layout_manager.cc | 13 ++++++++++--- 5 files changed, 22 insertions(+), 3 deletions(-) (limited to 'ash') diff --git a/ash/wm/window_properties.cc b/ash/wm/window_properties.cc index 1db17a8..90157af 100644 --- a/ash/wm/window_properties.cc +++ b/ash/wm/window_properties.cc @@ -14,6 +14,7 @@ DECLARE_WINDOW_PROPERTY_TYPE(ash::internal::RootWindowController*); namespace ash { namespace internal { +DEFINE_WINDOW_PROPERTY_KEY(bool, kAnimateToFullscreenKey, true); DEFINE_WINDOW_PROPERTY_KEY(bool, kContinueDragAfterReparent, false); DEFINE_WINDOW_PROPERTY_KEY(bool, kFullscreenUsesMinimalChromeKey, false); DEFINE_WINDOW_PROPERTY_KEY(bool, kIgnoreSoloWindowFramePainterPolicy, false); diff --git a/ash/wm/window_properties.h b/ash/wm/window_properties.h index d32e368d..86ce39c9 100644 --- a/ash/wm/window_properties.h +++ b/ash/wm/window_properties.h @@ -23,6 +23,10 @@ class RootWindowController; // Alphabetical sort. +// A property key to suppress the cross-fade animation for the transition to +// the fullscreen state. +extern const aura::WindowProperty* const kAnimateToFullscreenKey; + // A property key to indicate that an in progress drag should be continued // after the window is reparented to another container. extern const aura::WindowProperty* const kContinueDragAfterReparent; diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc index 7b8e616..c3101c7 100644 --- a/ash/wm/window_util.cc +++ b/ash/wm/window_util.cc @@ -141,6 +141,10 @@ void SetWindowPositionManaged(aura::Window* window, bool managed) { window->SetProperty(ash::internal::kWindowPositionManagedKey, managed); } +void SetAnimateToFullscreen(aura::Window* window, bool animate) { + window->SetProperty(ash::internal::kAnimateToFullscreenKey, animate); +} + bool HasUserChangedWindowPositionOrSize(const aura::Window* window) { return window->GetProperty( ash::internal::kUserChangedWindowPositionOrSizeKey); diff --git a/ash/wm/window_util.h b/ash/wm/window_util.h index 659d3e1..6822a77 100644 --- a/ash/wm/window_util.h +++ b/ash/wm/window_util.h @@ -91,6 +91,9 @@ ASH_EXPORT bool IsWindowPositionManaged(const aura::Window* window); // Change the |window|'s position manageability to |managed|. ASH_EXPORT void SetWindowPositionManaged(aura::Window* window, bool managed); +// Change the availability of animation to the fullscreen of the |window|. +ASH_EXPORT void SetAnimateToFullscreen(aura::Window* window, bool animate); + // Returns true if the user has changed the |window|'s position or size. ASH_EXPORT bool HasUserChangedWindowPositionOrSize(const aura::Window* window); diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc index 0dd9dbf..9bf7e70 100644 --- a/ash/wm/workspace/workspace_layout_manager.cc +++ b/ash/wm/workspace/workspace_layout_manager.cc @@ -325,11 +325,18 @@ void WorkspaceLayoutManager::UpdateBoundsFromShowState(Window* window) { CrossFadeToBounds(window, ScreenAsh::GetMaximizedWindowBoundsInParent( window->parent()->parent())); break; - case ui::SHOW_STATE_FULLSCREEN: + + case ui::SHOW_STATE_FULLSCREEN: { MoveToDisplayForRestore(window); - SetChildBoundsDirect(window, ScreenAsh::GetDisplayBoundsInParent( - window->parent()->parent())); + gfx::Rect new_bounds = ScreenAsh::GetDisplayBoundsInParent( + window->parent()->parent()); + if (window->GetProperty(kAnimateToFullscreenKey)) + CrossFadeToBounds(window, new_bounds); + else + SetChildBoundsDirect(window, new_bounds); break; + } + default: break; } -- cgit v1.1