Index: chrome/browser/ui/panels/panel_browser_view.cc |
diff --git a/chrome/browser/ui/panels/panel_browser_view.cc b/chrome/browser/ui/panels/panel_browser_view.cc |
index 0a887e2e5106c468c3f6da82f4a9c8dd84b48ee0..0e4b5e730bf6a31337d97e65d4642906040d3e78 100644 |
--- a/chrome/browser/ui/panels/panel_browser_view.cc |
+++ b/chrome/browser/ui/panels/panel_browser_view.cc |
@@ -108,26 +108,7 @@ bool PanelBrowserView::CanMaximize() const { |
} |
void PanelBrowserView::SetBounds(const gfx::Rect& bounds) { |
- if (bounds_ == bounds) |
- return; |
- bounds_ = bounds; |
- |
- // No animation if the panel is being dragged. |
- if (mouse_dragging_state_ == DRAGGING_STARTED) { |
- ::BrowserView::SetBounds(bounds); |
- return; |
- } |
- |
- animation_start_bounds_ = GetBounds(); |
- |
- if (!bounds_animator_.get()) { |
- bounds_animator_.reset(new ui::SlideAnimation(this)); |
- bounds_animator_->SetSlideDuration(kSetBoundsAnimationMs); |
- } |
- |
- if (bounds_animator_->IsShowing()) |
- bounds_animator_->Reset(); |
- bounds_animator_->Show(); |
+ SetPanelBounds(bounds, true); // use animation. |
} |
void PanelBrowserView::UpdateTitleBar() { |
@@ -232,8 +213,27 @@ gfx::Rect PanelBrowserView::GetPanelBounds() const { |
return bounds_; |
} |
-void PanelBrowserView::SetPanelBounds(const gfx::Rect& bounds) { |
- SetBounds(bounds); |
+void PanelBrowserView::SetPanelBounds(const gfx::Rect& bounds, bool animate) { |
+ if (bounds_ == bounds) |
+ return; |
+ bounds_ = bounds; |
+ |
+ // No animation if the panel is being dragged. |
+ if (!animate || mouse_dragging_state_ == DRAGGING_STARTED) { |
+ ::BrowserView::SetBounds(bounds); |
+ return; |
+ } |
+ |
+ animation_start_bounds_ = GetBounds(); |
+ |
+ if (!bounds_animator_.get()) { |
+ bounds_animator_.reset(new ui::SlideAnimation(this)); |
+ bounds_animator_->SetSlideDuration(kSetBoundsAnimationMs); |
+ } |
+ |
+ if (bounds_animator_->IsShowing()) |
+ bounds_animator_->Reset(); |
+ bounds_animator_->Show(); |
} |
void PanelBrowserView::ClosePanel() { |