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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm

Issue 2197253002: [Mac][MD User Menu] UI Tweaks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put the change behind flag Created 4 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/profiles/avatar_button_controller.h" 5 #import "chrome/browser/ui/cocoa/profiles/avatar_button_controller.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile_attributes_entry.h" 10 #include "chrome/browser/profiles/profile_attributes_entry.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // Check if the account already has an authentication error. 166 // Check if the account already has an authentication error.
167 SigninErrorController* errorController = 167 SigninErrorController* errorController =
168 profiles::GetSigninErrorController(browser->profile()); 168 profiles::GetSigninErrorController(browser->profile());
169 hasError_ = errorController && errorController->HasError(); 169 hasError_ = errorController && errorController->HasError();
170 170
171 [avatarButton setWantsLayer:YES]; 171 [avatarButton setWantsLayer:YES];
172 [self setView:avatarButton]; 172 [self setView:avatarButton];
173 173
174 [avatarButton setBezelStyle:NSShadowlessSquareBezelStyle]; 174 [avatarButton setBezelStyle:NSShadowlessSquareBezelStyle];
175 [avatarButton setButtonType:NSMomentaryChangeButton]; 175 [avatarButton setButtonType:NSMomentaryChangeButton];
176 if (switches::IsMaterialDesignUserMenu())
177 [[avatarButton cell] setHighlightsBy:NSNoCellMask];
176 [avatarButton setBordered:YES]; 178 [avatarButton setBordered:YES];
177 179
178 [avatarButton setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin]; 180 [avatarButton setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin];
179 [avatarButton setTarget:self]; 181 [avatarButton setTarget:self];
180 [avatarButton setAction:@selector(buttonClicked:)]; 182 [avatarButton setAction:@selector(buttonClicked:)];
181 [avatarButton setRightAction:@selector(buttonRightClicked:)]; 183 [avatarButton setRightAction:@selector(buttonRightClicked:)];
182 184
183 [self updateAvatarButtonAndLayoutParent:NO]; 185 [self updateAvatarButtonAndLayoutParent:NO];
184 186
185 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; 187 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 layoutSubviews]; 297 layoutSubviews];
296 } 298 }
297 } 299 }
298 300
299 - (void)updateErrorStatus:(BOOL)hasError { 301 - (void)updateErrorStatus:(BOOL)hasError {
300 hasError_ = hasError; 302 hasError_ = hasError;
301 [self updateAvatarButtonAndLayoutParent:YES]; 303 [self updateAvatarButtonAndLayoutParent:YES];
302 } 304 }
303 305
304 @end 306 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698