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

Unified Diff: chrome/browser/plugin_process_host_mac.cc

Issue 399090: Mac: Simulate the OS-level focus handling that windows and linux plugins... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
« no previous file with comments | « chrome/browser/plugin_process_host.cc ('k') | chrome/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_process_host_mac.cc
===================================================================
--- chrome/browser/plugin_process_host_mac.cc (revision 32617)
+++ chrome/browser/plugin_process_host_mac.cc (working copy)
@@ -12,7 +12,9 @@
#include "base/mac_util.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/plugin_process_host.h"
+#include "chrome/common/plugin_messages.h"
+
void PluginProcessHost::OnPluginSelectWindow(uint32 window_id,
gfx::Rect window_rect,
bool modal) {
@@ -75,3 +77,16 @@
NewRunnableFunction(mac_util::ActivateProcess, handle()));
}
}
+
+void PluginProcessHost::OnPluginReceivedFocus(int process_id, int instance_id) {
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ // A plugin has received keyboard focus, so tell all other plugin processes
+ // that they no longer have it (simulating the OS-level focus notifications
+ // that Gtk and Windows provide).
+ for (ChildProcessHost::Iterator iter(ChildProcessInfo::PLUGIN_PROCESS);
+ !iter.Done(); ++iter) {
+ PluginProcessHost* plugin = static_cast<PluginProcessHost*>(*iter);
+ int instance = (plugin->handle() == process_id) ? instance_id : 0;
+ plugin->Send(new PluginProcessMsg_PluginFocusNotify(instance));
+ }
+}
« no previous file with comments | « chrome/browser/plugin_process_host.cc ('k') | chrome/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698