Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Side by Side Diff: chrome/browser/ui/panels/panel_browser_window_gtk.cc

Issue 8775022: Add Panel::SetPanelBoundsInstantly for all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/panels/panel_browser_window_gtk.h" 5 #include "chrome/browser/ui/panels/panel_browser_window_gtk.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/ui/browser_list.h" 8 #include "chrome/browser/ui/browser_list.h"
9 #include "chrome/browser/ui/panels/panel.h" 9 #include "chrome/browser/ui/panels/panel.h"
10 #include "chrome/browser/ui/panels/panel_manager.h" 10 #include "chrome/browser/ui/panels/panel_manager.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } 237 }
238 238
239 void PanelBrowserWindowGtk::ShowPanelInactive() { 239 void PanelBrowserWindowGtk::ShowPanelInactive() {
240 ShowInactive(); 240 ShowInactive();
241 } 241 }
242 242
243 gfx::Rect PanelBrowserWindowGtk::GetPanelBounds() const { 243 gfx::Rect PanelBrowserWindowGtk::GetPanelBounds() const {
244 return bounds_; 244 return bounds_;
245 } 245 }
246 246
247 void PanelBrowserWindowGtk::SetPanelBounds(const gfx::Rect& bounds) { 247 void PanelBrowserWindowGtk::SetPanelBounds(const gfx::Rect& bounds,
248 bool animate) {
248 if (bounds == bounds_) 249 if (bounds == bounds_)
249 return; 250 return;
250 251
251 if (drag_widget_) { 252 if (drag_widget_ || !animate) {
252 DCHECK(!bounds_animator_.get() || !bounds_animator_->is_animating()); 253 DCHECK(!bounds_animator_.get() || !bounds_animator_->is_animating());
253 // If the current panel is being dragged, it should just move with the 254 // If the current panel is being dragged, it should just move with the
254 // user drag, we should not animate. 255 // user drag, we should not animate.
255 gtk_window_move(window(), bounds.x(), bounds.y()); 256 gtk_window_move(window(), bounds.x(), bounds.y());
256 } else if (window_size_known_) { 257 } else if (window_size_known_) {
257 StartBoundsAnimation(bounds_); 258 StartBoundsAnimation(bounds_);
258 } 259 }
259 // If window size is not known, wait till the size is known before starting 260 // If window size is not known, wait till the size is known before starting
260 // the animation. 261 // the animation.
261 262
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 } 736 }
736 } 737 }
737 738
738 bool NativePanelTestingGtk::IsWindowSizeKnown() const { 739 bool NativePanelTestingGtk::IsWindowSizeKnown() const {
739 return panel_browser_window_gtk_->window_size_known_; 740 return panel_browser_window_gtk_->window_size_known_;
740 } 741 }
741 742
742 bool NativePanelTestingGtk::IsAnimatingBounds() const { 743 bool NativePanelTestingGtk::IsAnimatingBounds() const {
743 return panel_browser_window_gtk_->IsAnimatingBounds(); 744 return panel_browser_window_gtk_->IsAnimatingBounds();
744 } 745 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698