Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: webkit/glue/webcursor_mac.mm

Issue 6591105: Implement the grab/grabbing cursors (for Mac/GTK).... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/glue/webcursor_mac.mm
===================================================================
--- webkit/glue/webcursor_mac.mm (revision 76543)
+++ webkit/glue/webcursor_mac.mm (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -153,6 +153,10 @@
return LoadCursor("zoomInCursor", 7, 7);
case WebCursorInfo::TypeZoomOut:
return LoadCursor("zoomOutCursor", 7, 7);
+ case WebCursorInfo::TypeGrab:
+ return [NSCursor openHandCursor];
+ case WebCursorInfo::TypeGrabbing:
+ return [NSCursor closedHandCursor];
case WebCursorInfo::TypeCustom:
return CreateCustomCursor(custom_data_, custom_size_, hotspot_);
}
@@ -192,7 +196,11 @@
cursor_info.type = WebCursorInfo::TypeWait;
break;
case kThemeClosedHandCursor:
+ cursor_info.type = WebCursorInfo::TypeGrabbing;
+ break;
case kThemeOpenHandCursor:
+ cursor_info.type = WebCursorInfo::TypeGrab;
+ break;
case kThemePointingHandCursor:
case kThemeCountingUpHandCursor:
case kThemeCountingDownHandCursor:
@@ -297,10 +305,13 @@
cursor_info.type = WebCursorInfo::TypeSouthResize;
} else if ([cursor isEqual:[NSCursor resizeUpDownCursor]]) {
cursor_info.type = WebCursorInfo::TypeNorthSouthResize;
+ } else if ([cursor isEqual:[NSCursor openHandCursor]]) {
+ cursor_info.type = WebCursorInfo::TypeGrab;
+ } else if ([cursor isEqual:[NSCursor closedHandCursor]]) {
+ cursor_info.type = WebCursorInfo::TypeGrabbing;
} else {
- // Also handles the [NSCursor closedHandCursor], [NSCursor openHandCursor],
- // and [NSCursor disappearingItemCursor] cases. Quick-and-dirty image
- // conversion; TODO(avi): do better.
+ // Also handles the [NSCursor disappearingItemCursor] case. Quick-and-dirty
+ // image conversion; TODO(avi): do better.
CGImageRef cg_image = nil;
NSImage* image = [cursor image];
for (id rep in [image representations]) {

Powered by Google App Engine
This is Rietveld 408576698