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

Side by Side Diff: webkit/glue/webcursor_mac.mm

Issue 10933083: Remove deprecated gfx::Image::operator NSImage*(). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Comments and merge Created 8 years, 3 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/image/image_mac_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « ui/gfx/image/image_mac_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698