Chromium Code Reviews| Index: chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm |
| index 30d1e79d32b685c2be0f8ca8062811547afec0a6..e524007b776a0b7ab578b4409a31b88dae931711 100644 |
| --- a/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm |
| +++ b/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm |
| @@ -29,16 +29,17 @@ |
| DCHECK(delegate); |
| size_t offset = base::string16::npos; |
| base::string16 message = delegate->GetMessageTextWithOffset(&offset); |
| - base::string16 link = delegate->GetLinkText(); |
| + NSMutableString* finalMessage = |
|
groby-ooo-7-16
2015/01/30 23:08:39
I'd suggest doing the string composition in C++ in
shrike
2015/02/02 17:39:13
I agree. Done.
|
| + [NSMutableString stringWithString:base::SysUTF16ToNSString(message)]; |
| + NSString* link = base::SysUTF16ToNSString(delegate->GetLinkText()); |
| + [finalMessage insertString:link atIndex:offset]; |
| NSFont* font = [NSFont labelFontOfSize: |
| - [NSFont systemFontSizeForControlSize:NSRegularControlSize]]; |
| + [NSFont systemFontSizeForControlSize:NSRegularControlSize]]; |
| HyperlinkTextView* view = (HyperlinkTextView*)label_.get(); |
| - [view setMessageAndLink:base::SysUTF16ToNSString(message) |
| - withLink:base::SysUTF16ToNSString(link) |
| - atOffset:offset |
| - font:font |
| - messageColor:[NSColor blackColor] |
| - linkColor:[NSColor blueColor]]; |
| + [view setMessage:finalMessage withFont:font messageColor:[NSColor blackColor]]; |
| + [view addLinkRange:NSMakeRange(offset, [link length]) |
| + withName:@"" |
| + linkColor:[NSColor blueColor]]; |
| } |
| // Called when someone clicks on the link in the infobar. This method |