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

Side by Side Diff: chrome/browser/ui/cocoa/infobars/infobar_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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/logging.h" // for NOTREACHED() 7 #include "base/logging.h" // for NOTREACHED()
8 #include "base/mac/bundle_locations.h" 8 #include "base/mac/bundle_locations.h"
9 #include "base/mac/mac_util.h" 9 #include "base/mac/mac_util.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 [[closeButton_ cell] setImageID:IDR_CLOSE_BAR 71 [[closeButton_ cell] setImageID:IDR_CLOSE_BAR
72 forButtonState:image_button_cell::kDefaultState]; 72 forButtonState:image_button_cell::kDefaultState];
73 [[closeButton_ cell] setImageID:IDR_CLOSE_BAR_H 73 [[closeButton_ cell] setImageID:IDR_CLOSE_BAR_H
74 forButtonState:image_button_cell::kHoverState]; 74 forButtonState:image_button_cell::kHoverState];
75 [[closeButton_ cell] setImageID:IDR_CLOSE_BAR_P 75 [[closeButton_ cell] setImageID:IDR_CLOSE_BAR_P
76 forButtonState:image_button_cell::kPressedState]; 76 forButtonState:image_button_cell::kPressedState];
77 [[closeButton_ cell] setImageID:IDR_CLOSE_BAR 77 [[closeButton_ cell] setImageID:IDR_CLOSE_BAR
78 forButtonState:image_button_cell::kDisabledState]; 78 forButtonState:image_button_cell::kDisabledState];
79 79
80 if (delegate_->GetIcon()) { 80 if (delegate_->GetIcon()) {
81 [image_ setImage:*(delegate_->GetIcon())]; 81 [image_ setImage:delegate_->GetIcon()->ToNSImage()];
82 } else { 82 } else {
83 // No icon, remove it from the view and grow the textfield to include the 83 // No icon, remove it from the view and grow the textfield to include the
84 // space. 84 // space.
85 NSRect imageFrame = [image_ frame]; 85 NSRect imageFrame = [image_ frame];
86 NSRect labelFrame = [labelPlaceholder_ frame]; 86 NSRect labelFrame = [labelPlaceholder_ frame];
87 labelFrame.size.width += NSMinX(imageFrame) - NSMinX(labelFrame); 87 labelFrame.size.width += NSMinX(imageFrame) - NSMinX(labelFrame);
88 labelFrame.origin.x = imageFrame.origin.x; 88 labelFrame.origin.x = imageFrame.origin.x;
89 [image_ removeFromSuperview]; 89 [image_ removeFromSuperview];
90 image_ = nil; 90 image_ = nil;
91 [labelPlaceholder_ setFrame:labelFrame]; 91 [labelPlaceholder_ setFrame:labelFrame];
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 LinkInfoBarController* controller = 467 LinkInfoBarController* controller =
468 [[LinkInfoBarController alloc] initWithDelegate:this owner:owner]; 468 [[LinkInfoBarController alloc] initWithDelegate:this owner:owner];
469 return new InfoBar(controller, this); 469 return new InfoBar(controller, this);
470 } 470 }
471 471
472 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { 472 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(InfoBarService* owner) {
473 ConfirmInfoBarController* controller = 473 ConfirmInfoBarController* controller =
474 [[ConfirmInfoBarController alloc] initWithDelegate:this owner:owner]; 474 [[ConfirmInfoBarController alloc] initWithDelegate:this owner:owner];
475 return new InfoBar(controller, this); 475 return new InfoBar(controller, this);
476 } 476 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698