summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-28 08:08:40 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-28 08:08:40 +0000
commit0aac8882b412e2f08b251e706e64ced35e3e6b14 (patch)
treedc33664ef499dea5a8b8f9b690186677dd8ade43 /ash
parent1fd73bc81495dc2328c2e9df46104d538e7d4401 (diff)
downloadchromium_src-0aac8882b412e2f08b251e706e64ced35e3e6b14.zip
chromium_src-0aac8882b412e2f08b251e706e64ced35e3e6b14.tar.gz
chromium_src-0aac8882b412e2f08b251e706e64ced35e3e6b14.tar.bz2
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
Diffstat (limited to 'ash')
-rw-r--r--ash/wm/window_properties.cc1
-rw-r--r--ash/wm/window_properties.h4
-rw-r--r--ash/wm/window_util.cc4
-rw-r--r--ash/wm/window_util.h3
-rw-r--r--ash/wm/workspace/workspace_layout_manager.cc13
5 files changed, 22 insertions, 3 deletions
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<bool>* 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<bool>* 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;
}