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

Unified Diff: views/widget/native_widget_aura.cc

Issue 8574049: [Aura] Fix HtmlDialogBrowserTest.SizeWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix aura bots 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
Index: views/widget/native_widget_aura.cc
diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc
index fe0d3d1755a20e34fe609dc613b41ae44246053d..7a28871baad9cad5b06bf24cb2817975d1fcac2f 100644
--- a/views/widget/native_widget_aura.cc
+++ b/views/widget/native_widget_aura.cc
@@ -133,7 +133,6 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) {
window_->layer()->SetFillsBoundsOpaquely(!params.transparent);
delegate_->OnNativeWidgetCreated();
- window_->set_minimum_size(delegate_->GetMinimumSize());
window_->SetBounds(params.bounds);
if (window_type == Widget::InitParams::TYPE_CONTROL) {
window_->SetParent(params.GetParent());
@@ -281,8 +280,9 @@ void NativeWidgetAura::CenterWindow(const gfx::Size& size) {
void NativeWidgetAura::GetWindowPlacement(
gfx::Rect* bounds,
- ui::WindowShowState* maximized) const {
- *maximized = static_cast<ui::WindowShowState>(
+ ui::WindowShowState* show_state) const {
+ *bounds = window_->GetTargetBounds();
+ *show_state = static_cast<ui::WindowShowState>(
window_->GetIntProperty(aura::kShowStateKey));
}
@@ -527,6 +527,13 @@ void NativeWidgetAura::DispatchKeyEventPostIME(const KeyEvent& key) {
////////////////////////////////////////////////////////////////////////////////
// NativeWidgetAura, aura::WindowDelegate implementation:
+void NativeWidgetAura::OnBoundsChanging(gfx::Rect* new_bounds) {
+ // Enforces a minimum size.
+ const gfx::Size& min_size = delegate_->GetMinimumSize();
+ new_bounds->set_width(std::max(min_size.width(), new_bounds->width()));
+ new_bounds->set_height(std::max(min_size.height(), new_bounds->height()));
+}
+
void NativeWidgetAura::OnBoundsChanged(const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) {
if (old_bounds.origin() != new_bounds.origin())

Powered by Google App Engine
This is Rietveld 408576698