| 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 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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) |
| OLD | NEW |