| Index: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
|
| diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
|
| index 116c021143d4a3b9a8a072ff822c65b919704b47..787d98e3c07bbb1ee0aedc363874c4934d9a7738 100644
|
| --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
|
| +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
|
| @@ -31,7 +31,6 @@
|
| #import "chrome/browser/ui/cocoa/browser_window_controller.h"
|
| #include "chrome/browser/ui/cocoa/drag_util.h"
|
| #import "chrome/browser/ui/cocoa/image_button_cell.h"
|
| -#include "chrome/browser/ui/cocoa/l10n_util.h"
|
| #import "chrome/browser/ui/cocoa/new_tab_button.h"
|
| #import "chrome/browser/ui/cocoa/tab_contents/favicon_util_mac.h"
|
| #import "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h"
|
| @@ -66,6 +65,7 @@
|
| #include "ui/base/cocoa/animation_utils.h"
|
| #include "ui/base/cocoa/cocoa_base_utils.h"
|
| #import "ui/base/cocoa/tracking_area.h"
|
| +#import "ui/base/cocoa/rtl_feature.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "ui/base/material_design/material_design_controller.h"
|
| #include "ui/base/models/list_selection_model.h"
|
| @@ -137,7 +137,7 @@ private:
|
| };
|
|
|
| CGFloat FlipXInView(NSView* view, CGFloat width, CGFloat x) {
|
| - if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout())
|
| + if (ui::ShouldDoExperimentalRTLLayout())
|
| return [view frame].size.width - x - width;
|
| return x;
|
| }
|
| @@ -831,7 +831,7 @@ NSRect FlipRectInView(NSView* view, NSRect rect) {
|
| } else {
|
| NSView* penultimateTab = [self viewAtIndex:numberOfOpenTabs - 2];
|
| availableResizeWidth_ =
|
| - cocoa_l10n_util::ShouldDoExperimentalRTLLayout()
|
| + ui::ShouldDoExperimentalRTLLayout()
|
| ? FlipXInView(tabStripView_, 0, NSMinX([penultimateTab frame]))
|
| : NSMaxX([penultimateTab frame]);
|
| }
|
| @@ -841,7 +841,7 @@ NSRect FlipRectInView(NSView* view, NSRect rect) {
|
| // are currently below their maximum width and can grow).
|
| NSView* lastTab = [self viewAtIndex:numberOfOpenTabs - 1];
|
| availableResizeWidth_ =
|
| - cocoa_l10n_util::ShouldDoExperimentalRTLLayout()
|
| + ui::ShouldDoExperimentalRTLLayout()
|
| ? FlipXInView(tabStripView_, 0, NSMinX([lastTab frame]))
|
| : NSMaxX([lastTab frame]);
|
| }
|
| @@ -899,7 +899,7 @@ NSRect FlipRectInView(NSView* view, NSRect rect) {
|
|
|
| - (BOOL)isTabFullyVisible:(TabView*)tab {
|
| NSRect frame = [tab frame];
|
| - if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) {
|
| + if (ui::ShouldDoExperimentalRTLLayout()) {
|
| return NSMinX(frame) >= [self trailingIndentForControls] &&
|
| NSMaxX(frame) <= [self tabAreaRightEdge];
|
| } else {
|
| @@ -909,7 +909,7 @@ NSRect FlipRectInView(NSView* view, NSRect rect) {
|
| }
|
|
|
| - (CGFloat)tabAreaRightEdge {
|
| - CGFloat rightEdge = cocoa_l10n_util::ShouldDoExperimentalRTLLayout()
|
| + CGFloat rightEdge = ui::ShouldDoExperimentalRTLLayout()
|
| ? [self leadingIndentForControls]
|
| : [self trailingIndentForControls];
|
| return NSMaxX([tabStripView_ frame]) - rightEdge;
|
| @@ -1073,7 +1073,7 @@ NSRect FlipRectInView(NSView* view, NSRect rect) {
|
| // If the back edge is behind the placeholder's back edge, but the
|
| // mid is in front of it of it, slide over to make space for it.
|
| bool shouldLeaveGap;
|
| - if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) {
|
| + if (ui::ShouldDoExperimentalRTLLayout()) {
|
| const CGFloat tabMidpoint =
|
| NSMidX(FlipRectInView(tabStripView_, tabFrame));
|
| shouldLeaveGap = tabMidpoint < NSMaxX(placeholderFrame_);
|
| @@ -1188,7 +1188,7 @@ NSRect FlipRectInView(NSView* view, NSRect rect) {
|
| // so we don't have to check it against the available space. We do need
|
| // to make sure we put it after any placeholder.
|
| CGFloat maxTabX = MAX(offset, NSMaxX(placeholderFrame_) - kTabOverlap);
|
| - if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) {
|
| + if (ui::ShouldDoExperimentalRTLLayout()) {
|
| maxTabX = FlipXInView(tabStripView_, [newTabButton_ frame].size.width,
|
| maxTabX) -
|
| (2 * kNewTabButtonOffset);
|
| @@ -1214,7 +1214,7 @@ NSRect FlipRectInView(NSView* view, NSRect rect) {
|
| if (visible && animate) {
|
| ScopedNSAnimationContextGroup localAnimationGroup(true);
|
| BOOL movingBack = NSMinX(newTabNewFrame) < NSMinX(newTabTargetFrame_);
|
| - if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout())
|
| + if (ui::ShouldDoExperimentalRTLLayout())
|
| movingBack = !movingBack;
|
|
|
| if (!movingBack) {
|
| @@ -1757,7 +1757,7 @@ NSRect FlipRectInView(NSView* view, NSRect rect) {
|
| // No placeholder, return the end of the strip.
|
| if (placeholderTab_ == nil)
|
| return count;
|
| - BOOL isRTL = cocoa_l10n_util::ShouldDoExperimentalRTLLayout();
|
| + BOOL isRTL = ui::ShouldDoExperimentalRTLLayout();
|
| double placeholderX =
|
| isRTL ? NSMaxX(placeholderFrame_) : placeholderFrame_.origin.x;
|
| int index = 0;
|
| @@ -2049,7 +2049,7 @@ NSRect FlipRectInView(NSView* view, NSRect rect) {
|
|
|
| DCHECK(index && disposition);
|
| NSInteger i = 0;
|
| - BOOL isRTL = cocoa_l10n_util::ShouldDoExperimentalRTLLayout();
|
| + BOOL isRTL = ui::ShouldDoExperimentalRTLLayout();
|
| for (TabController* tab in tabArray_.get()) {
|
| NSView* view = [tab view];
|
| DCHECK([view isKindOfClass:[TabView class]]);
|
| @@ -2270,14 +2270,12 @@ NSRect FlipRectInView(NSView* view, NSRect rect) {
|
| }
|
|
|
| - (void)addCustomWindowControls {
|
| - BOOL shouldFlipWindowControls =
|
| - cocoa_l10n_util::ShouldFlipWindowControlsInRTL();
|
| + BOOL shouldFlipWindowControls = ui::ShouldFlipWindowControlsInRTL();
|
| if (!customWindowControls_) {
|
| // Make the container view.
|
| CGFloat height = NSHeight([tabStripView_ frame]);
|
| CGFloat width = [self leadingIndentForControls];
|
| - if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout() &&
|
| - !shouldFlipWindowControls)
|
| + if (ui::ShouldDoExperimentalRTLLayout() && !shouldFlipWindowControls)
|
| // The trailing indent is correct in this case, since the controls should
|
| // stay on the left.
|
| width = [self trailingIndentForControls];
|
|
|