| 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/confirm_bubble_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/confirm_bubble_cocoa.h" |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "chrome/browser/themes/theme_service.h" | 8 #include "chrome/browser/themes/theme_service.h" |
| 9 #import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" | 9 #import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" |
| 10 #include "chrome/browser/ui/confirm_bubble.h" | 10 #include "chrome/browser/ui/confirm_bubble.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 NSString* messageText = [controller_ messageText]; | 207 NSString* messageText = [controller_ messageText]; |
| 208 NSMutableDictionary* attributes = [NSMutableDictionary dictionary]; | 208 NSMutableDictionary* attributes = [NSMutableDictionary dictionary]; |
| 209 base::scoped_nsobject<NSMutableAttributedString> attributedMessage( | 209 base::scoped_nsobject<NSMutableAttributedString> attributedMessage( |
| 210 [[NSMutableAttributedString alloc] initWithString:messageText | 210 [[NSMutableAttributedString alloc] initWithString:messageText |
| 211 attributes:attributes]); | 211 attributes:attributes]); |
| 212 NSString* linkText = [controller_ linkText]; | 212 NSString* linkText = [controller_ linkText]; |
| 213 if (linkText) { | 213 if (linkText) { |
| 214 base::scoped_nsobject<NSAttributedString> whiteSpace( | 214 base::scoped_nsobject<NSAttributedString> whiteSpace( |
| 215 [[NSAttributedString alloc] initWithString:@" "]); | 215 [[NSAttributedString alloc] initWithString:@" "]); |
| 216 [attributedMessage.get() appendAttributedString:whiteSpace.get()]; | 216 [attributedMessage.get() appendAttributedString:whiteSpace.get()]; |
| 217 [attributes setObject:[NSString string] | 217 [attributes setObject:[controller_ linkURL] |
| 218 forKey:NSLinkAttributeName]; | 218 forKey:NSLinkAttributeName]; |
| 219 base::scoped_nsobject<NSAttributedString> attributedLink( | 219 base::scoped_nsobject<NSAttributedString> attributedLink( |
| 220 [[NSAttributedString alloc] initWithString:linkText | 220 [[NSAttributedString alloc] initWithString:linkText |
| 221 attributes:attributes]); | 221 attributes:attributes]); |
| 222 [attributedMessage.get() appendAttributedString:attributedLink.get()]; | 222 [attributedMessage.get() appendAttributedString:attributedLink.get()]; |
| 223 } | 223 } |
| 224 [[messageLabel_.get() textStorage] setAttributedString:attributedMessage]; | 224 [[messageLabel_.get() textStorage] setAttributedString:attributedMessage]; |
| 225 [messageLabel_.get() setHorizontallyResizable:NO]; | 225 [messageLabel_.get() setHorizontallyResizable:NO]; |
| 226 [messageLabel_.get() setVerticallyResizable:YES]; | 226 [messageLabel_.get() setVerticallyResizable:YES]; |
| 227 [messageLabel_.get() setEditable:NO]; | 227 [messageLabel_.get() setEditable:NO]; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 275 |
| 276 - (void)clickCancel { | 276 - (void)clickCancel { |
| 277 [self cancel:self]; | 277 [self cancel:self]; |
| 278 } | 278 } |
| 279 | 279 |
| 280 - (void)clickLink { | 280 - (void)clickLink { |
| 281 [self textView:messageLabel_.get() clickedOnLink:nil atIndex:0]; | 281 [self textView:messageLabel_.get() clickedOnLink:nil atIndex:0]; |
| 282 } | 282 } |
| 283 | 283 |
| 284 @end | 284 @end |
| OLD | NEW |