OLD | NEW |
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/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 | 437 |
438 int sync_promo_height = 0; | 438 int sync_promo_height = 0; |
439 if ([self showSyncPromo]) { | 439 if ([self showSyncPromo]) { |
440 // First calculate the height of the sign-in promo. | 440 // First calculate the height of the sign-in promo. |
441 NSFont* font = [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]; | 441 NSFont* font = [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]; |
442 | 442 |
443 NSString* link(l10n_util::GetNSStringWithFixup( | 443 NSString* link(l10n_util::GetNSStringWithFixup( |
444 IDS_EXTENSION_INSTALLED_SIGNIN_PROMO_LINK)); | 444 IDS_EXTENSION_INSTALLED_SIGNIN_PROMO_LINK)); |
445 NSString* message(l10n_util::GetNSStringWithFixup( | 445 NSString* message(l10n_util::GetNSStringWithFixup( |
446 IDS_EXTENSION_INSTALLED_SIGNIN_PROMO)); | 446 IDS_EXTENSION_INSTALLED_SIGNIN_PROMO)); |
| 447 message = [link stringByAppendingString:message]; |
447 | 448 |
448 HyperlinkTextView* view = promo_.get(); | 449 HyperlinkTextView* view = promo_.get(); |
449 [view setMessageAndLink:message | 450 [view setMessage:message withFont:font messageColor:[NSColor blackColor]]; |
450 withLink:link | 451 [view addLinkRange:NSMakeRange(0, [link length]) |
451 atOffset:0 | 452 withName:@"" |
452 font:font | 453 linkColor:gfx::SkColorToCalibratedNSColor( |
453 messageColor:[NSColor blackColor] | 454 chrome_style::GetLinkColor())]; |
454 linkColor:gfx::SkColorToCalibratedNSColor( | |
455 chrome_style::GetLinkColor())]; | |
456 | 455 |
457 // HACK! The TextView does not report correct height even after you stuff | 456 // HACK! The TextView does not report correct height even after you stuff |
458 // it with text (it tells you it is single-line even if it is multiline), so | 457 // it with text (it tells you it is single-line even if it is multiline), so |
459 // here the hidden howToUse_ TextField is temporarily repurposed to | 458 // here the hidden howToUse_ TextField is temporarily repurposed to |
460 // calculate the correct height for the TextView. | 459 // calculate the correct height for the TextView. |
461 [[howToUse_ cell] setAttributedStringValue:[promo_ attributedString]]; | 460 [[howToUse_ cell] setAttributedStringValue:[promo_ attributedString]]; |
462 [GTMUILocalizerAndLayoutTweaker | 461 [GTMUILocalizerAndLayoutTweaker |
463 sizeToFitFixedWidthTextField:howToUse_]; | 462 sizeToFitFixedWidthTextField:howToUse_]; |
464 sync_promo_height = NSHeight([howToUse_ frame]); | 463 sync_promo_height = NSHeight([howToUse_ frame]); |
465 } | 464 } |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 install_ui->OpenAppInstalledUI(extension_->id()); | 696 install_ui->OpenAppInstalledUI(extension_->id()); |
698 } | 697 } |
699 | 698 |
700 - (void)awakeFromNib { | 699 - (void)awakeFromNib { |
701 if (bundle_) | 700 if (bundle_) |
702 return; | 701 return; |
703 [self initializeLabel]; | 702 [self initializeLabel]; |
704 } | 703 } |
705 | 704 |
706 @end | 705 @end |
OLD | NEW |