Commit 1e35b7bb authored by lgrey's avatar lgrey Committed by Commit bot

[Mac] Reverse back/forward toolbar buttons in RTL

BUG=647206, 673362

Review-Url: https://codereview.chromium.org/2582593003
Cr-Commit-Position: refs/heads/master@{#439186}
parent d872ec11
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/sdk_forward_declarations.h" #include "base/mac/sdk_forward_declarations.h"
#import "chrome/browser/ui/cocoa/image_button_cell.h" #import "chrome/browser/ui/cocoa/image_button_cell.h"
#import "chrome/browser/ui/cocoa/l10n_util.h"
#import "chrome/browser/ui/cocoa/view_id_util.h" #import "chrome/browser/ui/cocoa/view_id_util.h"
#include "skia/ext/skia_utils_mac.h" #include "skia/ext/skia_utils_mac.h"
#import "ui/base/cocoa/nsview_additions.h" #import "ui/base/cocoa/nsview_additions.h"
...@@ -204,11 +205,14 @@ const NSSize kMDButtonIconSize = NSMakeSize(16, 16); ...@@ -204,11 +205,14 @@ const NSSize kMDButtonIconSize = NSMakeSize(16, 16);
} }
- (gfx::VectorIconId)vectorIconId { - (gfx::VectorIconId)vectorIconId {
BOOL isRTL = cocoa_l10n_util::ShouldDoExperimentalRTLLayout();
switch ([self viewID]) { switch ([self viewID]) {
case VIEW_ID_BACK_BUTTON: case VIEW_ID_BACK_BUTTON:
return gfx::VectorIconId::NAVIGATE_BACK; return isRTL ? gfx::VectorIconId::NAVIGATE_FORWARD
: gfx::VectorIconId::NAVIGATE_BACK;
case VIEW_ID_FORWARD_BUTTON: case VIEW_ID_FORWARD_BUTTON:
return gfx::VectorIconId::NAVIGATE_FORWARD; return isRTL ? gfx::VectorIconId::NAVIGATE_BACK
: gfx::VectorIconId::NAVIGATE_FORWARD;
case VIEW_ID_HOME_BUTTON: case VIEW_ID_HOME_BUTTON:
return gfx::VectorIconId::NAVIGATE_HOME; return gfx::VectorIconId::NAVIGATE_HOME;
case VIEW_ID_APP_MENU: case VIEW_ID_APP_MENU:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment