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

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)
@@ -30,6 +30,7 @@
#include "content/browser/renderer_host/resource_message_filter.h"
#include "content/common/plugin_messages.h"
#include "content/common/resource_messages.h"
+#include "webkit/plugins/npapi/webplugin_delegate_impl.h"
#include "ipc/ipc_switches.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gfx/native_widget_types.h"
@@ -62,6 +63,24 @@
plugin_parent_windows_set_.insert(window);
}
+void PluginProcessHost::OnReparentPluginWindow(HWND window, HWND parent) {
+ DWORD process_id = 0;
+
+ // Reparent only to our process.
+ ::GetWindowThreadProcessId(parent, &process_id);
+ if (process_id != ::GetCurrentProcessId())
+ return;
+
+ // Must reparent before changing style.
+ ::SetParent(window, parent);
+
+ if (webkit::npapi::WebPluginDelegateImpl::IsDummyActivationWindow(window)) {
+ ::SetWindowLongPtr(window, GWL_STYLE, WS_CHILD);
+ } else {
+ ::SetWindowLongPtr(window, GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN |
+ WS_CLIPSIBLINGS);
+ }
+}
#endif // defined(OS_WIN)
#if defined(TOOLKIT_USES_GTK)
@@ -245,6 +264,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