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

Unified Diff: ui/aura/window.cc

Issue 8574049: [Aura] Fix HtmlDialogBrowserTest.SizeWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bad merge Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index d962b434ca6cdde9c7602c91a206dde843f6d83a..54c1cf79dd4d976c5d60ad8df25cad1ffda9bb4d 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -429,21 +429,27 @@ void Window::WindowDetachedFromDesktop(aura::Window* window) {
}
void Window::SetBoundsInternal(const gfx::Rect& new_bounds) {
+ gfx::Rect actual_new_bounds(new_bounds);
+
+ // Gives delegate a change to examine and change the new bounds.
+ if (delegate_)
+ delegate_->OnBoundsChanging(&actual_new_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);
+ layer_->SetBounds(actual_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)
+ if (old_bounds == actual_new_bounds)
return;
if (layout_manager_.get())
layout_manager_->OnWindowResized();
if (delegate_)
- delegate_->OnBoundsChanged(old_bounds, new_bounds);
+ delegate_->OnBoundsChanged(old_bounds, actual_new_bounds);
}
void Window::SetVisible(bool visible) {
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698