summaryrefslogtreecommitdiffstats
path: root/ui/views
diff options
context:
space:
mode:
authoryoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-23 01:27:49 +0000
committeryoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-23 01:27:49 +0000
commit875c47ffa160c4a014f5f330e212228b1bb7fa0d (patch)
treec76355c54cfe08c6ff72ff209f3dd9f907bb20bd /ui/views
parenta60c0244e1ca2b79ded4ff4e34268ddca938c894 (diff)
downloadchromium_src-875c47ffa160c4a014f5f330e212228b1bb7fa0d.zip
chromium_src-875c47ffa160c4a014f5f330e212228b1bb7fa0d.tar.gz
chromium_src-875c47ffa160c4a014f5f330e212228b1bb7fa0d.tar.bz2
WebUI TaskManager: Add method to set minimum window size on HTMLDialog.
Previously, the saved window size is used as the "minimum" size of window on HTMLDialog (cf. http://crbug.com/115403). This CL make the saved size as default size and adds the GetMinimumDialogSize() method in HTMLDialogUI to set minimum size of window separately. This CL also enables the viwes::Widget::SaveWindowPlacement() on TaskManagerDialog by adding HtmlDialogView::GetWindowName() and HtmlDialogUIDelegate::GetDialogName() virtual functions. And this CL disables to save the window placement on TaskManagerDialog on views, since views::Widget has same feature which is enabled by this CL. BUG=115403 TEST=manual on Windows, Linux with gtk and Linux with chromiumos=1 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=127660 Review URL: http://codereview.chromium.org/9569001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128372 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r--ui/views/widget/widget.cc4
-rw-r--r--ui/views/widget/widget.h3
2 files changed, 7 insertions, 0 deletions
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index 6ffedc3..72a207c 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -452,6 +452,10 @@ void Widget::SetSize(const gfx::Size& size) {
native_widget_->SetSize(size);
}
+void Widget::CenterWindow(const gfx::Size& size) {
+ native_widget_->CenterWindow(size);
+}
+
void Widget::SetBoundsConstrained(const gfx::Rect& bounds) {
gfx::Rect work_area =
gfx::Screen::GetMonitorWorkAreaNearestPoint(bounds.origin());
diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h
index e33bb83..968c038 100644
--- a/ui/views/widget/widget.h
+++ b/ui/views/widget/widget.h
@@ -316,6 +316,9 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
void SetBounds(const gfx::Rect& bounds);
void SetSize(const gfx::Size& size);
+ // Sizes the window to the specified size and centerizes it.
+ void CenterWindow(const gfx::Size& size);
+
// Like SetBounds(), but ensures the Widget is fully visible on screen,
// resizing and/or repositioning as necessary. This is only useful for
// non-child widgets.