Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2116)

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 146078: linux: OOP windowed plugins (Closed)
Patch Set: new version Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/render_widget_host_view_gtk.cc
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
index f883b3f37e574a77372a05b648412967c047af63..68e8c52ebc43bd4f6ab6677b264832290c7b5cea 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -34,7 +34,8 @@ using WebKit::WebInputEventFactory;
class RenderWidgetHostViewGtkWidget {
public:
static GtkWidget* CreateNewWidget(RenderWidgetHostViewGtk* host_view) {
- GtkWidget* widget = gtk_drawing_area_new();
+ GtkWidget* widget = gtk_fixed_new();
+ gtk_fixed_set_has_window(GTK_FIXED(widget), true);
gtk_widget_set_double_buffered(widget, FALSE);
#if defined(NDEBUG)
gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &gfx::kGdkWhite);
@@ -375,6 +376,7 @@ RenderWidgetHostViewGtk::~RenderWidgetHostViewGtk() {
void RenderWidgetHostViewGtk::InitAsChild() {
view_.Own(RenderWidgetHostViewGtkWidget::CreateNewWidget(this));
+ plugin_container_host_.set_host_widget(view_.get());
gtk_widget_show(view_.get());
}
@@ -384,6 +386,7 @@ void RenderWidgetHostViewGtk::InitAsPopup(
parent_ = parent_host_view->GetNativeView();
GtkWidget* popup = gtk_window_new(GTK_WINDOW_POPUP);
view_.Own(RenderWidgetHostViewGtkWidget::CreateNewWidget(this));
+ plugin_container_host_.set_host_widget(view_.get());
gtk_container_add(GTK_CONTAINER(popup), view_.get());
// If we are not activatable, we don't want to grab keyboard input,
@@ -473,8 +476,9 @@ void RenderWidgetHostViewGtk::MovePluginWindows(
const std::vector<WebPluginGeometry>& plugin_window_moves) {
if (plugin_window_moves.empty())
return;
-
- NOTIMPLEMENTED();
+ for (unsigned int i = 0; i < plugin_window_moves.size(); ++i) {
+ plugin_container_host_.MovePluginContainer(plugin_window_moves[i]);
+ }
}
void RenderWidgetHostViewGtk::Focus() {
@@ -573,6 +577,7 @@ void RenderWidgetHostViewGtk::DidScrollRect(const gfx::Rect& rect, int dx,
void RenderWidgetHostViewGtk::RenderViewGone() {
Destroy();
+ plugin_container_host_.set_host_widget(NULL);
}
void RenderWidgetHostViewGtk::Destroy() {
@@ -707,3 +712,12 @@ void RenderWidgetHostViewGtk::ReceivedSelectionText(GtkClipboard* clipboard,
host_view->host_->Send(new ViewMsg_InsertText(host_view->host_->routing_id(),
UTF8ToUTF16(text)));
}
+
+gfx::PluginWindowHandle RenderWidgetHostViewGtk::CreatePluginContainer() {
+ return plugin_container_host_.CreatePluginContainer();
+}
+
+void RenderWidgetHostViewGtk::DestroyPluginContainer(
+ gfx::PluginWindowHandle container) {
+ plugin_container_host_.DestroyPluginContainer(container);
+}
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_gtk.h ('k') | chrome/browser/renderer_host/test/test_render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698