| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 button_.reset(avatarButton); | 164 button_.reset(avatarButton); |
| 165 base::scoped_nsobject<CustomThemeButtonCell> cell( | 165 base::scoped_nsobject<CustomThemeButtonCell> cell( |
| 166 [[CustomThemeButtonCell alloc] initWithThemedWindow:isThemedWindow_]); | 166 [[CustomThemeButtonCell alloc] initWithThemedWindow:isThemedWindow_]); |
| 167 [avatarButton setCell:cell.get()]; | 167 [avatarButton setCell:cell.get()]; |
| 168 | 168 |
| 169 [avatarButton setWantsLayer:YES]; | 169 [avatarButton setWantsLayer:YES]; |
| 170 [self setView:avatarButton]; | 170 [self setView:avatarButton]; |
| 171 | 171 |
| 172 [avatarButton setBezelStyle:NSShadowlessSquareBezelStyle]; | 172 [avatarButton setBezelStyle:NSShadowlessSquareBezelStyle]; |
| 173 [avatarButton setButtonType:NSMomentaryChangeButton]; | 173 [avatarButton setButtonType:NSMomentaryChangeButton]; |
| 174 if (switches::IsMaterialDesignUserMenu()) |
| 175 [[avatarButton cell] setHighlightsBy:NSNoCellMask]; |
| 174 [avatarButton setBordered:YES]; | 176 [avatarButton setBordered:YES]; |
| 175 | 177 |
| 176 [avatarButton setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin]; | 178 [avatarButton setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin]; |
| 177 [avatarButton setTarget:self]; | 179 [avatarButton setTarget:self]; |
| 178 [avatarButton setAction:@selector(buttonClicked:)]; | 180 [avatarButton setAction:@selector(buttonClicked:)]; |
| 179 [avatarButton setRightAction:@selector(buttonRightClicked:)]; | 181 [avatarButton setRightAction:@selector(buttonRightClicked:)]; |
| 180 | 182 |
| 181 // Check if the account already has an authentication or sync error and | 183 // Check if the account already has an authentication or sync error and |
| 182 // initialize the avatar button UI. | 184 // initialize the avatar button UI. |
| 183 hasError_ = profileObserver_->HasAvatarError(); | 185 hasError_ = profileObserver_->HasAvatarError(); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 layoutSubviews]; | 301 layoutSubviews]; |
| 300 } | 302 } |
| 301 } | 303 } |
| 302 | 304 |
| 303 - (void)setErrorStatus:(BOOL)hasError { | 305 - (void)setErrorStatus:(BOOL)hasError { |
| 304 hasError_ = hasError; | 306 hasError_ = hasError; |
| 305 [self updateAvatarButtonAndLayoutParent:YES]; | 307 [self updateAvatarButtonAndLayoutParent:YES]; |
| 306 } | 308 } |
| 307 | 309 |
| 308 @end | 310 @end |
| OLD | NEW |