summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/webplugin_delegate_proxy.cc
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-01 15:54:26 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-01 15:54:26 +0000
commitd8fd6faa7cdccb77c2d496e1ebb9d5f1b9ede717 (patch)
tree0916603cd5a2125c522bdd4d3666d4090ca5a83e /chrome/renderer/webplugin_delegate_proxy.cc
parent74f4183d376412c21943477c4f721b4838c01117 (diff)
downloadchromium_src-d8fd6faa7cdccb77c2d496e1ebb9d5f1b9ede717.zip
chromium_src-d8fd6faa7cdccb77c2d496e1ebb9d5f1b9ede717.tar.gz
chromium_src-d8fd6faa7cdccb77c2d496e1ebb9d5f1b9ede717.tar.bz2
Propagate window focus changes to plugins on the Mac
This gives plugins mostly correct window activation information; there are still a few loose ends like initial focus state and changes that happen while plugins are in background tabs, but those will be handled in follow-up bugs. BUG=31847 TEST=Plugins that are in background windows should act accordingly (e.g., Silverlight hover effects shouldn't trigger) Review URL: http://codereview.chromium.org/549194 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37694 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/webplugin_delegate_proxy.cc')
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index 83666d5..94ddc2a 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -175,6 +175,10 @@ void WebPluginDelegateProxy::PluginDestroyed() {
if (window_)
WillDestroyWindow();
+#if defined(OS_MACOSX)
+ render_view_->UnregisterPluginDelegate(this);
+#endif
+
if (channel_host_) {
Send(new PluginMsg_DestroyInstance(instance_id_));
@@ -288,6 +292,10 @@ bool WebPluginDelegateProxy::Initialize(const GURL& url,
IPC::Message* msg = new PluginMsg_Init(instance_id_, params, &result);
Send(msg);
+#if defined(OS_MACOSX)
+ render_view_->RegisterPluginDelegate(this);
+#endif
+
return result;
}
@@ -850,6 +858,12 @@ int WebPluginDelegateProxy::GetProcessId() {
return channel_host_->peer_pid();
}
+#if defined(OS_MACOSX)
+void WebPluginDelegateProxy::SetWindowFocus(bool window_has_focus) {
+ Send(new PluginMsg_SetWindowFocus(instance_id_, window_has_focus));
+}
+#endif // OS_MACOSX
+
void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) {
windowless_ = !window;
window_ = window;