| OLD | NEW | 
|    1 // Copyright 2014 The Chromium Authors. All rights reserved. |    1 // Copyright 2014 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_layout.h" |    5 #import "chrome/browser/ui/cocoa/browser_window_layout.h" | 
|    6  |    6  | 
|    7 #include <math.h> |    7 #include <math.h> | 
|    8 #include <string.h> |    8 #include <string.h> | 
|    9  |    9  | 
|   10 #include "base/logging.h" |   10 #include "base/logging.h" | 
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  258   CGFloat maxX = width; |  258   CGFloat maxX = width; | 
|  259   if (!NSIsEmptyRect(parameters_.fullscreenButtonFrame)) { |  259   if (!NSIsEmptyRect(parameters_.fullscreenButtonFrame)) { | 
|  260     maxX = NSMinX(parameters_.fullscreenButtonFrame); |  260     maxX = NSMinX(parameters_.fullscreenButtonFrame); | 
|  261   } |  261   } | 
|  262   if (parameters_.shouldShowAvatar) { |  262   if (parameters_.shouldShowAvatar) { | 
|  263     maxX = std::min(maxX, NSMinX(layout.avatarFrame)); |  263     maxX = std::min(maxX, NSMinX(layout.avatarFrame)); | 
|  264   } |  264   } | 
|  265   layout.trailingIndent = width - maxX; |  265   layout.trailingIndent = width - maxX; | 
|  266  |  266  | 
|  267   if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) { |  267   if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) { | 
|  268     layout.avatarFrame.origin.x = |  268     if (cocoa_l10n_util::ShouldFlipWindowControlsInRTL()) | 
|  269         width - parameters_.avatarSize.width - layout.avatarFrame.origin.x; |  269       layout.avatarFrame.origin.x = | 
 |  270           width - parameters_.avatarSize.width - layout.avatarFrame.origin.x; | 
 |  271     else | 
 |  272       std::swap(layout.leadingIndent, layout.trailingIndent); | 
|  270   } |  273   } | 
|  271  |  274  | 
|  272   output_.tabStripLayout = layout; |  275   output_.tabStripLayout = layout; | 
|  273 } |  276 } | 
|  274  |  277  | 
|  275 - (void)computeContentViewLayout { |  278 - (void)computeContentViewLayout { | 
|  276   chrome::LayoutParameters parameters = parameters_; |  279   chrome::LayoutParameters parameters = parameters_; | 
|  277   CGFloat maxY = maxY_; |  280   CGFloat maxY = maxY_; | 
|  278  |  281  | 
|  279   // Sanity-check |maxY|. |  282   // Sanity-check |maxY|. | 
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  412  |  415  | 
|  413 @end |  416 @end | 
|  414  |  417  | 
|  415 @implementation BrowserWindowLayout (ExposedForTesting) |  418 @implementation BrowserWindowLayout (ExposedForTesting) | 
|  416  |  419  | 
|  417 - (void)setOSYosemiteOrLater:(BOOL)osYosemiteOrLater { |  420 - (void)setOSYosemiteOrLater:(BOOL)osYosemiteOrLater { | 
|  418   parameters_.isOSYosemiteOrLater = osYosemiteOrLater; |  421   parameters_.isOSYosemiteOrLater = osYosemiteOrLater; | 
|  419 } |  422 } | 
|  420  |  423  | 
|  421 @end |  424 @end | 
| OLD | NEW |