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

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

Issue 2697293003: [Mac RTL] Only tie the avatar button to the left side of the screen when it's moved to that side. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698