summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_carbon_interpose_mac.cc
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 21:28:54 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 21:28:54 +0000
commitb967dad2957a86bd0aed778932b63d89c9795a0f (patch)
tree13ebdece04929b4fec1d62a8e32f790451cd974c /chrome/browser/plugin_carbon_interpose_mac.cc
parent738b62850325f4dd4db1f68672740e42d988b7b2 (diff)
downloadchromium_src-b967dad2957a86bd0aed778932b63d89c9795a0f.zip
chromium_src-b967dad2957a86bd0aed778932b63d89c9795a0f.tar.gz
chromium_src-b967dad2957a86bd0aed778932b63d89c9795a0f.tar.bz2
Add IsWindowActive to the Mac plugin interpose list
BUG=28021 TEST=Mouseover should work in Silverlight Review URL: http://codereview.chromium.org/460057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_carbon_interpose_mac.cc')
-rw-r--r--chrome/browser/plugin_carbon_interpose_mac.cc24
1 files changed, 18 insertions, 6 deletions
diff --git a/chrome/browser/plugin_carbon_interpose_mac.cc b/chrome/browser/plugin_carbon_interpose_mac.cc
index e0e17b0..94d6c38 100644
--- a/chrome/browser/plugin_carbon_interpose_mac.cc
+++ b/chrome/browser/plugin_carbon_interpose_mac.cc
@@ -85,18 +85,29 @@ static bool IsModalWindow(WindowRef window) {
return (status == noErr) && (modality != kWindowModalityNone);
}
+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;
+}
+
#pragma mark -
+static Boolean ChromePluginIsWindowActive(WindowRef window) {
+ const WebPluginDelegateImpl* delegate =
+ FakePluginWindowTracker::SharedInstance()->GetDelegateForFakeWindow(
+ window);
+ return delegate ? IsContainingWindowActive(delegate)
+ : IsWindowActive(window);
+}
+
static Boolean ChromePluginIsWindowHilited(WindowRef window) {
- // TODO(stuartmorgan): Always returning true (instead of the real answer,
- // which would be false) means that clicking works, but it's not correct
- // either. Ideally we need a way to find out if the delegate corresponds
- // to a browser window that is active.
const WebPluginDelegateImpl* delegate =
FakePluginWindowTracker::SharedInstance()->GetDelegateForFakeWindow(
window);
- Boolean isHilited = delegate ? true : IsWindowHilited(window);
- return isHilited;
+ return delegate ? IsContainingWindowActive(delegate)
+ : IsWindowHilited(window);
}
static CGRect CGRectForWindow(WindowRef window) {
@@ -160,6 +171,7 @@ struct interpose_substitution {
__attribute__((used)) static const interpose_substitution substitutions[]
__attribute__((section("__DATA, __interpose"))) = {
+ INTERPOSE_FUNCTION(IsWindowActive),
INTERPOSE_FUNCTION(IsWindowHilited),
INTERPOSE_FUNCTION(SelectWindow),
INTERPOSE_FUNCTION(ShowWindow),