Chromium Code Reviews| Index: chrome/browser/ui/panels/panel_browser_window_gtk.cc |
| diff --git a/chrome/browser/ui/panels/panel_browser_window_gtk.cc b/chrome/browser/ui/panels/panel_browser_window_gtk.cc |
| index d628e3478ed3d2f3d3b40e9d611410af30ec06a4..bb40924568c9581d8886efba176f108b09b8faef 100644 |
| --- a/chrome/browser/ui/panels/panel_browser_window_gtk.cc |
| +++ b/chrome/browser/ui/panels/panel_browser_window_gtk.cc |
| @@ -149,6 +149,7 @@ void PanelBrowserWindowGtk::OnSizeChanged(int width, int height) { |
| int left = bounds_.right() - width; |
| gtk_window_move(window_, left, top); |
| + |
| StartBoundsAnimation(gfx::Rect(left, top, width, height)); |
| panel_->OnWindowSizeAvailable(); |
| @@ -413,16 +414,20 @@ int PanelBrowserWindowGtk::TitleOnlyHeight() const { |
| void PanelBrowserWindowGtk::StartBoundsAnimation( |
| const gfx::Rect& current_bounds) { |
| - animation_start_bounds_ = current_bounds; |
| + if (bounds_animator_.get() && bounds_animator_->IsShowing()) { |
|
Dmitry Titov
2011/12/08 19:04:45
should it be is_animating()? I think IsShowing() i
prasadt
2011/12/08 21:41:45
Done.
|
| + animation_start_bounds_ = last_animation_progressed_bounds_; |
| + bounds_animator_->Reset(); |
|
Dmitry Titov
2011/12/08 19:04:45
Reset() says it goes back to 0, will it eventually
prasadt
2011/12/08 21:41:45
Done. That line doesn't exist after merging with l
|
| + } else { |
| + animation_start_bounds_ = current_bounds; |
| + } |
| 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(); |
| + last_animation_progressed_bounds_ = animation_start_bounds_; |
| } |
| bool PanelBrowserWindowGtk::IsAnimatingBounds() const { |
| @@ -502,6 +507,8 @@ void PanelBrowserWindowGtk::AnimationProgressed( |
| (animation_start_bounds_.right() != bounds_.right()); |
| if (move) |
| gtk_window_move(window_, new_bounds.x(), new_bounds.y()); |
| + |
| + last_animation_progressed_bounds_ = new_bounds; |
| } |
| void PanelBrowserWindowGtk::CreateDragWidget() { |