Chromium Code Reviews| Index: chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm |
| index 6affa4e9005b429fdb7e18a58ad91c48951f8cfc..605b4058537743800b42de4579d019d88e6cb2f3 100644 |
| --- a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm |
| +++ b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm |
| @@ -108,20 +108,22 @@ |
| // Set the text and link. |
| NSString* message = base::SysUTF16ToNSString(delegate->GetMessageText()); |
| - base::string16 link = delegate->GetLinkText(); |
| - if (!link.empty()) { |
| + NSString* link = base::SysUTF16ToNSString(delegate->GetLinkText()); |
| + NSUInteger linkOffset = [message length]; |
| + NSUInteger linkLength = [link length]; |
| + if (linkLength != 0) { |
| // Add spacing between the label and the link. |
| - message = [message stringByAppendingString:@" "]; |
| + message = [message stringByAppendingFormat:@" %@", link]; |
| } |
| NSFont* font = [NSFont labelFontOfSize: |
| - [NSFont systemFontSizeForControlSize:NSRegularControlSize]]; |
| + [NSFont systemFontSizeForControlSize:NSRegularControlSize]]; |
|
groby-ooo-7-16
2015/01/30 23:08:39
I suppose this is "git cl format"'s doing?
shrike
2015/02/02 17:39:13
No - me learning the style guide. Done.
|
| HyperlinkTextView* view = (HyperlinkTextView*)label_.get(); |
| - [view setMessageAndLink:message |
| - withLink:base::SysUTF16ToNSString(link) |
| - atOffset:[message length] |
| - font:font |
| - messageColor:[NSColor blackColor] |
| - linkColor:[NSColor blueColor]]; |
| + [view setMessage:message withFont:font messageColor:[NSColor blackColor]]; |
| + if (linkLength != 0) { |
| + [view addLinkRange:NSMakeRange(linkOffset, linkLength) |
| + withName:@"" |
| + linkColor:[NSColor blueColor]]; |
| + } |
| } |
| // Called when someone clicks on the link in the infobar. This method |