| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |