| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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) |
| OLD | NEW |