Chromium Code Reviews| 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 "chrome/browser/ui/cocoa/infobars/infobar_controller.h" | 5 #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 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 "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 labelFrame.origin.x = imageFrame.origin.x; | 62 labelFrame.origin.x = imageFrame.origin.x; |
| 63 [image_ removeFromSuperview]; | 63 [image_ removeFromSuperview]; |
| 64 image_ = nil; | 64 image_ = nil; |
| 65 [labelPlaceholder_ setFrame:labelFrame]; | 65 [labelPlaceholder_ setFrame:labelFrame]; |
| 66 } | 66 } |
| 67 [self initializeLabel]; | 67 [self initializeLabel]; |
| 68 | 68 |
| 69 [self addAdditionalControls]; | 69 [self addAdditionalControls]; |
| 70 | 70 |
| 71 [infoBarView_ setInfobarType:[self delegate]->GetInfoBarType()]; | 71 [infoBarView_ setInfobarType:[self delegate]->GetInfoBarType()]; |
| 72 [infoBarView_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; | |
|
Malcolm
2014/08/08 10:51:51
Using -setAutoresizingMask: to let the view be red
| |
| 72 } | 73 } |
| 73 | 74 |
| 74 - (void)dealloc { | 75 - (void)dealloc { |
| 75 [okButton_ setTarget:nil]; | 76 [okButton_ setTarget:nil]; |
| 76 [cancelButton_ setTarget:nil]; | 77 [cancelButton_ setTarget:nil]; |
| 77 [closeButton_ setTarget:nil]; | 78 [closeButton_ setTarget:nil]; |
| 78 [super dealloc]; | 79 [super dealloc]; |
| 79 } | 80 } |
| 80 | 81 |
| 81 - (InfoBarCocoa*)infobar { | 82 - (InfoBarCocoa*)infobar { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 [newLabel setAutoresizingMask:[labelPlaceholder_ autoresizingMask]]; | 178 [newLabel setAutoresizingMask:[labelPlaceholder_ autoresizingMask]]; |
| 178 [[labelPlaceholder_ superview] | 179 [[labelPlaceholder_ superview] |
| 179 replaceSubview:labelPlaceholder_ with:newLabel]; | 180 replaceSubview:labelPlaceholder_ with:newLabel]; |
| 180 labelPlaceholder_ = nil; // Now released. | 181 labelPlaceholder_ = nil; // Now released. |
| 181 [newLabel setDelegate:self]; | 182 [newLabel setDelegate:self]; |
| 182 | 183 |
| 183 label_.reset(newLabel.release()); | 184 label_.reset(newLabel.release()); |
| 184 } | 185 } |
| 185 | 186 |
| 186 @end | 187 @end |
| OLD | NEW |