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>2010-01-13 22:26:10 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 22:26:10 +0000
commit77f0c3e6fcb58da648fe81819e7028a7bd3768d1 (patch)
tree2b401e4507fca7086372167b045de9e9e9df35e5 /chrome/browser/plugin_carbon_interpose_mac.cc
parent520cdd71da6f80dfffdd384645792de9a61abc94 (diff)
downloadchromium_src-77f0c3e6fcb58da648fe81819e7028a7bd3768d1.zip
chromium_src-77f0c3e6fcb58da648fe81819e7028a7bd3768d1.tar.gz
chromium_src-77f0c3e6fcb58da648fe81819e7028a7bd3768d1.tar.bz2
Fix clicking in QuickTime content on the Mac
QuickTime uses FindWindow in its click handling to get the WindowRef, so we need to interpose it to give back the plugin window (which isn't actually on screen). This makes clicks work except for the menu button in the control strip. BUG=24952 TEST=Click/double-click in a QuickTime video to pause/play, or use the control strip (except for the menu button). Review URL: http://codereview.chromium.org/536047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_carbon_interpose_mac.cc')
-rw-r--r--chrome/browser/plugin_carbon_interpose_mac.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/plugin_carbon_interpose_mac.cc b/chrome/browser/plugin_carbon_interpose_mac.cc
index 96de137..852bf73 100644
--- a/chrome/browser/plugin_carbon_interpose_mac.cc
+++ b/chrome/browser/plugin_carbon_interpose_mac.cc
@@ -125,6 +125,25 @@ static void ChromePluginDisposeDialog(DialogRef dialog) {
OnPluginWindowClosed(window_info);
}
+static WindowPartCode ChromePluginFindWindow(Point point, WindowRef* window) {
+ FakePluginWindowTracker* tracker = FakePluginWindowTracker::SharedInstance();
+ WindowRef plugin_window = tracker->get_active_plugin_window();
+ if (plugin_window) {
+ // If plugin_window is non-NULL, then we are in the middle of routing an
+ // event to the plugin, so we know it's destined for this window already,
+ // so we don't have to worry that we'll be stealing an event meant for an
+ // overlapping window.
+ Rect window_bounds;
+ GetWindowBounds(plugin_window, kWindowContentRgn, &window_bounds);
+ if (PtInRect(point, &window_bounds)) {
+ if (window)
+ *window = plugin_window;
+ return inContent;
+ }
+ }
+ return FindWindow(point, window);
+}
+
#pragma mark -
struct interpose_substitution {
@@ -147,4 +166,5 @@ __attribute__((used)) static const interpose_substitution substitutions[]
INTERPOSE_FUNCTION(HideWindow),
INTERPOSE_FUNCTION(ReleaseWindow),
INTERPOSE_FUNCTION(DisposeDialog),
+ INTERPOSE_FUNCTION(FindWindow),
};