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

Unified Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 887823002: Finished swap out of old API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unit test for [HyperlinkTextView setMessageAndLink:withLink:atOffset:font:messageColor:linkC… Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
index cbdbc703cd1c1592f58d667de3fac489f5371169..9322d97d1aa5966c7f3d89ce67a6c09023c78e9d 100644
--- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
@@ -166,14 +166,17 @@ NSTextView* BuildFixedWidthTextViewWithLink(
[[HyperlinkTextView alloc] initWithFrame:NSZeroRect]);
NSColor* link_color = gfx::SkColorToCalibratedNSColor(
chrome_style::GetLinkColor());
+ NSMutableString* finalMessage =
+ [NSMutableString stringWithFormat:@"%@\n", message];
+ [finalMessage insertString:link atIndex:link_offset];
// Adds a padding row at the bottom, because |boundingRectWithSize| below cuts
// off the last row sometimes.
- [text_view setMessageAndLink:[NSString stringWithFormat:@"%@\n", message]
- withLink:link
- atOffset:link_offset
- font:[NSFont labelFontOfSize:kTextFontSize]
- messageColor:[NSColor blackColor]
- linkColor:link_color];
+ [text_view setMessage:finalMessage
+ withFont:[NSFont labelFontOfSize:kTextFontSize]
+ messageColor:[NSColor blackColor]];
+ [text_view addLinkRange:NSMakeRange(link_offset, [link length])
+ withName:@""
+ linkColor:link_color];
// Removes the underlining from the link.
[text_view setLinkTextAttributes:nil];

Powered by Google App Engine
This is Rietveld 408576698