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