From 9c90deb6ab28f8043574331bb3d2ba6c624f5106 Mon Sep 17 00:00:00 2001 From: "avi@chromium.org" Date: Mon, 25 Jan 2010 20:32:56 +0000 Subject: Plumb Carbon SetCursor through. BUG=http://crbug.com/32703 TEST=when hiding cursor (Flash 10.0), cursor hides (but doesn't stay hidden; that gets fixed later) Review URL: http://codereview.chromium.org/552132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37028 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/app/framework.order | 1 + chrome/browser/plugin_carbon_interpose_mac.cc | 10 ++++++++++ chrome/plugin/plugin_interpose_util_mac.h | 4 ++++ chrome/plugin/plugin_interpose_util_mac.mm | 6 ++++++ 4 files changed, 21 insertions(+) (limited to 'chrome') diff --git a/chrome/app/framework.order b/chrome/app/framework.order index 7ef7343..2f66f38 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_interposing23NotifyPluginOfSetCursorEP21WebPluginDelegateImplPK6Cursor __ZN22mac_plugin_interposing23GetPluginWindowHasFocusEPK21WebPluginDelegateImpl __ZN23FakePluginWindowTrackerC1Ev __ZN23FakePluginWindowTrackerC2Ev diff --git a/chrome/browser/plugin_carbon_interpose_mac.cc b/chrome/browser/plugin_carbon_interpose_mac.cc index def2515..020d9ae 100644 --- a/chrome/browser/plugin_carbon_interpose_mac.cc +++ b/chrome/browser/plugin_carbon_interpose_mac.cc @@ -151,6 +151,15 @@ static OSStatus ChromePluginSetThemeCursor(ThemeCursor cursor) { return SetThemeCursor(cursor); } +static void ChromePluginSetCursor(const Cursor* cursor) { + WebPluginDelegateImpl* delegate = mac_plugin_interposing::GetActiveDelegate(); + if (delegate) { + mac_plugin_interposing::NotifyPluginOfSetCursor(delegate, cursor); + return; + } + return SetCursor(cursor); +} + #pragma mark - struct interpose_substitution { @@ -175,4 +184,5 @@ __attribute__((used)) static const interpose_substitution substitutions[] INTERPOSE_FUNCTION(DisposeDialog), INTERPOSE_FUNCTION(FindWindow), INTERPOSE_FUNCTION(SetThemeCursor), + INTERPOSE_FUNCTION(SetCursor), }; diff --git a/chrome/plugin/plugin_interpose_util_mac.h b/chrome/plugin/plugin_interpose_util_mac.h index 4942bb6..0806007 100644 --- a/chrome/plugin/plugin_interpose_util_mac.h +++ b/chrome/plugin/plugin_interpose_util_mac.h @@ -42,6 +42,10 @@ void NotifyBrowserOfPluginHideWindow(uint32 window_id, CGRect bounds); void NotifyPluginOfSetThemeCursor(WebPluginDelegateImpl* delegate, ThemeCursor cursor); +// Sends a message to the plugin that a cursor was set. +void NotifyPluginOfSetCursor(WebPluginDelegateImpl* delegate, + const Cursor* cursor); + // Returns true if the window containing the given plugin delegate is focused. bool GetPluginWindowHasFocus(const WebPluginDelegateImpl* delegate); diff --git a/chrome/plugin/plugin_interpose_util_mac.mm b/chrome/plugin/plugin_interpose_util_mac.mm index 801efbe..7dd20ad 100644 --- a/chrome/plugin/plugin_interpose_util_mac.mm +++ b/chrome/plugin/plugin_interpose_util_mac.mm @@ -76,6 +76,12 @@ void NotifyPluginOfSetThemeCursor(WebPluginDelegateImpl* delegate, } __attribute__((visibility("default"))) +void NotifyPluginOfSetCursor(WebPluginDelegateImpl* delegate, + const Cursor* cursor) { + delegate->SetCursor(cursor); +} + +__attribute__((visibility("default"))) bool GetPluginWindowHasFocus(const WebPluginDelegateImpl* delegate) { return delegate->GetWindowHasFocus(); } -- cgit v1.1