Chromium Code Reviews| Index: chrome/browser/ui/cocoa/bookmarks/bookmark_sync_promo_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_sync_promo_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_sync_promo_controller.mm |
| index 1b4249de3ac7eff41ffba0002e4bf32a3d6f0f8f..e58996d7ab42068c9ea725bfefd15fdd4ac965c3 100644 |
| --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_sync_promo_controller.mm |
| +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_sync_promo_controller.mm |
| @@ -81,21 +81,19 @@ const int kFontSize = 11; |
| const base::string16 promoText = l10n_util::GetStringFUTF16( |
| IDS_BOOKMARK_SYNC_PROMO_MESSAGE, |
| linkText, &offset); |
| - const base::string16 promoTextWithoutLink = |
| - promoText.substr(0, offset) + |
| - promoText.substr(offset + linkText.size()); |
| - |
| + NSString* nsPromoText = SysUTF16ToNSString(promoText); |
| + NSString* nsLinkText = SysUTF16ToNSString(linkText); |
|
Alexei Svitkine (slow)
2015/01/28 14:55:03
Use GetNSStringWithFixup instead of first getting
shrike
2015/01/28 17:35:04
That's a handy function, but the promoText = l10n
Alexei Svitkine (slow)
2015/01/28 17:36:58
Actually, I think the *Fixup variants aren't neede
|
| NSFont* font = [NSFont labelFontOfSize:kFontSize]; |
| NSColor* linkColor = gfx::SkColorToCalibratedNSColor( |
| chrome_style::GetLinkColor()); |
| textView_.reset([[HyperlinkTextView alloc] init]); |
| - [textView_ setMessageAndLink:base::SysUTF16ToNSString(promoTextWithoutLink) |
| - withLink:base::SysUTF16ToNSString(linkText) |
| - atOffset:offset |
| - font:font |
| - messageColor:gfx::SkColorToDeviceNSColor(kTextColor) |
| - linkColor:linkColor]; |
| + [textView_ setMessage:nsPromoText |
| + withFont:font |
| + messageColor:gfx::SkColorToDeviceNSColor(kTextColor)]; |
| + [textView_ addLinkRange:NSMakeRange(offset, [nsLinkText length]) |
| + withName:@"" |
| + linkColor:linkColor]; |
| [textView_ setRefusesFirstResponder:YES]; |
| [[textView_ textContainer] setLineFragmentPadding:0.0]; |
| RemoveUnderlining(textView_, offset, linkText.size()); |