diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-21 16:47:08 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-21 16:47:08 +0000 |
commit | 2f2ba980e92c4fe49e3eddbfcf28bc52ae4ed590 (patch) | |
tree | 7a4ce421608e72d0f44604911a5537cd9818a702 /chrome | |
parent | b7b2cefeb858fe1586cd70aead60ed2b48708ed7 (diff) | |
download | chromium_src-2f2ba980e92c4fe49e3eddbfcf28bc52ae4ed590.zip chromium_src-2f2ba980e92c4fe49e3eddbfcf28bc52ae4ed590.tar.gz chromium_src-2f2ba980e92c4fe49e3eddbfcf28bc52ae4ed590.tar.bz2 |
Send Cocoa NPAPI plugins an initial window activation event
Until we have real window activation status, just send a window focus event so that Cocoa plugins always think their window is active (as is currently the case with Carbon plugins).
Also wire up the Carbon interposing on window activation checks to talk to the delegate, so once the delegate has correct information Carbon will Just Work.
BUG=31847
TEST=Flash 10.1 should track the mouse when the plugin is loaded, without having to click in it first.
Review URL: http://codereview.chromium.org/552067
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36754 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/framework.order | 1 | ||||
-rw-r--r-- | chrome/browser/plugin_carbon_interpose_mac.cc | 5 | ||||
-rw-r--r-- | chrome/plugin/plugin_interpose_util_mac.h | 3 | ||||
-rw-r--r-- | chrome/plugin/plugin_interpose_util_mac.mm | 5 |
4 files changed, 10 insertions, 4 deletions
diff --git a/chrome/app/framework.order b/chrome/app/framework.order index 814cecc..7ef7343 100644 --- a/chrome/app/framework.order +++ b/chrome/app/framework.order @@ -28,6 +28,7 @@ __ZN22mac_plugin_interposing33NotifyBrowserOfPluginSelectWindowEj6CGRectb __ZN22mac_plugin_interposing31NotifyBrowserOfPluginShowWindowEj6CGRectb __ZN22mac_plugin_interposing31NotifyBrowserOfPluginHideWindowEj6CGRect __ZN22mac_plugin_interposing28NotifyPluginOfSetThemeCursorEP21WebPluginDelegateImplm +__ZN22mac_plugin_interposing23GetPluginWindowHasFocusEPK21WebPluginDelegateImpl __ZN23FakePluginWindowTrackerC1Ev __ZN23FakePluginWindowTrackerC2Ev __ZN23FakePluginWindowTracker14SharedInstanceEv diff --git a/chrome/browser/plugin_carbon_interpose_mac.cc b/chrome/browser/plugin_carbon_interpose_mac.cc index adbba7e..def2515 100644 --- a/chrome/browser/plugin_carbon_interpose_mac.cc +++ b/chrome/browser/plugin_carbon_interpose_mac.cc @@ -19,10 +19,7 @@ static bool IsModalWindow(WindowRef window) { } static bool IsContainingWindowActive(const WebPluginDelegateImpl* delegate) { - // TODO(stuartmorgan): We need a way to find out if the delegate is in the - // active window; for now we just lie and always say yes so plugins don't - // throw events away. - return true; + return mac_plugin_interposing::GetPluginWindowHasFocus(delegate); } static CGRect CGRectForWindow(WindowRef window) { diff --git a/chrome/plugin/plugin_interpose_util_mac.h b/chrome/plugin/plugin_interpose_util_mac.h index deabe6c..4942bb6 100644 --- a/chrome/plugin/plugin_interpose_util_mac.h +++ b/chrome/plugin/plugin_interpose_util_mac.h @@ -42,6 +42,9 @@ void NotifyBrowserOfPluginHideWindow(uint32 window_id, CGRect bounds); void NotifyPluginOfSetThemeCursor(WebPluginDelegateImpl* delegate, ThemeCursor cursor); +// Returns true if the window containing the given plugin delegate is focused. +bool GetPluginWindowHasFocus(const WebPluginDelegateImpl* delegate); + } // namespace MacPluginInterpose #endif // CHROME_PLUGIN_PLUGIN_INTERPOSE_UTIL_MAC_H_ diff --git a/chrome/plugin/plugin_interpose_util_mac.mm b/chrome/plugin/plugin_interpose_util_mac.mm index f919c2b..801efbe 100644 --- a/chrome/plugin/plugin_interpose_util_mac.mm +++ b/chrome/plugin/plugin_interpose_util_mac.mm @@ -75,6 +75,11 @@ void NotifyPluginOfSetThemeCursor(WebPluginDelegateImpl* delegate, delegate->SetThemeCursor(cursor); } +__attribute__((visibility("default"))) +bool GetPluginWindowHasFocus(const WebPluginDelegateImpl* delegate) { + return delegate->GetWindowHasFocus(); +} + } // namespace mac_plugin_interposing #pragma mark - |