| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 [avatarButton setWantsLayer:YES]; | 180 [avatarButton setWantsLayer:YES]; |
| 181 [self setView:avatarButton]; | 181 [self setView:avatarButton]; |
| 182 | 182 |
| 183 [avatarButton setBezelStyle:NSShadowlessSquareBezelStyle]; | 183 [avatarButton setBezelStyle:NSShadowlessSquareBezelStyle]; |
| 184 [avatarButton setButtonType:NSMomentaryChangeButton]; | 184 [avatarButton setButtonType:NSMomentaryChangeButton]; |
| 185 if (switches::IsMaterialDesignUserMenu()) | 185 if (switches::IsMaterialDesignUserMenu()) |
| 186 [[avatarButton cell] setHighlightsBy:NSNoCellMask]; | 186 [[avatarButton cell] setHighlightsBy:NSNoCellMask]; |
| 187 [avatarButton setBordered:YES]; | 187 [avatarButton setBordered:YES]; |
| 188 | 188 |
| 189 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) | 189 if (cocoa_l10n_util::ShouldFlipWindowControlsInRTL()) |
| 190 [avatarButton setAutoresizingMask:NSViewMaxXMargin | NSViewMinYMargin]; | 190 [avatarButton setAutoresizingMask:NSViewMaxXMargin | NSViewMinYMargin]; |
| 191 else | 191 else |
| 192 [avatarButton setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin]; | 192 [avatarButton setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin]; |
| 193 [avatarButton setTarget:self]; | 193 [avatarButton setTarget:self]; |
| 194 [avatarButton setAction:@selector(buttonClicked:)]; | 194 [avatarButton setAction:@selector(buttonClicked:)]; |
| 195 [avatarButton setRightAction:@selector(buttonClicked:)]; | 195 [avatarButton setRightAction:@selector(buttonClicked:)]; |
| 196 | 196 |
| 197 // Check if the account already has an authentication or sync error and | 197 // Check if the account already has an authentication or sync error and |
| 198 // initialize the avatar button UI. | 198 // initialize the avatar button UI. |
| 199 hasError_ = profileObserver_->HasAvatarError(); | 199 hasError_ = profileObserver_->HasAvatarError(); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 } | 344 } |
| 345 | 345 |
| 346 - (void)bubbleWillClose:(NSNotification*)notif { | 346 - (void)bubbleWillClose:(NSNotification*)notif { |
| 347 AvatarButton* button = base::mac::ObjCCastStrict<AvatarButton>(button_); | 347 AvatarButton* button = base::mac::ObjCCastStrict<AvatarButton>(button_); |
| 348 [button setIsActive:NO]; | 348 [button setIsActive:NO]; |
| 349 [self updateAvatarButtonAndLayoutParent:NO]; | 349 [self updateAvatarButtonAndLayoutParent:NO]; |
| 350 [super bubbleWillClose:notif]; | 350 [super bubbleWillClose:notif]; |
| 351 } | 351 } |
| 352 | 352 |
| 353 @end | 353 @end |
| OLD | NEW |