summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/views/browser_bubble_gtk.cc8
-rw-r--r--chrome/browser/views/extensions/extension_view.cc10
-rw-r--r--views/widget/widget_gtk.cc5
3 files changed, 13 insertions, 10 deletions
diff --git a/chrome/browser/views/browser_bubble_gtk.cc b/chrome/browser/views/browser_bubble_gtk.cc
index 43a6af3..ef09ef4 100644
--- a/chrome/browser/views/browser_bubble_gtk.cc
+++ b/chrome/browser/views/browser_bubble_gtk.cc
@@ -10,19 +10,13 @@
void BrowserBubble::InitPopup() {
gfx::NativeView native_view = frame_->GetNativeView();
- gfx::NativeWindow native_window = frame_->GetWindow()->GetNativeWindow();
views::WidgetGtk* pop = new views::WidgetGtk(views::WidgetGtk::TYPE_POPUP);
pop->SetOpacity(0xFF);
pop->Init(native_view, bounds_);
pop->SetContentsView(view_);
popup_ = pop;
Reposition();
-
- BrowserView* browser_view =
- BrowserView::GetBrowserViewForNativeWindow(native_window);
- DCHECK(browser_view);
- if (browser_view)
- browser_view->AttachBrowserBubble(this);
+ AttachToBrowser();
}
void BrowserBubble::MovePopup(int x, int y, int w, int h) {
diff --git a/chrome/browser/views/extensions/extension_view.cc b/chrome/browser/views/extensions/extension_view.cc
index 059d391..c0118ba 100644
--- a/chrome/browser/views/extensions/extension_view.cc
+++ b/chrome/browser/views/extensions/extension_view.cc
@@ -7,10 +7,13 @@
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
+#include "views/widget/widget.h"
+
#if defined(OS_WIN)
#include "chrome/browser/renderer_host/render_widget_host_view_win.h"
+#elif defined(OS_LINUX)
+#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#endif
-#include "views/widget/widget.h"
ExtensionView::ExtensionView(ExtensionHost* host, Browser* browser)
: host_(host),
@@ -91,6 +94,11 @@ void ExtensionView::CreateWidgetHostView() {
HWND hwnd = view_win->Create(GetWidget()->GetNativeView());
view_win->ShowWindow(SW_SHOW);
Attach(hwnd);
+#elif defined(OS_LINUX)
+ RenderWidgetHostViewGtk* view_gtk =
+ static_cast<RenderWidgetHostViewGtk*>(view);
+ view_gtk->InitAsChild();
+ Attach(view_gtk->GetNativeView());
#else
NOTIMPLEMENTED();
#endif
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index 7d63a453..8762e14 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -403,7 +403,9 @@ void WidgetGtk::SetBounds(const gfx::Rect& bounds) {
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());
+ if (!bounds.IsEmpty()) {
+ gtk_window_resize(gtk_window, bounds.width(), bounds.height());
+ }
gtk_window_move(gtk_window, bounds.x(), bounds.y());
}
}
@@ -1294,4 +1296,3 @@ Widget* Widget::GetWidgetFromNativeWindow(gfx::NativeWindow native_window) {
}
} // namespace views
-