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

Side by Side Diff: chrome/browser/bookmarks/bookmark_pasteboard_helper_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 | « no previous file | chrome/browser/themes/theme_service_mac.mm » ('j') | 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 "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h" 5 #include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 kCrWebURLsWithTitlesPboardType, 346 kCrWebURLsWithTitlesPboardType,
347 NSURLPboardType, 347 NSURLPboardType,
348 nil]; 348 nil];
349 return [pb availableTypeFromArray:availableTypes] != nil; 349 return [pb availableTypeFromArray:availableTypes] != nil;
350 } 350 }
351 351
352 NSImage* DragImageForBookmark(NSImage* favicon, const string16& title) { 352 NSImage* DragImageForBookmark(NSImage* favicon, const string16& title) {
353 // If no favicon, use a default. 353 // If no favicon, use a default.
354 if (!favicon) { 354 if (!favicon) {
355 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 355 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
356 favicon = rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON); 356 favicon = rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON).ToNSImage();
357 } 357 }
358 358
359 // If no title, just use icon. 359 // If no title, just use icon.
360 if (title.empty()) 360 if (title.empty())
361 return favicon; 361 return favicon;
362 NSString* ns_title = base::SysUTF16ToNSString(title); 362 NSString* ns_title = base::SysUTF16ToNSString(title);
363 363
364 // Set the look of the title. 364 // Set the look of the title.
365 NSDictionary* attrs = 365 NSDictionary* attrs =
366 [NSDictionary dictionaryWithObject:[NSFont systemFontOfSize: 366 [NSDictionary dictionaryWithObject:[NSFont systemFontOfSize:
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 [window dragImage:drag_image 431 [window dragImage:drag_image
432 at:position 432 at:position
433 offset:NSZeroSize 433 offset:NSZeroSize
434 event:drag_event 434 event:drag_event
435 pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard] 435 pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard]
436 source:nil 436 source:nil
437 slideBack:YES]; 437 slideBack:YES];
438 } 438 }
439 439
440 } // namespace bookmark_pasteboard_helper_mac 440 } // namespace bookmark_pasteboard_helper_mac
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/themes/theme_service_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698