summaryrefslogtreecommitdiffstats
path: root/base/gfx
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-26 18:22:54 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-26 18:22:54 +0000
commit140c303f6227f870bb269bd6810c907c99004b55 (patch)
treeec3522f3193bc2688d7777fcd022e808a530dc49 /base/gfx
parent487c2873c78595f5ec78629a5ca92304b34ce317 (diff)
downloadchromium_src-140c303f6227f870bb269bd6810c907c99004b55.zip
chromium_src-140c303f6227f870bb269bd6810c907c99004b55.tar.gz
chromium_src-140c303f6227f870bb269bd6810c907c99004b55.tar.bz2
linux plugins: eliminate GtkWidget* from plugin process
[retry with mac hopefully fixed this time] GtkWidget* (and its wrapper, gfx::NativeView) only work within a single process. Plugins already work with a lower-level type that works across processes -- an X Window id. The parent of a plugin is an HWND on windows, but it's an X Window id on X. So we introduce a new typedef wrapping that and push it through all the places in the code that needs it. Since we no longer have a GtkSocket in the WebPluginDelegateImpl, we need to do a bit more work in the WebViewDelegate (aka the browser process in the multiproc world). We also need the plugin host (the browser) to track the GtkSockets that are hosting the plugin, as well as destroy them when necessary. To do this we require the plugin owner to grab the plug-removed signal rather than putting its handler in GtkPluginContainer; this is the way it worked before I'd refactored into GtkPluginContainer so it shouldn't be so bad. This change still only works in test_shell, but the refactoring should translate to the multiprocess case pretty easily. Review URL: http://codereview.chromium.org/146009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19387 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/gfx')
-rw-r--r--base/gfx/native_widget_types.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/base/gfx/native_widget_types.h b/base/gfx/native_widget_types.h
index 9444a61..e9a9230 100644
--- a/base/gfx/native_widget_types.h
+++ b/base/gfx/native_widget_types.h
@@ -114,6 +114,21 @@ static inline NativeViewId IdFromNativeView(NativeView view) {
NativeViewId IdFromNativeView(NativeView view);
#endif // defined(OS_LINUX)
+
+// PluginWindowHandle is an abstraction wrapping "the types of windows
+// used by NPAPI plugins". On Windows it's an HWND, on X it's an X
+// window id.
+#if defined(OS_WIN)
+ typedef HWND PluginWindowHandle;
+#elif defined(OS_LINUX)
+ typedef unsigned long PluginWindowHandle;
+#else
+ // On OS X we don't have windowed plugins.
+ // Use a gfx::NativeView so the previously-compiling code still works.
+ // TODO(evanm): remove this and use void* instead.
+ typedef gfx::NativeView PluginWindowHandle;
+#endif
+
} // namespace gfx
#endif // BASE_GFX_NATIVE_WIDGET_TYPES_H_