summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorvarkha@chromium.org <varkha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-02 23:53:43 +0000
committervarkha@chromium.org <varkha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-02 23:53:43 +0000
commit32edb17357e53e22648c4c497c564e4ab21c87bd (patch)
tree4b27aeb759aab935ec6cb9e8fb71a0b9f37ea969 /ash
parentd8b3633ac9edff23f7224616e4d9de6d5a9a34ea (diff)
downloadchromium_src-32edb17357e53e22648c4c497c564e4ab21c87bd.zip
chromium_src-32edb17357e53e22648c4c497c564e4ab21c87bd.tar.gz
chromium_src-32edb17357e53e22648c4c497c564e4ab21c87bd.tar.bz2
Restores maximized browser before dragging a tab.
Allows a tab dragged out of a maximized browser to get properly side-snapped (similar to how docking is allowed). BUG=319205 Review URL: https://codereview.chromium.org/80323002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238236 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/wm/window_animations.cc8
-rw-r--r--ash/wm/window_animations.h5
2 files changed, 8 insertions, 5 deletions
diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc
index 0daa4f3..894e11b 100644
--- a/ash/wm/window_animations.cc
+++ b/ash/wm/window_animations.cc
@@ -325,7 +325,8 @@ base::TimeDelta CrossFadeImpl(aura::Window* window,
const bool old_on_top = (old_bounds.width() > new_bounds.width());
// Shorten the animation if there's not much visual movement.
- const base::TimeDelta duration = GetCrossFadeDuration(old_bounds, new_bounds);
+ const base::TimeDelta duration = GetCrossFadeDuration(window,
+ old_bounds, new_bounds);
// Scale up the old layer while translating to new position.
{
@@ -417,9 +418,10 @@ void CrossFadeToBounds(aura::Window* window, const gfx::Rect& new_bounds) {
CrossFadeImpl(window, old_layer, gfx::Tween::EASE_OUT);
}
-base::TimeDelta GetCrossFadeDuration(const gfx::Rect& old_bounds,
+base::TimeDelta GetCrossFadeDuration(aura::Window* window,
+ const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) {
- if (views::corewm::WindowAnimationsDisabled(NULL))
+ if (views::corewm::WindowAnimationsDisabled(window))
return base::TimeDelta();
int old_area = old_bounds.width() * old_bounds.height();
diff --git a/ash/wm/window_animations.h b/ash/wm/window_animations.h
index 92287a9..f084bcc 100644
--- a/ash/wm/window_animations.h
+++ b/ash/wm/window_animations.h
@@ -45,8 +45,9 @@ ASH_EXPORT void CrossFadeToBounds(aura::Window* window,
const gfx::Rect& new_bounds);
// Returns the duration of the cross-fade animation based on the |old_bounds|
-// and |new_bounds| of the window.
-ASH_EXPORT base::TimeDelta GetCrossFadeDuration(const gfx::Rect& old_bounds,
+// and |new_bounds| of the |window|.
+ASH_EXPORT base::TimeDelta GetCrossFadeDuration(aura::Window* window,
+ const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds);
ASH_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window,