| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/tabs/tab_strip_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 6 | 6 |
| 7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 2241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2252 BOOL isRTL = cocoa_l10n_util::ShouldDoExperimentalRTLLayout(); | 2252 BOOL isRTL = cocoa_l10n_util::ShouldDoExperimentalRTLLayout(); |
| 2253 if (!customWindowControls_) { | 2253 if (!customWindowControls_) { |
| 2254 // Make the container view. | 2254 // Make the container view. |
| 2255 CGFloat height = NSHeight([tabStripView_ frame]); | 2255 CGFloat height = NSHeight([tabStripView_ frame]); |
| 2256 CGFloat width = [self leadingIndentForControls]; | 2256 CGFloat width = [self leadingIndentForControls]; |
| 2257 CGFloat xOrigin = isRTL ? NSWidth([tabStripView_ frame]) - width : 0; | 2257 CGFloat xOrigin = isRTL ? NSWidth([tabStripView_ frame]) - width : 0; |
| 2258 NSRect frame = NSMakeRect(xOrigin, 0, width, height); | 2258 NSRect frame = NSMakeRect(xOrigin, 0, width, height); |
| 2259 customWindowControls_.reset( | 2259 customWindowControls_.reset( |
| 2260 [[CustomWindowControlsView alloc] initWithFrame:frame]); | 2260 [[CustomWindowControlsView alloc] initWithFrame:frame]); |
| 2261 [customWindowControls_ | 2261 [customWindowControls_ |
| 2262 setAutoresizingMask:isRTL ? NSViewMaxXMargin | NSViewHeightSizable | 2262 setAutoresizingMask:isRTL ? NSViewMinXMargin | NSViewHeightSizable |
| 2263 : NSViewMinXMargin | NSViewHeightSizable]; | 2263 : NSViewMaxXMargin | NSViewHeightSizable]; |
| 2264 | 2264 |
| 2265 // Add the traffic light buttons. The horizontal layout was determined by | 2265 // Add the traffic light buttons. The horizontal layout was determined by |
| 2266 // manual inspection on Yosemite. | 2266 // manual inspection on Yosemite. |
| 2267 CGFloat closeButtonX = 11; | 2267 CGFloat closeButtonX = 11; |
| 2268 CGFloat pinnedButtonX = 31; | 2268 CGFloat pinnedButtonX = 31; |
| 2269 CGFloat zoomButtonX = 51; | 2269 CGFloat zoomButtonX = 51; |
| 2270 if (isRTL) | 2270 if (isRTL) |
| 2271 std::swap(closeButtonX, zoomButtonX); | 2271 std::swap(closeButtonX, zoomButtonX); |
| 2272 | 2272 |
| 2273 NSUInteger styleMask = [[tabStripView_ window] styleMask]; | 2273 NSUInteger styleMask = [[tabStripView_ window] styleMask]; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2379 for (int i = 0; i < tabStripModel_->count(); i++) { | 2379 for (int i = 0; i < tabStripModel_->count(); i++) { |
| 2380 [self updateIconsForContents:tabStripModel_->GetWebContentsAt(i) atIndex:i]; | 2380 [self updateIconsForContents:tabStripModel_->GetWebContentsAt(i) atIndex:i]; |
| 2381 } | 2381 } |
| 2382 } | 2382 } |
| 2383 | 2383 |
| 2384 - (void)setVisualEffectsDisabledForFullscreen:(BOOL)fullscreen { | 2384 - (void)setVisualEffectsDisabledForFullscreen:(BOOL)fullscreen { |
| 2385 [tabStripView_ setVisualEffectsDisabledForFullscreen:fullscreen]; | 2385 [tabStripView_ setVisualEffectsDisabledForFullscreen:fullscreen]; |
| 2386 } | 2386 } |
| 2387 | 2387 |
| 2388 @end | 2388 @end |
| OLD | NEW |