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

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 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 | « views/widget/native_widget_aura.h ('k') | views/widget/widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/native_widget_aura.cc
diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc
index f7b4c734a0732ec9ea0ce2f8ba5ad90bb4aade55..cc2c183a13ac517378d4026ce245a965901d6884 100644
--- a/views/widget/native_widget_aura.cc
+++ b/views/widget/native_widget_aura.cc
@@ -137,7 +137,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());
@@ -292,8 +291,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));
}
@@ -543,6 +543,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())
« no previous file with comments | « views/widget/native_widget_aura.h ('k') | views/widget/widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698