diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-18 00:10:35 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-18 00:10:35 +0000 |
commit | fc2436bac6a8e5f6839f6e62e8680a15e7d592eb (patch) | |
tree | e479f2de51ae5075bdb12b82dbc15e5f0a7893cc /ui/aura/window.cc | |
parent | 35a5b75ccb6e4424a8a8a24556904481d46ebb29 (diff) | |
download | chromium_src-fc2436bac6a8e5f6839f6e62e8680a15e7d592eb.zip chromium_src-fc2436bac6a8e5f6839f6e62e8680a15e7d592eb.tar.gz chromium_src-fc2436bac6a8e5f6839f6e62e8680a15e7d592eb.tar.bz2 |
[Aura] Fix HtmlDialogBrowserTest.SizeWindow.
- Fix HtmlDialogBrowserTest.SizeWindow for Linux + Aura + Chromeos==0.
- Remove minimum_size_ from auralWindow and add an OnBoundsChanging to aura::WindowDelegate so that a delegate can apply bounds constriant;
- NativeWidgetAura uses OnBoundsChanging to apply Widget's minimum size;
- Remove minimum_size_ member from Widget because it is only used for widget with no frame (i.e. no non_client_view_) and such widget should have no minimum size;
BUG=104412
TEST=Verify the HtmlDialogBrowserTest.SizeWindow should pass for Linux + Aura + Chromeos==0.
Review URL: http://codereview.chromium.org/8574049
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110608 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/window.cc')
-rw-r--r-- | ui/aura/window.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ui/aura/window.cc b/ui/aura/window.cc index d962b43..54c1cf7 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) { |