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

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

Issue 1364113003: Only (and always) put URLs in NSLinkAttributeName. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@infobar1
Patch Set: stray deletion Created 5 years, 2 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
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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698