| 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 #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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |