summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webcursor_mac.mm
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-15 21:51:19 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-15 21:51:19 +0000
commit997a47ac989abd294e94f8384f1eba6ad5698ad2 (patch)
tree5e1b92105eb5f52626c583953ed7204584e37885 /webkit/glue/webcursor_mac.mm
parentfa1cf0b87092ed3f3069a8549270f999e05cca20 (diff)
downloadchromium_src-997a47ac989abd294e94f8384f1eba6ad5698ad2.zip
chromium_src-997a47ac989abd294e94f8384f1eba6ad5698ad2.tar.gz
chromium_src-997a47ac989abd294e94f8384f1eba6ad5698ad2.tar.bz2
(Mac) Intercept (Carbon) cursor setting by plugins and forward it on properly.
BUG=http://crbug.com/20717 TEST=as in bug; this covers old Flash Review URL: http://codereview.chromium.org/550062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webcursor_mac.mm')
-rw-r--r--webkit/glue/webcursor_mac.mm66
1 files changed, 66 insertions, 0 deletions
diff --git a/webkit/glue/webcursor_mac.mm b/webkit/glue/webcursor_mac.mm
index c4ffc39..4a80d32 100644
--- a/webkit/glue/webcursor_mac.mm
+++ b/webkit/glue/webcursor_mac.mm
@@ -5,6 +5,7 @@
#include "webkit/glue/webcursor.h"
#import <AppKit/AppKit.h>
+#include <Carbon/Carbon.h>
#include "base/logging.h"
#include "base/nsimage_cache_mac.h"
@@ -158,6 +159,71 @@ NSCursor* WebCursor::GetCursor() const {
return nil;
}
+void WebCursor::InitFromThemeCursor(ThemeCursor cursor) {
+ WebKit::WebCursorInfo cursor_info;
+
+ switch (cursor) {
+ case kThemeArrowCursor:
+ cursor_info.type = WebCursorInfo::TypePointer;
+ break;
+ case kThemeCopyArrowCursor:
+ cursor_info.type = WebCursorInfo::TypeCopy;
+ break;
+ case kThemeAliasArrowCursor:
+ cursor_info.type = WebCursorInfo::TypeAlias;
+ break;
+ case kThemeContextualMenuArrowCursor:
+ cursor_info.type = WebCursorInfo::TypeContextMenu;
+ break;
+ case kThemeIBeamCursor:
+ cursor_info.type = WebCursorInfo::TypeIBeam;
+ break;
+ case kThemeCrossCursor:
+ case kThemePlusCursor:
+ cursor_info.type = WebCursorInfo::TypeCross;
+ break;
+ case kThemeWatchCursor:
+ case kThemeSpinningCursor:
+ cursor_info.type = WebCursorInfo::TypeWait;
+ break;
+ case kThemeClosedHandCursor:
+ case kThemeOpenHandCursor:
+ case kThemePointingHandCursor:
+ case kThemeCountingUpHandCursor:
+ case kThemeCountingDownHandCursor:
+ case kThemeCountingUpAndDownHandCursor:
+ cursor_info.type = WebCursorInfo::TypeHand;
+ break;
+ case kThemeResizeLeftCursor:
+ cursor_info.type = WebCursorInfo::TypeWestResize;
+ break;
+ case kThemeResizeRightCursor:
+ cursor_info.type = WebCursorInfo::TypeEastResize;
+ break;
+ case kThemeResizeLeftRightCursor:
+ cursor_info.type = WebCursorInfo::TypeEastWestResize;
+ break;
+ case kThemeNotAllowedCursor:
+ cursor_info.type = WebCursorInfo::TypeNotAllowed;
+ break;
+ case kThemeResizeUpCursor:
+ cursor_info.type = WebCursorInfo::TypeNorthResize;
+ break;
+ case kThemeResizeDownCursor:
+ cursor_info.type = WebCursorInfo::TypeSouthResize;
+ break;
+ case kThemeResizeUpDownCursor:
+ cursor_info.type = WebCursorInfo::TypeNorthSouthResize;
+ break;
+ case kThemePoofCursor: // *shrug*
+ default:
+ cursor_info.type = WebCursorInfo::TypePointer;
+ break;
+ }
+
+ InitFromCursorInfo(cursor_info);
+}
+
void WebCursor::SetCustomData(const WebImage& image) {
if (image.isNull())
return;