diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-01 21:23:43 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-01 21:23:43 +0000 |
commit | 941e455373dbbe837fe2e82d139af4dec1d35ddb (patch) | |
tree | 07cfc55341b2e0a62d38f821e0ca423db7f146ce /webkit/glue/plugins/webplugin_delegate_impl.h | |
parent | b51cda7cb0bddadb1f4cca4c18eb27313300aa21 (diff) | |
download | chromium_src-941e455373dbbe837fe2e82d139af4dec1d35ddb.zip chromium_src-941e455373dbbe837fe2e82d139af4dec1d35ddb.tar.gz chromium_src-941e455373dbbe837fe2e82d139af4dec1d35ddb.tar.bz2 |
Add tab switch notification to the Mac plugin plumbing.
Using the new notification:
- Update plugin clip rect when it's not in a visible tab.
- Update plugin idle event rate when it's not in a visible tab.
- Switch the unfocus-on-tab-switch event to be based on the this new notification, instead of a browser-level broadcast.
Related changes:
- Stop sending redundant focus events to plugins.
- Send window activation to Carbon event plugins too, not just Cocoa.
- Now that plugins are getting window and tab de-focus events directly, remove the older hack to force all plugins to lose focus any window or tab loses focus.
BUG=29371, 32229, 30838
TEST=Flash should still only register keystrokes when it is in the active window+tab. Plugins in background tabs should use less CPU.
Review URL: http://codereview.chromium.org/548224
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37743 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins/webplugin_delegate_impl.h')
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h index ce19bb5..eb05e27 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.h +++ b/webkit/glue/plugins/webplugin_delegate_impl.h @@ -119,14 +119,11 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { static WebPluginDelegateImpl* GetActiveDelegate(); // 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); + // Informs the delegate that it has gained or lost focus. + void FocusChanged(bool has_focus); // 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 + // call FocusChanged(true). This is used in a multiprocess environment to // propagate focus notifications to all running plugin processes. void SetFocusNotifier(void (*notifier)(WebPluginDelegateImpl*)) { focus_notifier_ = notifier; @@ -135,6 +132,8 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { void SetWindowHasFocus(bool has_focus); // Returns whether or not the window the plugin is in has focus. bool GetWindowHasFocus() const { return containing_window_has_focus_; } + // Informs the plugin that its tab has been hidden or shown. + void SetContainerVisibility(bool is_visible); // Informs the delegate that the plugin set a Carbon ThemeCursor. void SetThemeCursor(ThemeCursor cursor); // Informs the delegate that the plugin set a Carbon Cursor. @@ -362,6 +361,8 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { void (*focus_notifier_)(WebPluginDelegateImpl* notifier); bool containing_window_has_focus_; + bool container_is_visible_; + bool have_called_set_window_; #endif // Called by the message filter hook when the plugin enters a modal loop. |