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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_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 | « no previous file | chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/browser_window_controller.h" 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <numeric> 8 #include <numeric>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 NSView* view; 1644 NSView* view;
1645 if ([self shouldUseNewAvatarButton]) { 1645 if ([self shouldUseNewAvatarButton]) {
1646 avatarButtonController_.reset([[AvatarButtonController alloc] 1646 avatarButtonController_.reset([[AvatarButtonController alloc]
1647 initWithBrowser:browser_.get() 1647 initWithBrowser:browser_.get()
1648 window:[self window]]); 1648 window:[self window]]);
1649 } else { 1649 } else {
1650 avatarButtonController_.reset( 1650 avatarButtonController_.reset(
1651 [[AvatarIconController alloc] initWithBrowser:browser_.get()]); 1651 [[AvatarIconController alloc] initWithBrowser:browser_.get()]);
1652 } 1652 }
1653 view = [avatarButtonController_ view]; 1653 view = [avatarButtonController_ view];
1654 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout())
1655 [view setAutoresizingMask:NSViewMaxXMargin | NSViewMinYMargin];
1656 else
1657 [view setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin];
1658 [view setHidden:![self shouldShowAvatar]]; 1654 [view setHidden:![self shouldShowAvatar]];
1659 1655
1660 // Install the view. 1656 // Install the view.
1661 [[[self window] contentView] addSubview:view]; 1657 [[[self window] contentView] addSubview:view];
1662 } 1658 }
1663 1659
1664 // Called when we get a three-finger swipe. 1660 // Called when we get a three-finger swipe.
1665 - (void)swipeWithEvent:(NSEvent*)event { 1661 - (void)swipeWithEvent:(NSEvent*)event {
1666 CGFloat deltaX = [event deltaX]; 1662 CGFloat deltaX = [event deltaX];
1667 CGFloat deltaY = [event deltaY]; 1663 CGFloat deltaY = [event deltaY];
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
2014 2010
2015 - (NSRect)savedRegularWindowFrame { 2011 - (NSRect)savedRegularWindowFrame {
2016 return savedRegularWindowFrame_; 2012 return savedRegularWindowFrame_;
2017 } 2013 }
2018 2014
2019 - (BOOL)isFullscreenTransitionInProgress { 2015 - (BOOL)isFullscreenTransitionInProgress {
2020 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; 2016 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_;
2021 } 2017 }
2022 2018
2023 @end // @implementation BrowserWindowController(WindowType) 2019 @end // @implementation BrowserWindowController(WindowType)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698