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

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

Issue 6296003: Mac: Fix crash when clicking on zombie translate options menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/mac_util.h" 8 #include "base/mac/mac_util.h"
9 #include "base/sys_string_conversions.h" 9 #include "base/sys_string_conversions.h"
10 #include "chrome/browser/tab_contents/infobar_delegate.h" 10 #include "chrome/browser/tab_contents/infobar_delegate.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 // The above call may trigger an animationDidStop: notification for any 190 // The above call may trigger an animationDidStop: notification for any
191 // currently-running animations, so do not set |infoBarClosing_| until after 191 // currently-running animations, so do not set |infoBarClosing_| until after
192 // starting the animation. 192 // starting the animation.
193 infoBarClosing_ = YES; 193 infoBarClosing_ = YES;
194 } 194 }
195 195
196 - (void)addAdditionalControls { 196 - (void)addAdditionalControls {
197 // Default implementation does nothing. 197 // Default implementation does nothing.
198 } 198 }
199 199
200 - (void)infobarWillClose {
201 // Default implementation does nothing.
202 }
203
200 - (void)setLabelToMessage:(NSString*)message { 204 - (void)setLabelToMessage:(NSString*)message {
201 NSMutableDictionary* attributes = [NSMutableDictionary dictionary]; 205 NSMutableDictionary* attributes = [NSMutableDictionary dictionary];
202 NSFont* font = [NSFont labelFontOfSize: 206 NSFont* font = [NSFont labelFontOfSize:
203 [NSFont systemFontSizeForControlSize:NSRegularControlSize]]; 207 [NSFont systemFontSizeForControlSize:NSRegularControlSize]];
204 [attributes setObject:font 208 [attributes setObject:font
205 forKey:NSFontAttributeName]; 209 forKey:NSFontAttributeName];
206 [attributes setObject:[NSCursor arrowCursor] 210 [attributes setObject:[NSCursor arrowCursor]
207 forKey:NSCursorAttributeName]; 211 forKey:NSCursorAttributeName];
208 scoped_nsobject<NSAttributedString> attributedString( 212 scoped_nsobject<NSAttributedString> attributedString(
209 [[NSAttributedString alloc] initWithString:message 213 [[NSAttributedString alloc] initWithString:message
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 LinkInfoBarController* controller = 528 LinkInfoBarController* controller =
525 [[LinkInfoBarController alloc] initWithDelegate:this]; 529 [[LinkInfoBarController alloc] initWithDelegate:this];
526 return new InfoBar(controller); 530 return new InfoBar(controller);
527 } 531 }
528 532
529 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { 533 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() {
530 ConfirmInfoBarController* controller = 534 ConfirmInfoBarController* controller =
531 [[ConfirmInfoBarController alloc] initWithDelegate:this]; 535 [[ConfirmInfoBarController alloc] initWithDelegate:this];
532 return new InfoBar(controller); 536 return new InfoBar(controller);
533 } 537 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/infobar_controller.h ('k') | chrome/browser/ui/cocoa/translate/translate_infobar_base.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698