| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/glue/webcursor.h" | 5 #include "webkit/glue/webcursor.h" |
| 6 | 6 |
| 7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
| 8 #include <Carbon/Carbon.h> | 8 #include <Carbon/Carbon.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 - (CrCoreCursorType)_coreCursorType { | 123 - (CrCoreCursorType)_coreCursorType { |
| 124 return type_; | 124 return type_; |
| 125 } | 125 } |
| 126 | 126 |
| 127 @end | 127 @end |
| 128 | 128 |
| 129 namespace { | 129 namespace { |
| 130 | 130 |
| 131 NSCursor* LoadCursor(int resource_id, int hotspot_x, int hotspot_y) { | 131 NSCursor* LoadCursor(int resource_id, int hotspot_x, int hotspot_y) { |
| 132 NSImage* cursor_image = | 132 const gfx::Image& cursor_image = |
| 133 ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); | 133 ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); |
| 134 DCHECK(cursor_image); | 134 DCHECK(!cursor_image.IsEmpty()); |
| 135 return [[[NSCursor alloc] initWithImage:cursor_image | 135 return [[[NSCursor alloc] initWithImage:cursor_image.ToNSImage() |
| 136 hotSpot:NSMakePoint(hotspot_x, | 136 hotSpot:NSMakePoint(hotspot_x, |
| 137 hotspot_y)] autorelease]; | 137 hotspot_y)] autorelease]; |
| 138 } | 138 } |
| 139 | 139 |
| 140 // Gets a specified cursor from CoreCursor, falling back to loading it from the | 140 // Gets a specified cursor from CoreCursor, falling back to loading it from the |
| 141 // image cache if CoreCursor cannot provide it. | 141 // image cache if CoreCursor cannot provide it. |
| 142 NSCursor* GetCoreCursorWithFallback(CrCoreCursorType type, | 142 NSCursor* GetCoreCursorWithFallback(CrCoreCursorType type, |
| 143 int resource_id, | 143 int resource_id, |
| 144 int hotspot_x, | 144 int hotspot_x, |
| 145 int hotspot_y) { | 145 int hotspot_y) { |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 return true; | 547 return true; |
| 548 } | 548 } |
| 549 | 549 |
| 550 void WebCursor::CleanupPlatformData() { | 550 void WebCursor::CleanupPlatformData() { |
| 551 return; | 551 return; |
| 552 } | 552 } |
| 553 | 553 |
| 554 void WebCursor::CopyPlatformData(const WebCursor& other) { | 554 void WebCursor::CopyPlatformData(const WebCursor& other) { |
| 555 return; | 555 return; |
| 556 } | 556 } |
| OLD | NEW |