From 700d3d58213d15dea1beb2f7f7122e77e7ea2a47 Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Tue, 7 Jul 2009 17:40:46 +0000 Subject: linux: OOP windowed plugins There are still a few issues, but that's a start. - only windowed plugins - we can't currently create the gtksocket in background tabs, because their gtkwidgets are not yet in the hierarchy, so they can't be realized (that's what gives the XID). - the plugin process talks to the browser process through the renderer process to create/destroy the gtksockets, because the plugin doesn't know which renderer it's talking to. We need a bit more plumbing to be able to have direct IPC. - some code is duplicated between chrome and test_shell. We should probably refactor it, but I'm not sure where the common part should live. Patch from Antoine Labour , with some touchups by me. Review URL: http://codereview.chromium.org/146078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20041 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/plugin/plugin_main.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'chrome/plugin/plugin_main.cc') diff --git a/chrome/plugin/plugin_main.cc b/chrome/plugin/plugin_main.cc index fb8880f..a710b70 100644 --- a/chrome/plugin/plugin_main.cc +++ b/chrome/plugin/plugin_main.cc @@ -67,6 +67,22 @@ int PluginMain(const MainFunctionParams& parameters) { MB_OK | MB_SETFOREGROUND); } #else +#if defined(OS_LINUX) + { + // XEmbed plugins assume they are hosted in a Gtk application, so we need + // to initialize Gtk in the plugin process. + // TODO(evanm): hoist this up nearer to where we have argc/argv. + const std::vector& args = parameters.command_line_.argv(); + int argc = args.size(); + scoped_array argv(new const char *[argc + 1]); + for (int i = 0; i < argc; ++i) { + argv[i] = args[i].c_str(); + } + argv[argc] = NULL; + const char **argv_pointer = argv.get(); + gtk_init(&argc, const_cast(&argv_pointer)); + } +#endif NOTIMPLEMENTED() << " non-windows startup, plugin startup dialog etc."; #endif -- cgit v1.1