diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 02:40:27 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 02:40:27 +0000 |
commit | e659eb915610370c828a64ae2d82519cc10c60e7 (patch) | |
tree | 34833965b451d3cf3c0bead4a344592d3655963f /chrome | |
parent | fbec2b043867e69cf75476fa79586094def3672a (diff) | |
download | chromium_src-e659eb915610370c828a64ae2d82519cc10c60e7.zip chromium_src-e659eb915610370c828a64ae2d82519cc10c60e7.tar.gz chromium_src-e659eb915610370c828a64ae2d82519cc10c60e7.tar.bz2 |
Extension Install bubble signin-promo polish.
Addressing post-commit review comments made on this CL:
https://codereview.chromium.org/11997002/
BUG=164955
TEST=None
Review URL: https://chromiumcodereview.appspot.com/12084087
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180872 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.h | 3 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm | 22 |
2 files changed, 15 insertions, 10 deletions
diff --git a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.h b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.h index 5a9eb67..803a77d 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.h +++ b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.h @@ -14,6 +14,7 @@ class Browser; class ExtensionLoadedNotificationObserver; +@class HyperlinkTextView; @class HoverCloseButton; @class InfoBubbleView; @@ -90,7 +91,7 @@ typedef enum { // text views cannot conveniently be created in IB. The xib file contains // a text field |promoPlaceholder_| that's replaced by this text view |promo_| // in -awakeFromNib. - scoped_nsobject<NSTextView> promo_; + scoped_nsobject<HyperlinkTextView> promo_; // Only shown for bundle installs. IBOutlet NSTextField* installedHeadingMsg_; IBOutlet NSTextField* installedItemsMsg_; diff --git a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm index 32873ca..81beb7f 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm @@ -17,6 +17,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_navigator.h" #include "chrome/browser/ui/browser_window.h" +#include "chrome/browser/ui/chrome_style.h" #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" #include "chrome/browser/ui/cocoa/browser_window_controller.h" #include "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" @@ -439,26 +440,26 @@ class ExtensionLoadedNotificationObserver // First calculate the height of the sign-in promo. NSFont* font = [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]; - string16 link(l10n_util::GetStringFUTF16( + NSString* link(l10n_util::GetNSStringFWithFixup( IDS_EXTENSION_INSTALLED_SIGNIN_PROMO_LINK, l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME))); - string16 message(l10n_util::GetStringUTF16( - IDS_EXTENSION_INSTALLED_SIGNIN_PROMO)); + NSString* message(l10n_util::GetNSStringWithFixup( + IDS_EXTENSION_INSTALLED_SIGNIN_PROMO)); - HyperlinkTextView* view = (HyperlinkTextView*)promo_.get(); - [view setMessageAndLink:base::SysUTF16ToNSString(message) - withLink:base::SysUTF16ToNSString(link) + HyperlinkTextView* view = promo_.get(); + [view setMessageAndLink:message + withLink:link atOffset:0 font:font messageColor:[NSColor blackColor] - linkColor:[NSColor blueColor]]; + linkColor:gfx::SkColorToCalibratedNSColor( + chrome_style::GetLinkColor())]; // HACK! The TextView does not report correct height even after you stuff // it with text (it tells you it is single-line even if it is multiline), so // here the hidden howToUse_ TextField is temporarily repurposed to // calculate the correct height for the TextView. - [howToUse_ setStringValue:base::SysUTF16ToNSString(link + message)]; - [[howToUse_ cell] setFont:font]; + [[howToUse_ cell] setAttributedStringValue:[promo_ attributedString]]; [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:howToUse_]; sync_promo_height = NSHeight([howToUse_ frame]); @@ -533,6 +534,9 @@ class ExtensionLoadedNotificationObserver [manageShortcutLink_ setHidden:NO]; [[manageShortcutLink_ cell] setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; + [[manageShortcutLink_ cell] + setTextColor:gfx::SkColorToCalibratedNSColor( + chrome_style::GetLinkColor())]; [GTMUILocalizerAndLayoutTweaker sizeToFitView:manageShortcutLink_]; newWindowHeight += extension_installed_bubble::kInnerVerticalMargin; newWindowHeight += NSHeight([manageShortcutLink_ frame]); |