diff options
author | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-10 15:35:20 +0000 |
---|---|---|
committer | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-10 15:35:20 +0000 |
commit | e9a5c3cde0134e97b74cec43ddbed0107453ed76 (patch) | |
tree | c6d405a2d9fe2de063655ce33853aa2ac853cdaf /ui/aura/window.cc | |
parent | 531e034c4256147c7edd37f5404eaaeb8fe3b0cd (diff) | |
download | chromium_src-e9a5c3cde0134e97b74cec43ddbed0107453ed76.zip chromium_src-e9a5c3cde0134e97b74cec43ddbed0107453ed76.tar.gz chromium_src-e9a5c3cde0134e97b74cec43ddbed0107453ed76.tar.bz2 |
Check target bounds, not current bounds, in aura::Window::SetBoundsInternal
BUG=102413
TEST=None
Review URL: http://codereview.chromium.org/8503002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109433 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/window.cc')
-rw-r--r-- | ui/aura/window.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ui/aura/window.cc b/ui/aura/window.cc index 89ea1fe..2e9806e 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc @@ -423,11 +423,17 @@ Desktop* Window::GetDesktop() { } void Window::SetBoundsInternal(const gfx::Rect& new_bounds) { - const gfx::Rect old_bounds = bounds(); + const gfx::Rect old_bounds = layer_->GetTargetBounds(); + + // Always need to set the layer's bounds -- even if it is to the same thing. + // This may cause important side effects such as stopping animation. + layer_->SetBounds(new_bounds); + + // If we're not changing the effective bounds, then we can bail early and skip + // notifying our listeners. if (old_bounds == new_bounds) return; - layer_->SetBounds(new_bounds); if (layout_manager_.get()) layout_manager_->OnWindowResized(); if (delegate_) @@ -495,7 +501,8 @@ Window* Window::GetWindowForPoint(const gfx::Point& local_point, } void Window::OnPaintLayer(gfx::Canvas* canvas) { - delegate_->OnPaint(canvas); + if (delegate_) + delegate_->OnPaint(canvas); } } // namespace aura |