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

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

Issue 440493002: [Mac] Fix promo text background colour in the new avatar bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e1cf3e448d1f87627a81b1bbc714076b741a6c90..8824fd8f3791d8234a1ddc0ab8d1951c3c89c16e 100644
--- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
@@ -756,12 +756,10 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
- (NSView*)buildEndPreviewView;
// Creates a button with |text|, an icon given by |imageResourceId| and with
-// |action|. The icon |alternateImageResourceId| is displayed in the button's
-// hovered and pressed states.
+// |action|.
- (NSButton*)hoverButtonWithRect:(NSRect)rect
text:(NSString*)text
imageResourceId:(int)imageResourceId
- alternateImageResourceId:(int)alternateImageResourceId
action:(SEL)action;
// Creates a generic link button with |title| and an |action| positioned at
@@ -1431,7 +1429,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
NSTextField* promo = BuildLabel(
l10n_util::GetNSString(IDS_PROFILES_SIGNIN_PROMO),
NSMakePoint(0, NSMaxY([link frame]) + kVerticalSpacing),
- nil, nil);
+ GetDialogBackgroundColor(), nil);
[promo setFrameSize:NSMakeSize(rect.size.width, 0)];
[GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:promo];
[container addSubview:promo];
@@ -1514,7 +1512,6 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
text:l10n_util::GetNSString(
IDS_PROFILES_PROFILE_SIGNOUT_BUTTON)
imageResourceId:IDR_ICON_PROFILES_MENU_LOCK
- alternateImageResourceId:IDR_ICON_PROFILES_MENU_LOCK
action:@selector(lockProfile:)];
[container addSubview:lockButton];
viewRect.origin.y = NSMaxY([lockButton frame]);
@@ -1531,7 +1528,6 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
text:l10n_util::GetNSString(
IDS_PROFILES_GO_INCOGNITO_BUTTON)
imageResourceId:IDR_ICON_PROFILES_MENU_AVATAR
- alternateImageResourceId:IDR_ICON_PROFILES_MENU_AVATAR
action:@selector(goIncognito:)];
viewRect.origin.y = NSMaxY([goIncognitoButton frame]);
[container addSubview:goIncognitoButton];
@@ -1548,7 +1544,6 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
[self hoverButtonWithRect:viewRect
text:text
imageResourceId:IDR_ICON_PROFILES_MENU_AVATAR
- alternateImageResourceId:IDR_ICON_PROFILES_MENU_AVATAR
action:isGuestSession_? @selector(exitGuest:) :
@selector(showUserManager:)];
viewRect.origin.y = NSMaxY([switchUsersButton frame]);
@@ -1838,7 +1833,6 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
- (NSButton*)hoverButtonWithRect:(NSRect)rect
text:(NSString*)text
imageResourceId:(int)imageResourceId
- alternateImageResourceId:(int)alternateImageResourceId
action:(SEL)action {
base::scoped_nsobject<BackgroundColorHoverButton> button(
[[BackgroundColorHoverButton alloc]
@@ -1848,11 +1842,10 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
[button setTitle:text];
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
- NSImage* alternateImage = rb->GetNativeImageNamed(
- alternateImageResourceId).ToNSImage();
- [button setDefaultImage:rb->GetNativeImageNamed(imageResourceId).ToNSImage()];
- [button setHoverImage:alternateImage];
- [button setPressedImage:alternateImage];
+ NSImage* image = rb->GetNativeImageNamed(imageResourceId).ToNSImage();
+ [button setDefaultImage:image];
+ [button setHoverImage:image];
+ [button setPressedImage:image];
[button setImagePosition:NSImageLeft];
[button setAlignment:NSLeftTextAlignment];
[button setBordered:NO];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698