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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.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/extensions/extension_installed_bubble_controlle r.h" 5 #import "chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controlle r.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 365
366 NSString* link(l10n_util::GetNSStringWithFixup( 366 NSString* link(l10n_util::GetNSStringWithFixup(
367 IDS_EXTENSION_INSTALLED_SIGNIN_PROMO_LINK)); 367 IDS_EXTENSION_INSTALLED_SIGNIN_PROMO_LINK));
368 NSString* message(l10n_util::GetNSStringWithFixup( 368 NSString* message(l10n_util::GetNSStringWithFixup(
369 IDS_EXTENSION_INSTALLED_SIGNIN_PROMO)); 369 IDS_EXTENSION_INSTALLED_SIGNIN_PROMO));
370 message = [link stringByAppendingString:message]; 370 message = [link stringByAppendingString:message];
371 371
372 HyperlinkTextView* view = promo_.get(); 372 HyperlinkTextView* view = promo_.get();
373 [view setMessage:message withFont:font messageColor:[NSColor blackColor]]; 373 [view setMessage:message withFont:font messageColor:[NSColor blackColor]];
374 [view addLinkRange:NSMakeRange(0, [link length]) 374 [view addLinkRange:NSMakeRange(0, [link length])
375 withName:@"" 375 withURL:@"about:blank" // using a link here is bad ui
376 linkColor:gfx::SkColorToCalibratedNSColor( 376 linkColor:gfx::SkColorToCalibratedNSColor(
377 chrome_style::GetLinkColor())]; 377 chrome_style::GetLinkColor())];
378 378
379 // HACK! The TextView does not report correct height even after you stuff 379 // HACK! The TextView does not report correct height even after you stuff
380 // it with text (it tells you it is single-line even if it is multiline), so 380 // it with text (it tells you it is single-line even if it is multiline), so
381 // here the hidden howToUse_ TextField is temporarily repurposed to 381 // here the hidden howToUse_ TextField is temporarily repurposed to
382 // calculate the correct height for the TextView. 382 // calculate the correct height for the TextView.
383 [[howToUse_ cell] setAttributedStringValue:[promo_ attributedString]]; 383 [[howToUse_ cell] setAttributedStringValue:[promo_ attributedString]];
384 [GTMUILocalizerAndLayoutTweaker 384 [GTMUILocalizerAndLayoutTweaker
385 sizeToFitFixedWidthTextField:howToUse_]; 385 sizeToFitFixedWidthTextField:howToUse_];
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 install_ui->OpenAppInstalledUI([self extension]->id()); 608 install_ui->OpenAppInstalledUI([self extension]->id());
609 } 609 }
610 610
611 - (void)awakeFromNib { 611 - (void)awakeFromNib {
612 if (bundle_) 612 if (bundle_)
613 return; 613 return;
614 [self initializeLabel]; 614 [self initializeLabel];
615 } 615 }
616 616
617 @end 617 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698