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 /chrome/plugin/plugin_thread.cc | |
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 'chrome/plugin/plugin_thread.cc')
-rw-r--r-- | chrome/plugin/plugin_thread.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index fb02ac5..0a9ef12 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -149,14 +149,15 @@ void PluginThread::OnPluginMessage(const std::vector<unsigned char> &data) { #if defined(OS_MACOSX) void PluginThread::OnPluginFocusNotify(uint32 instance_id) { - WebPluginDelegateImpl* instance = + WebPluginDelegateImpl* focused_instance = reinterpret_cast<WebPluginDelegateImpl*>(instance_id); std::set<WebPluginDelegateImpl*> active_delegates = WebPluginDelegateImpl::GetActiveDelegates(); for (std::set<WebPluginDelegateImpl*>::iterator iter = active_delegates.begin(); iter != active_delegates.end(); iter++) { - (*iter)->FocusNotify(instance); + WebPluginDelegateImpl* instance = *iter; + instance->FocusChanged(instance == focused_instance); } } #endif |