summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-01 21:10:31 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-01 21:10:31 +0000
commit993e3e4526f5fa205d2ec290c4f931d97826c9ee (patch)
tree2bdc0c25300f93f26504b7c34af695ea0d00fd55 /views
parentb7a763ad855baecbbf22a617164d5b5fd43ae899 (diff)
downloadchromium_src-993e3e4526f5fa205d2ec290c4f931d97826c9ee.zip
chromium_src-993e3e4526f5fa205d2ec290c4f931d97826c9ee.tar.gz
chromium_src-993e3e4526f5fa205d2ec290c4f931d97826c9ee.tar.bz2
Moves WindowGtk::SetBounds implementation to WidgetGtk as WidgetGetk
needs to deal with windows/popups too. BUG=none TEST=none Review URL: http://codereview.chromium.org/118082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17350 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/widget/widget_gtk.cc7
-rw-r--r--views/window/window_gtk.cc13
-rw-r--r--views/window/window_gtk.h1
3 files changed, 8 insertions, 13 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index 876a130..01b6b87 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -231,7 +231,12 @@ void WidgetGtk::SetBounds(const gfx::Rect& bounds) {
parent_widget->PositionChild(widget_, bounds.x(), bounds.y(),
bounds.width(), bounds.height());
} else {
- NOTIMPLEMENTED();
+ GtkWindow* gtk_window = GTK_WINDOW(widget_);
+ // TODO: this may need to set an initial size if not showing.
+ // TODO: need to constrain based on screen size.
+ gtk_window_resize(gtk_window, bounds.width(), bounds.height());
+
+ gtk_window_move(gtk_window, bounds.x(), bounds.y());
}
}
diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc
index 30900df..3979831 100644
--- a/views/window/window_gtk.cc
+++ b/views/window/window_gtk.cc
@@ -41,19 +41,10 @@ gfx::Rect WindowGtk::GetNormalBounds() const {
return GetBounds();
}
-void WindowGtk::SetBounds(const gfx::Rect& bounds) {
- GtkWindow* gtk_window = GetNativeWindow();
- // TODO: this may need to set an initial size if not showing.
- // TODO: need to constrain based on screen size.
- gtk_window_resize(gtk_window, bounds.width(), bounds.height());
-
- gtk_window_move(gtk_window, bounds.x(), bounds.y());
-}
-
void WindowGtk::SetBounds(const gfx::Rect& bounds,
gfx::NativeWindow other_window) {
// TODO: need to deal with other_window.
- SetBounds(bounds);
+ WidgetGtk::SetBounds(bounds);
}
void WindowGtk::Show() {
@@ -242,7 +233,7 @@ void WindowGtk::Init(const gfx::Rect& bounds) {
void WindowGtk::SetInitialBounds(const gfx::Rect& create_bounds) {
gfx::Rect saved_bounds(create_bounds.ToGdkRectangle());
if (window_delegate_->GetSavedWindowBounds(&saved_bounds)) {
- SetBounds(saved_bounds);
+ WidgetGtk::SetBounds(saved_bounds);
} else {
if (create_bounds.IsEmpty()) {
SizeWindowToDefault();
diff --git a/views/window/window_gtk.h b/views/window/window_gtk.h
index 05908f3..80ed1dd 100644
--- a/views/window/window_gtk.h
+++ b/views/window/window_gtk.h
@@ -27,7 +27,6 @@ class WindowGtk : public WidgetGtk, public Window {
// Window overrides:
virtual gfx::Rect GetBounds() const;
virtual gfx::Rect GetNormalBounds() const;
- virtual void SetBounds(const gfx::Rect& bounds);
virtual void SetBounds(const gfx::Rect& bounds,
gfx::NativeWindow other_window);
virtual void Show();