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

Unified Diff: webkit/glue/plugins/webplugin_delegate_impl.h

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/plugin/webplugin_delegate_stub.cc ('k') | webkit/glue/plugins/webplugin_delegate_impl_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/webplugin_delegate_impl.h
===================================================================
--- webkit/glue/plugins/webplugin_delegate_impl.h (revision 32617)
+++ webkit/glue/plugins/webplugin_delegate_impl.h (working copy)
@@ -9,6 +9,7 @@
#include <string>
#include <list>
+#include <set>
#include "app/gfx/native_widget_types.h"
#include "base/file_path.h"
@@ -113,6 +114,20 @@
// Informs the delegate that the context used for painting windowless plugins
// has changed.
void UpdateContext(gfx::NativeDrawingContext context);
+ // returns a vector of currently active delegates in this process.
+ static std::set<WebPluginDelegateImpl*> GetActiveDelegates();
+ // Informs the delegate which plugin instance has just received keyboard focus
+ // so that it can notify the plugin as appropriate. If |process_id| and
+ // |instance_id| are both 0, this signifies that no plugin has keyboard
+ // focus.
+ void FocusNotify(WebPluginDelegateImpl* focused_delegate);
+ // Set a notifier function that gets called when the delegate is accepting
+ // the focus. If no notifier function has been set, the delegate will just
+ // call FocusNotify(this). This is used in a multiprocess environment to
+ // propagate focus notifications to all running plugin processes.
+ void SetFocusNotifier(void (*notifier)(WebPluginDelegateImpl*)) {
+ focus_notifier_ = notifier;
+ }
#endif
private:
@@ -305,6 +320,10 @@
// Last mouse position within the plugin's rect (used for null events).
int last_mouse_x_;
int last_mouse_y_;
+ // True if the plugin thinks it has keyboard focus
+ bool have_focus_;
+ // A function to call when we want to accept keyboard focus
+ void (*focus_notifier_)(WebPluginDelegateImpl* notifier);
#endif
// Called by the message filter hook when the plugin enters a modal loop.
« no previous file with comments | « chrome/plugin/webplugin_delegate_stub.cc ('k') | webkit/glue/plugins/webplugin_delegate_impl_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698