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

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

Issue 2743393002: 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 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 NSView* view; 1655 NSView* view;
1656 if ([self shouldUseNewAvatarButton]) { 1656 if ([self shouldUseNewAvatarButton]) {
1657 avatarButtonController_.reset([[AvatarButtonController alloc] 1657 avatarButtonController_.reset([[AvatarButtonController alloc]
1658 initWithBrowser:browser_.get() 1658 initWithBrowser:browser_.get()
1659 window:[self window]]); 1659 window:[self window]]);
1660 } else { 1660 } else {
1661 avatarButtonController_.reset( 1661 avatarButtonController_.reset(
1662 [[AvatarIconController alloc] initWithBrowser:browser_.get()]); 1662 [[AvatarIconController alloc] initWithBrowser:browser_.get()]);
1663 } 1663 }
1664 view = [avatarButtonController_ view]; 1664 view = [avatarButtonController_ view];
1665 if (cocoa_l10n_util::ShouldFlipWindowControlsInRTL())
1666 [view setAutoresizingMask:NSViewMaxXMargin | NSViewMinYMargin];
1667 else
1668 [view setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin];
1665 [view setHidden:![self shouldShowAvatar]]; 1669 [view setHidden:![self shouldShowAvatar]];
1666 1670
1667 // Install the view. 1671 // Install the view.
1668 [[[self window] contentView] addSubview:view]; 1672 [[[self window] contentView] addSubview:view];
1669 } 1673 }
1670 1674
1671 // Called when we get a three-finger swipe. 1675 // Called when we get a three-finger swipe.
1672 - (void)swipeWithEvent:(NSEvent*)event { 1676 - (void)swipeWithEvent:(NSEvent*)event {
1673 CGFloat deltaX = [event deltaX]; 1677 CGFloat deltaX = [event deltaX];
1674 CGFloat deltaY = [event deltaY]; 1678 CGFloat deltaY = [event deltaY];
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
2030 2034
2031 - (NSRect)savedRegularWindowFrame { 2035 - (NSRect)savedRegularWindowFrame {
2032 return savedRegularWindowFrame_; 2036 return savedRegularWindowFrame_;
2033 } 2037 }
2034 2038
2035 - (BOOL)isFullscreenTransitionInProgress { 2039 - (BOOL)isFullscreenTransitionInProgress {
2036 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_; 2040 return enteringAppKitFullscreen_ || exitingAppKitFullscreen_;
2037 } 2041 }
2038 2042
2039 @end // @implementation BrowserWindowController(WindowType) 2043 @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