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 cea18f834ac1f2b6a0a2399d6222388bf4ecc6f9..335ae29e925f301a0b1fd8007471e589ea19046e 100644 |
--- a/chrome/browser/ui/panels/panel_browser_view.cc |
+++ b/chrome/browser/ui/panels/panel_browser_view.cc |
@@ -108,12 +108,17 @@ bool PanelBrowserView::CanMaximize() const { |
} |
void PanelBrowserView::SetBounds(const gfx::Rect& bounds) { |
+ SetBoundsInternal(bounds, true); |
+} |
+ |
+void PanelBrowserView::SetBoundsInternal(const gfx::Rect& bounds, |
+ bool animate) { |
if (bounds_ == bounds) |
return; |
bounds_ = bounds; |
// No animation if the panel is being dragged. |
- if (mouse_dragging_state_ == DRAGGING_STARTED) { |
+ if (!animate || mouse_dragging_state_ == DRAGGING_STARTED) { |
::BrowserView::SetBounds(bounds); |
return; |
} |
@@ -233,7 +238,11 @@ gfx::Rect PanelBrowserView::GetPanelBounds() const { |
} |
void PanelBrowserView::SetPanelBounds(const gfx::Rect& bounds) { |
- SetBounds(bounds); |
+ SetBoundsInternal(bounds, true); |
+} |
+ |
+void PanelBrowserView::SetPanelBoundsInstantly(const gfx::Rect& bounds) { |
+ SetBoundsInternal(bounds, false); |
} |
void PanelBrowserView::ClosePanel() { |