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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 2753633002: Properly pin the incognito avatar. (Closed)
Patch Set: Created 3 years, 9 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 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1645 NSView* view; 1645 NSView* view;
1646 if ([self shouldUseNewAvatarButton]) { 1646 if ([self shouldUseNewAvatarButton]) {
1647 avatarButtonController_.reset([[AvatarButtonController alloc] 1647 avatarButtonController_.reset([[AvatarButtonController alloc]
1648 initWithBrowser:browser_.get() 1648 initWithBrowser:browser_.get()
1649 window:[self window]]); 1649 window:[self window]]);
1650 } else { 1650 } else {
1651 avatarButtonController_.reset( 1651 avatarButtonController_.reset(
1652 [[AvatarIconController alloc] initWithBrowser:browser_.get()]); 1652 [[AvatarIconController alloc] initWithBrowser:browser_.get()]);
1653 } 1653 }
1654 view = [avatarButtonController_ view]; 1654 view = [avatarButtonController_ view];
1655 if (cocoa_l10n_util::ShouldFlipWindowControlsInRTL())
1656 [view setAutoresizingMask:NSViewMaxXMargin | NSViewMinYMargin];
1657 else
1658 [view setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin];
1655 [view setHidden:![self shouldShowAvatar]]; 1659 [view setHidden:![self shouldShowAvatar]];
1656 1660
1657 // Install the view. 1661 // Install the view.
1658 [[[self window] contentView] addSubview:view]; 1662 [[[self window] contentView] addSubview:view];
1659 } 1663 }
1660 1664
1661 // Called when we get a three-finger swipe. 1665 // Called when we get a three-finger swipe.
1662 - (void)swipeWithEvent:(NSEvent*)event { 1666 - (void)swipeWithEvent:(NSEvent*)event {
1663 CGFloat deltaX = [event deltaX]; 1667 CGFloat deltaX = [event deltaX];
1664 CGFloat deltaY = [event deltaY]; 1668 CGFloat deltaY = [event deltaY];
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
2026 2030
2027 - (NSRect)savedRegularWindowFrame { 2031 - (NSRect)savedRegularWindowFrame {
2028 return savedRegularWindowFrame_; 2032 return savedRegularWindowFrame_;
2029 } 2033 }
2030 2034
2031 - (BOOL)isFullscreenTransitionInProgress { 2035 - (BOOL)isFullscreenTransitionInProgress {
2032 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; 2036 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_;
2033 } 2037 }
2034 2038
2035 @end // @implementation BrowserWindowController(WindowType) 2039 @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