summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-17 19:36:10 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-17 19:36:10 +0000
commit27efc88c2c3150f7b668fa0dcb897fb940090481 (patch)
tree3a5c6ef8db2101031a7f22e465bbc03aae058fbf /views/widget
parent7bf4a8ef5ab46f4fe636fecce9cb0b86e2f5efe7 (diff)
downloadchromium_src-27efc88c2c3150f7b668fa0dcb897fb940090481.zip
chromium_src-27efc88c2c3150f7b668fa0dcb897fb940090481.tar.gz
chromium_src-27efc88c2c3150f7b668fa0dcb897fb940090481.tar.bz2
Minimum size for aura window
Update restore bounds when SetBounds is called in Fullscreen/Maximized mode. EventGenerator to generate fake events for various mouse operatings. BUG=none TEST=added test case for SetBounds in fullscreen/maximized mode. Added ToplevelWindow test that tests various toplevel operations. Review URL: http://codereview.chromium.org/8273040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105882 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/native_widget_aura.cc1
-rw-r--r--views/widget/widget.cc11
-rw-r--r--views/widget/widget.h2
3 files changed, 8 insertions, 6 deletions
diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc
index 18c82cd..19df758 100644
--- a/views/widget/native_widget_aura.cc
+++ b/views/widget/native_widget_aura.cc
@@ -102,6 +102,7 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) {
// TODO(beng): respect |params| authoritah wrt transparency.
window_->layer()->SetFillsBoundsOpaquely(false);
delegate_->OnNativeWidgetCreated();
+ window_->set_minimum_size(delegate_->GetMinimumSize());
window_->SetBounds(params.bounds);
window_->SetParent(
params.type == Widget::InitParams::TYPE_MENU ? NULL : params.parent);
diff --git a/views/widget/widget.cc b/views/widget/widget.cc
index 8baf11c..b837772 100644
--- a/views/widget/widget.cc
+++ b/views/widget/widget.cc
@@ -904,7 +904,7 @@ void Widget::OnNativeWidgetDestroyed() {
}
gfx::Size Widget::GetMinimumSize() {
- return non_client_view_ ? non_client_view_->GetMinimumSize() : gfx::Size();
+ return non_client_view_ ? non_client_view_->GetMinimumSize() : minimum_size_;
}
void Widget::OnNativeWidgetSizeChanged(const gfx::Size& new_size) {
@@ -1160,12 +1160,13 @@ bool Widget::GetSavedWindowPlacement(gfx::Rect* bounds,
if (!widget_delegate_->ShouldRestoreWindowSize()) {
bounds->set_size(non_client_view_->GetPreferredSize());
} else {
+ gfx::Size minimum_size = GetMinimumSize();
// Make sure the bounds are at least the minimum size.
- if (bounds->width() < minimum_size_.width())
- bounds->set_width(minimum_size_.width());
+ if (bounds->width() < minimum_size.width())
+ bounds->set_width(minimum_size.width());
- if (bounds->height() < minimum_size_.height())
- bounds->set_height(minimum_size_.height());
+ if (bounds->height() < minimum_size.height())
+ bounds->set_height(minimum_size.height());
}
return true;
}
diff --git a/views/widget/widget.h b/views/widget/widget.h
index 17413c3..e361c59 100644
--- a/views/widget/widget.h
+++ b/views/widget/widget.h
@@ -709,7 +709,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// |saved_show_state_| is maximized.
gfx::Rect initial_restored_bounds_;
- // The smallest size the window can be.
+ // The smallest size the user can resize the window.
gfx::Size minimum_size_;
// Focus is automatically set to the view provided by the delegate