summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-23 22:53:15 +0000
committerjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-23 22:53:15 +0000
commit096b0317209cfa8ef79cbf9fb9351f00c1f60087 (patch)
tree89ed576ba2a146b33b8c6c5be9897c11a33ae367 /chrome
parent48c3c5f674769d00485a56d65062874387769375 (diff)
downloadchromium_src-096b0317209cfa8ef79cbf9fb9351f00c1f60087.zip
chromium_src-096b0317209cfa8ef79cbf9fb9351f00c1f60087.tar.gz
chromium_src-096b0317209cfa8ef79cbf9fb9351f00c1f60087.tar.bz2
Avoid divide by zero when animating panel bounds.
Partial fix for 110840. BUG=110840 TEST=none Review URL: http://codereview.chromium.org/9117007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/ui/panels/panel_bounds_animation.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/ui/panels/panel_bounds_animation.cc b/chrome/browser/ui/panels/panel_bounds_animation.cc
index cdf5c5a..63739bb 100644
--- a/chrome/browser/ui/panels/panel_bounds_animation.cc
+++ b/chrome/browser/ui/panels/panel_bounds_animation.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -29,7 +29,8 @@ PanelBoundsAnimation::PanelBoundsAnimation(ui::AnimationDelegate* target,
// Initialize animation differently in this case, using fast-pause-slow
// method, see below for more details.
int duration = kSetBoundsAnimationMs;
- if (panel_->expansion_state() == Panel::MINIMIZED) {
+ if (initial_bounds.height() > final_bounds.height() &&
+ panel_->expansion_state() == Panel::MINIMIZED) {
double hidden_title_height =
panel_->TitleOnlyHeight() - final_bounds.height();
double distance_y = initial_bounds.height() - final_bounds.height();