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

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

Issue 2346783002: mac rtl: pin profile switcher to left edge in rtl (Closed)
Patch Set: ExperimentalMacRTLIsEnabled -> ShouldDoExperimentalRTLLayout Created 4 years, 3 months 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
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/i18n/rtl.h"
11 #include "base/logging.h" 10 #include "base/logging.h"
12 #include "base/mac/mac_util.h" 11 #include "base/mac/mac_util.h"
13 #include "chrome/browser/ui/cocoa/l10n_util.h" 12 #include "chrome/browser/ui/cocoa/l10n_util.h"
14 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" 13 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
15 14
16 namespace chrome { 15 namespace chrome {
17 16
18 // The height of the tab strip. 17 // The height of the tab strip.
19 const CGFloat kTabStripHeight = 37; 18 const CGFloat kTabStripHeight = 37;
20 19
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 // overlapping these buttons. 242 // overlapping these buttons.
244 CGFloat maxX = width; 243 CGFloat maxX = width;
245 if (!NSIsEmptyRect(parameters_.fullscreenButtonFrame)) { 244 if (!NSIsEmptyRect(parameters_.fullscreenButtonFrame)) {
246 maxX = NSMinX(parameters_.fullscreenButtonFrame); 245 maxX = NSMinX(parameters_.fullscreenButtonFrame);
247 } 246 }
248 if (parameters_.shouldShowAvatar) { 247 if (parameters_.shouldShowAvatar) {
249 maxX = std::min(maxX, NSMinX(layout.avatarFrame)); 248 maxX = std::min(maxX, NSMinX(layout.avatarFrame));
250 } 249 }
251 layout.rightIndent = width - maxX; 250 layout.rightIndent = width - maxX;
252 251
253 if (cocoa_l10n_util::ExperimentalMacRTLIsEnabled() && base::i18n::IsRTL()) { 252 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) {
254 std::swap(layout.leftIndent, layout.rightIndent); 253 std::swap(layout.leftIndent, layout.rightIndent);
255 layout.avatarFrame.origin.x = 254 layout.avatarFrame.origin.x =
256 width - parameters_.avatarSize.width - layout.avatarFrame.origin.x; 255 width - parameters_.avatarSize.width - layout.avatarFrame.origin.x;
257 } 256 }
258 257
259 output_.tabStripLayout = layout; 258 output_.tabStripLayout = layout;
260 } 259 }
261 260
262 - (void)computeContentViewLayout { 261 - (void)computeContentViewLayout {
263 chrome::LayoutParameters parameters = parameters_; 262 chrome::LayoutParameters parameters = parameters_;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 395
397 @end 396 @end
398 397
399 @implementation BrowserWindowLayout (ExposedForTesting) 398 @implementation BrowserWindowLayout (ExposedForTesting)
400 399
401 - (void)setOSYosemiteOrLater:(BOOL)osYosemiteOrLater { 400 - (void)setOSYosemiteOrLater:(BOOL)osYosemiteOrLater {
402 parameters_.isOSYosemiteOrLater = osYosemiteOrLater; 401 parameters_.isOSYosemiteOrLater = osYosemiteOrLater;
403 } 402 }
404 403
405 @end 404 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | chrome/browser/ui/cocoa/framed_browser_window.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698