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

Unified Diff: content/browser/plugin_process_host.cc

Issue 7054068: Make sandboxed Flash work under UIPI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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: content/browser/plugin_process_host.cc
===================================================================
--- content/browser/plugin_process_host.cc (revision 87939)
+++ content/browser/plugin_process_host.cc (working copy)
@@ -46,6 +46,8 @@
#endif
#if defined(OS_WIN)
+#include "webkit/plugins/npapi/webplugin_delegate_impl.h"
+
void PluginProcessHost::OnPluginWindowDestroyed(HWND window, HWND parent) {
// The window is destroyed at this point, we just care about its parent, which
// is the intermediate window we created.
@@ -62,6 +64,21 @@
plugin_parent_windows_set_.insert(window);
}
+void PluginProcessHost::OnReparentPluginWindow(HWND window, HWND parent) {
+ // Reparent only to our process.
+ DWORD process_id = 0;
+ ::GetWindowThreadProcessId(parent, &process_id);
+ if (::IsWindow(window) && process_id != ::GetCurrentProcessId())
+ return;
+
cpu_(ooo_6.6-7.5) 2011/06/07 01:03:36 If IsWindow() returns false you continue?
+ if (webkit::npapi::WebPluginDelegateImpl::IsDummyActivationWindow(window)) {
+ ::SetWindowLongPtr(window, GWL_STYLE, WS_CHILD);
+ } else {
+ ::SetWindowLongPtr(window, GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN |
+ WS_CLIPSIBLINGS);
+ }
+ ::SetParent(window, parent);
+}
#endif // defined(OS_WIN)
#if defined(TOOLKIT_USES_GTK)
@@ -245,6 +262,8 @@
#if defined(OS_WIN)
IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginWindowDestroyed,
OnPluginWindowDestroyed)
+ IPC_MESSAGE_HANDLER(PluginProcessHostMsg_ReparentPluginWindow,
+ OnReparentPluginWindow)
#endif
#if defined(TOOLKIT_USES_GTK)
IPC_MESSAGE_HANDLER(PluginProcessHostMsg_MapNativeViewId,

Powered by Google App Engine
This is Rietveld 408576698