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

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

Issue 2541583002: [Mac] Don't flip window controls in RTL for macOS < 10.12 (Closed)
Patch Set: Created 4 years 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/framed_browser_window.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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/framed_browser_window.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698