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

Side by Side Diff: chrome/browser/ui/cocoa/page_info_bubble_controller.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
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 #import "chrome/browser/ui/cocoa/page_info_bubble_controller.h" 5 #import "chrome/browser/ui/cocoa/page_info_bubble_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 // does not affect the next Y position because the image is placed next to 431 // does not affect the next Y position because the image is placed next to
432 // a text field that is larger and accounts for the image's size. 432 // a text field that is larger and accounts for the image's size.
433 - (void)addImageViewForInfo:(const PageInfoModel::SectionInfo&)info 433 - (void)addImageViewForInfo:(const PageInfoModel::SectionInfo&)info
434 toSubviews:(NSMutableArray*)subviews 434 toSubviews:(NSMutableArray*)subviews
435 atOffset:(CGFloat)offset { 435 atOffset:(CGFloat)offset {
436 NSRect frame = 436 NSRect frame =
437 NSMakeRect(kFramePadding, offset, kImageSize, kImageSize); 437 NSMakeRect(kFramePadding, offset, kImageSize, kImageSize);
438 scoped_nsobject<NSImageView> imageView( 438 scoped_nsobject<NSImageView> imageView(
439 [[NSImageView alloc] initWithFrame:frame]); 439 [[NSImageView alloc] initWithFrame:frame]);
440 [imageView setImageFrameStyle:NSImageFrameNone]; 440 [imageView setImageFrameStyle:NSImageFrameNone];
441 [imageView setImage:*model_->GetIconImage(info.icon_id)]; 441 [imageView setImage:model_->GetIconImage(info.icon_id)->ToNSImage()];
442 [subviews addObject:imageView.get()]; 442 [subviews addObject:imageView.get()];
443 } 443 }
444 444
445 // Adds the help center button that explains the icons. Returns the y position 445 // Adds the help center button that explains the icons. Returns the y position
446 // delta for the next offset. 446 // delta for the next offset.
447 - (CGFloat)addHelpButtonToSubviews:(NSMutableArray*)subviews 447 - (CGFloat)addHelpButtonToSubviews:(NSMutableArray*)subviews
448 atOffset:(CGFloat)offset { 448 atOffset:(CGFloat)offset {
449 NSRect frame = NSMakeRect(kFramePadding, offset, 100, 10); 449 NSRect frame = NSMakeRect(kFramePadding, offset, 100, 10);
450 scoped_nsobject<NSButton> button([[NSButton alloc] initWithFrame:frame]); 450 scoped_nsobject<NSButton> button([[NSButton alloc] initWithFrame:frame]);
451 NSString* string = 451 NSString* string =
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 LocationBarViewMac* locationBar = [controller locationBarBridge]; 486 LocationBarViewMac* locationBar = [controller locationBarBridge];
487 if (locationBar) { 487 if (locationBar) {
488 NSPoint bubblePoint = locationBar->GetPageInfoBubblePoint(); 488 NSPoint bubblePoint = locationBar->GetPageInfoBubblePoint();
489 origin = [parent convertBaseToScreen:bubblePoint]; 489 origin = [parent convertBaseToScreen:bubblePoint];
490 } 490 }
491 } 491 }
492 return origin; 492 return origin;
493 } 493 }
494 494
495 @end 495 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm ('k') | chrome/browser/ui/cocoa/speech_recognition_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698