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

Side by Side Diff: chrome/browser/ui/cocoa/infobars/infobar_controller.mm

Issue 240193003: Move Infobars core files to the Infobars component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nib name on mac Created 6 years, 8 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 | Annotate | Revision Log
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/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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // If the menu is re-opened, prevent queries to update items. 155 // If the menu is re-opened, prevent queries to update items.
156 [menu setDelegate:nil]; 156 [menu setDelegate:nil];
157 157
158 // Prevent target/action messages to the controller. 158 // Prevent target/action messages to the controller.
159 for (NSMenuItem* item in [menu itemArray]) { 159 for (NSMenuItem* item in [menu itemArray]) {
160 [item setEnabled:NO]; 160 [item setEnabled:NO];
161 [item setTarget:nil]; 161 [item setTarget:nil];
162 } 162 }
163 } 163 }
164 164
165 - (InfoBarDelegate*)delegate { 165 - (infobars::InfoBarDelegate*)delegate {
166 return infobar_->delegate(); 166 return infobar_->delegate();
167 } 167 }
168 168
169 - (void)initializeLabel { 169 - (void)initializeLabel {
170 // Replace the label placeholder NSTextField with the real label NSTextView. 170 // Replace the label placeholder NSTextField with the real label NSTextView.
171 // The former doesn't show links in a nice way, but the latter can't be added 171 // The former doesn't show links in a nice way, but the latter can't be added
172 // in IB without a containing scroll view, so create the NSTextView 172 // in IB without a containing scroll view, so create the NSTextView
173 // programmatically. 173 // programmatically.
174 base::scoped_nsobject<HyperlinkTextView> newLabel( 174 base::scoped_nsobject<HyperlinkTextView> newLabel(
175 [[HyperlinkTextView alloc] initWithFrame:[labelPlaceholder_ frame]]); 175 [[HyperlinkTextView alloc] initWithFrame:[labelPlaceholder_ frame]]);
176 [newLabel setDrawsBackgroundUsingSuperview:YES]; 176 [newLabel setDrawsBackgroundUsingSuperview:YES];
177 [newLabel setAutoresizingMask:[labelPlaceholder_ autoresizingMask]]; 177 [newLabel setAutoresizingMask:[labelPlaceholder_ autoresizingMask]];
178 [[labelPlaceholder_ superview] 178 [[labelPlaceholder_ superview]
179 replaceSubview:labelPlaceholder_ with:newLabel]; 179 replaceSubview:labelPlaceholder_ with:newLabel];
180 labelPlaceholder_ = nil; // Now released. 180 labelPlaceholder_ = nil; // Now released.
181 [newLabel setDelegate:self]; 181 [newLabel setDelegate:self];
182 182
183 label_.reset(newLabel.release()); 183 label_.reset(newLabel.release());
184 } 184 }
185 185
186 @end 186 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/infobars/infobar_controller.h ('k') | chrome/browser/ui/cocoa/infobars/infobar_gradient_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698