summaryrefslogtreecommitdiffstats
path: root/webkit/glue/plugins/webplugin_delegate_impl.h
diff options
context:
space:
mode:
authoramanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 18:26:16 +0000
committeramanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 18:26:16 +0000
commit27f5a6c85610ac97a87bc64918ead7891f58fda5 (patch)
tree8454f2a3e2526b203628c0e434ebee62e563ad0b /webkit/glue/plugins/webplugin_delegate_impl.h
parent8806b8a53168e161e8a2cbbf4051067c095832a9 (diff)
downloadchromium_src-27f5a6c85610ac97a87bc64918ead7891f58fda5.zip
chromium_src-27f5a6c85610ac97a87bc64918ead7891f58fda5.tar.gz
chromium_src-27f5a6c85610ac97a87bc64918ead7891f58fda5.tar.bz2
Mac: Simulate the OS-level focus handling that windows and linux plugins
rely on to trigger NPAPI keyboard focus notifications. BUG=26585 TEST=On pages with multiple Flash text entry fields, only one should have a blinking caret at any time. Flash elements that use the ActionScript2 "Key.IsDown()" function should only detect keydowns when they are in a visible tab and focused. Review URL: http://codereview.chromium.org/399090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32631 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins/webplugin_delegate_impl.h')
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h
index 1665a8b..5d6757d 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl.h
+++ b/webkit/glue/plugins/webplugin_delegate_impl.h
@@ -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 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate {
// 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 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate {
// 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.