diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-19 22:04:32 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-19 22:04:32 +0000 |
commit | fd4a06b784a18a9256490e72101035fca7321923 (patch) | |
tree | cedb426d446d18308fe29d1d1bb00d4155ba5408 /chrome/plugin | |
parent | 57f123221a8e8826262cb0037875372b6c76338d (diff) | |
download | chromium_src-fd4a06b784a18a9256490e72101035fca7321923.zip chromium_src-fd4a06b784a18a9256490e72101035fca7321923.tar.gz chromium_src-fd4a06b784a18a9256490e72101035fca7321923.tar.bz2 |
(Mac) Intercept (Cocoa) cursor setting by plugins and forward it on properly.
BUG=http://crbug.com/20717
TEST=as in bug; this covers new Flash
Review URL: http://codereview.chromium.org/554003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36554 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r-- | chrome/plugin/plugin_interpose_util_mac.mm | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/chrome/plugin/plugin_interpose_util_mac.mm b/chrome/plugin/plugin_interpose_util_mac.mm index 7743175..f919c2b 100644 --- a/chrome/plugin/plugin_interpose_util_mac.mm +++ b/chrome/plugin/plugin_interpose_util_mac.mm @@ -75,7 +75,6 @@ void NotifyPluginOfSetThemeCursor(WebPluginDelegateImpl* delegate, delegate->SetThemeCursor(cursor); } - } // namespace mac_plugin_interposing #pragma mark - @@ -169,6 +168,23 @@ static void OnPluginWindowShown(const WindowInfo& window_info, BOOL is_modal) { @end +@interface NSCursor (ChromePluginInterposing) +- (void)chromePlugin_set; +@end + +@implementation NSCursor (ChromePluginInterposing) + +- (void)chromePlugin_set { + WebPluginDelegateImpl* delegate = mac_plugin_interposing::GetActiveDelegate(); + if (delegate) { + delegate->SetNSCursor(self); + return; + } + [self chromePlugin_set]; +} + +@end + #pragma mark - static void ExchangeMethods(Class target_class, SEL original, SEL replacement) { @@ -195,6 +211,9 @@ void SetUpCocoaInterposing() { ExchangeMethods([NSApplication class], @selector(runModalForWindow:), @selector(chromePlugin_runModalForWindow:)); + + ExchangeMethods([NSCursor class], @selector(set), + @selector(chromePlugin_set)); } } // namespace mac_plugin_interposing |