summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-12 23:16:44 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-12 23:16:44 +0000
commitb9a1fb47932a9765fe2bee5bc3962866c976f74c (patch)
treea889e19f1e4225fe0d84901071146b4ea40e3f50 /views
parentae26a9351ca1461c612e35319706e3d2cfcd2485 (diff)
downloadchromium_src-b9a1fb47932a9765fe2bee5bc3962866c976f74c.zip
chromium_src-b9a1fb47932a9765fe2bee5bc3962866c976f74c.tar.gz
chromium_src-b9a1fb47932a9765fe2bee5bc3962866c976f74c.tar.bz2
Pull content from TabContentsViewViews into NativeTabContentsViewWin.
BUG=72040 TEST=none Review URL: http://codereview.chromium.org/6824060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81328 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/widget/native_widget.h1
-rw-r--r--views/widget/widget.cc4
-rw-r--r--views/widget/widget.h1
-rw-r--r--views/widget/widget_gtk.cc19
-rw-r--r--views/widget/widget_gtk.h1
-rw-r--r--views/widget/widget_win.cc5
-rw-r--r--views/widget/widget_win.h1
7 files changed, 32 insertions, 0 deletions
diff --git a/views/widget/native_widget.h b/views/widget/native_widget.h
index fe20388..9ef9070 100644
--- a/views/widget/native_widget.h
+++ b/views/widget/native_widget.h
@@ -115,6 +115,7 @@ class NativeWidget {
virtual gfx::Rect GetWindowScreenBounds() const = 0;
virtual gfx::Rect GetClientAreaScreenBounds() const = 0;
virtual void SetBounds(const gfx::Rect& bounds) = 0;
+ virtual void SetSize(const gfx::Size& size) = 0;
virtual void MoveAbove(gfx::NativeView native_view) = 0;
virtual void SetShape(gfx::NativeRegion shape) = 0;
virtual void Close() = 0;
diff --git a/views/widget/widget.cc b/views/widget/widget.cc
index 4472d93..ae12bce 100644
--- a/views/widget/widget.cc
+++ b/views/widget/widget.cc
@@ -153,6 +153,10 @@ void Widget::SetBounds(const gfx::Rect& bounds) {
native_widget_->SetBounds(bounds);
}
+void Widget::SetSize(const gfx::Size& size) {
+ native_widget_->SetSize(size);
+}
+
void Widget::MoveAboveWidget(Widget* widget) {
native_widget_->MoveAbove(widget->GetNativeView());
}
diff --git a/views/widget/widget.h b/views/widget/widget.h
index c35202a..aac024e 100644
--- a/views/widget/widget.h
+++ b/views/widget/widget.h
@@ -183,6 +183,7 @@ class Widget : public internal::NativeWidgetDelegate,
// Sizes and/or places the widget to the specified bounds, size or position.
void SetBounds(const gfx::Rect& bounds);
+ void SetSize(const gfx::Size& size);
// Places the widget in front of the specified widget in z-order.
void MoveAboveWidget(Widget* widget);
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index d6655da..245ebeb 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -895,6 +895,25 @@ void WidgetGtk::SetBounds(const gfx::Rect& bounds) {
}
}
+void WidgetGtk::SetSize(const gfx::Size& size) {
+ if (type_ == TYPE_CHILD) {
+ GtkWidget* parent = gtk_widget_get_parent(widget_);
+ if (GTK_IS_VIEWS_FIXED(parent)) {
+ gtk_views_fixed_set_widget_size(widget_, size.width(), size.height());
+ } else {
+ DCHECK(GTK_IS_FIXED(parent))
+ << "Parent of WidgetGtk has to be Fixed or ViewsFixed";
+ gtk_widget_set_size_request(widget_, size.width(), size.height());
+ }
+ } else {
+ if (GTK_WIDGET_MAPPED(widget_))
+ gdk_window_resize(widget_->window, size.width(), size.height());
+ GtkWindow* gtk_window = GTK_WINDOW(widget_);
+ if (!size.IsEmpty())
+ gtk_window_resize(gtk_window, size.width(), size.height());
+ }
+}
+
void WidgetGtk::MoveAbove(gfx::NativeView native_view) {
ui::StackPopupWindow(GetNativeView(), native_view);
}
diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h
index 597ec58..396a62d 100644
--- a/views/widget/widget_gtk.h
+++ b/views/widget/widget_gtk.h
@@ -213,6 +213,7 @@ class WidgetGtk : public Widget,
virtual gfx::Rect GetWindowScreenBounds() const OVERRIDE;
virtual gfx::Rect GetClientAreaScreenBounds() const OVERRIDE;
virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
+ virtual void SetSize(const gfx::Size& size) OVERRIDE;
virtual void MoveAbove(gfx::NativeView native_view) OVERRIDE;
virtual void SetShape(gfx::NativeRegion shape) OVERRIDE;
virtual void Close() OVERRIDE;
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc
index d462226..8596ef2 100644
--- a/views/widget/widget_win.cc
+++ b/views/widget/widget_win.cc
@@ -376,6 +376,11 @@ void WidgetWin::SetBounds(const gfx::Rect& bounds) {
SWP_NOACTIVATE | SWP_NOZORDER);
}
+void WidgetWin::SetSize(const gfx::Size& size) {
+ SetWindowPos(NULL, 0, 0, size.width(), size.height(),
+ SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE);
+}
+
void WidgetWin::MoveAbove(gfx::NativeView native_view) {
SetWindowPos(native_view, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h
index 7464afb..778606b 100644
--- a/views/widget/widget_win.h
+++ b/views/widget/widget_win.h
@@ -214,6 +214,7 @@ class WidgetWin : public ui::WindowImpl,
virtual gfx::Rect GetWindowScreenBounds() const OVERRIDE;
virtual gfx::Rect GetClientAreaScreenBounds() const OVERRIDE;
virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
+ virtual void SetSize(const gfx::Size& size) OVERRIDE;
virtual void MoveAbove(gfx::NativeView native_view) OVERRIDE;
virtual void SetShape(gfx::NativeRegion shape) OVERRIDE;
virtual void Close() OVERRIDE;