diff --git a/chrome/browser/ui/views/chrome_views_delegate.h b/chrome/browser/ui/views/chrome_views_delegate.h index 64510ab8735a60..c24f97b8c74fd3 100644 --- a/chrome/browser/ui/views/chrome_views_delegate.h +++ b/chrome/browser/ui/views/chrome_views_delegate.h @@ -61,10 +61,6 @@ class ChromeViewsDelegate : public views::ViewsDelegate { ui::ContextFactoryPrivate* GetContextFactoryPrivate() override; std::string GetApplicationName() override; -#if defined(OS_MACOSX) - bool ShouldMirrorArrowsInRTL() const override; -#endif - private: #if defined(OS_WIN) typedef std::map AppbarAutohideEdgeMap; diff --git a/chrome/browser/ui/views/chrome_views_delegate_mac.cc b/chrome/browser/ui/views/chrome_views_delegate_mac.cc index 65789e228434e6..1321275ee1cdc0 100644 --- a/chrome/browser/ui/views/chrome_views_delegate_mac.cc +++ b/chrome/browser/ui/views/chrome_views_delegate_mac.cc @@ -13,7 +13,3 @@ views::NativeWidget* ChromeViewsDelegate::CreateNativeWidget( // By returning null Widget creates the default NativeWidget implementation. return nullptr; } - -bool ChromeViewsDelegate::ShouldMirrorArrowsInRTL() const { - return base::FeatureList::IsEnabled(features::kMacRTL); -} diff --git a/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc b/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc index 8b3390974d879f..23ea17203870c6 100644 --- a/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc +++ b/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc @@ -121,14 +121,6 @@ PermissionsBubbleDialogDelegateView::PermissionsBubbleDialogDelegateView( set_close_on_deactivate(false); -#if defined(OS_MACOSX) - // On Mac, the browser UI flips depending on a runtime feature. TODO(tapted): - // Change the default in views::PlatformStyle when features::kMacRTL launches, - // and remove the following. - if (base::FeatureList::IsEnabled(features::kMacRTL)) - set_mirror_arrow_in_rtl(true); -#endif - ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); SetLayoutManager(std::make_unique( views::BoxLayout::kVertical, gfx::Insets(), diff --git a/ui/views/bubble/bubble_dialog_delegate_view.cc b/ui/views/bubble/bubble_dialog_delegate_view.cc index ed467885a35752..5372e93ebe65e3 100644 --- a/ui/views/bubble/bubble_dialog_delegate_view.cc +++ b/ui/views/bubble/bubble_dialog_delegate_view.cc @@ -16,7 +16,6 @@ #include "ui/views/layout/layout_manager.h" #include "ui/views/layout/layout_provider.h" #include "ui/views/view_properties.h" -#include "ui/views/views_delegate.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_observer.h" #include "ui/views/window/dialog_client_view.h" @@ -134,7 +133,6 @@ bool BubbleDialogDelegateView::ShouldShowCloseButton() const { ClientView* BubbleDialogDelegateView::CreateClientView(Widget* widget) { DialogClientView* client = new DialogClientView(widget, GetContentsView()); - widget->non_client_view()->set_mirror_client_in_rtl(mirror_arrow_in_rtl_); return client; } @@ -148,7 +146,7 @@ NonClientFrameView* BubbleDialogDelegateView::CreateNonClientFrameView( frame->SetFootnoteView(CreateFootnoteView()); BubbleBorder::Arrow adjusted_arrow = arrow(); - if (base::i18n::IsRTL() && mirror_arrow_in_rtl_) + if (base::i18n::IsRTL()) adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow); std::unique_ptr border = std::make_unique(adjusted_arrow, GetShadow(), color()); @@ -275,8 +273,6 @@ BubbleDialogDelegateView::BubbleDialogDelegateView(View* anchor_view, anchor_view_tracker_(std::make_unique()), anchor_widget_(nullptr), arrow_(arrow), - mirror_arrow_in_rtl_( - ViewsDelegate::GetInstance()->ShouldMirrorArrowsInRTL()), shadow_(shadow), color_explicitly_set_(false), accept_events_(true), diff --git a/ui/views/bubble/bubble_dialog_delegate_view.h b/ui/views/bubble/bubble_dialog_delegate_view.h index 79581e3e083c64..a5b2d11c96bf18 100644 --- a/ui/views/bubble/bubble_dialog_delegate_view.h +++ b/ui/views/bubble/bubble_dialog_delegate_view.h @@ -77,8 +77,6 @@ class VIEWS_EXPORT BubbleDialogDelegateView : public DialogDelegateView, BubbleBorder::Arrow arrow() const { return arrow_; } void SetArrow(BubbleBorder::Arrow arrow); - void set_mirror_arrow_in_rtl(bool mirror) { mirror_arrow_in_rtl_ = mirror; } - BubbleBorder::Shadow GetShadow() const; void set_shadow(BubbleBorder::Shadow shadow) { shadow_ = shadow; } @@ -205,9 +203,6 @@ class VIEWS_EXPORT BubbleDialogDelegateView : public DialogDelegateView, // The arrow's location on the bubble. BubbleBorder::Arrow arrow_; - // Automatically mirror the arrow in RTL layout. - bool mirror_arrow_in_rtl_; - // Bubble border shadow to use. BubbleBorder::Shadow shadow_; diff --git a/ui/views/bubble/bubble_dialog_delegate_view_unittest.cc b/ui/views/bubble/bubble_dialog_delegate_view_unittest.cc index cf205c20d3f63a..dd72bf4f8e6098 100644 --- a/ui/views/bubble/bubble_dialog_delegate_view_unittest.cc +++ b/ui/views/bubble/bubble_dialog_delegate_view_unittest.cc @@ -132,25 +132,6 @@ TEST_F(BubbleDialogDelegateViewTest, CreateDelegate) { EXPECT_TRUE(bubble_observer.widget_closed()); } -TEST_F(BubbleDialogDelegateViewTest, MirrorArrowInRtl) { - std::string default_locale = base::i18n::GetConfiguredLocale(); - std::unique_ptr anchor_widget(CreateTestWidget()); - for (bool rtl : {false, true}) { - base::i18n::SetICUDefaultLocale(rtl ? "he" : "en"); - EXPECT_EQ(rtl, base::i18n::IsRTL()); - for (bool mirror : {false, true}) { - TestBubbleDialogDelegateView* bubble = - new TestBubbleDialogDelegateView(anchor_widget->GetContentsView()); - bubble->set_mirror_arrow_in_rtl(mirror); - BubbleDialogDelegateView::CreateBubble(bubble); - EXPECT_EQ(rtl && mirror ? BubbleBorder::horizontal_mirror(bubble->arrow()) - : bubble->arrow(), - bubble->GetBubbleFrameView()->bubble_border()->arrow()); - } - } - base::i18n::SetICUDefaultLocale(default_locale); -} - TEST_F(BubbleDialogDelegateViewTest, CloseAnchorWidget) { std::unique_ptr anchor_widget(CreateTestWidget()); BubbleDialogDelegateView* bubble_delegate = diff --git a/ui/views/views_delegate.cc b/ui/views/views_delegate.cc index ec2f9411969600..68ac0732a9532e 100644 --- a/ui/views/views_delegate.cc +++ b/ui/views/views_delegate.cc @@ -131,10 +131,6 @@ int ViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor, } #endif -bool ViewsDelegate::ShouldMirrorArrowsInRTL() const { - return true; -} - #if defined(USE_AURA) void ViewsDelegate::SetTouchSelectionMenuRunner( std::unique_ptr menu_runner) { diff --git a/ui/views/views_delegate.h b/ui/views/views_delegate.h index 8d31332309e178..ab1ccc50c71be7 100644 --- a/ui/views/views_delegate.h +++ b/ui/views/views_delegate.h @@ -196,10 +196,6 @@ class VIEWS_EXPORT ViewsDelegate { const base::Closure& callback); #endif - // Whether to mirror the arrow of bubble dialogs in RTL, such that the bubble - // opens in the opposite direction. - virtual bool ShouldMirrorArrowsInRTL() const; - protected: ViewsDelegate(); diff --git a/ui/views/window/non_client_view.cc b/ui/views/window/non_client_view.cc index cad54b2424a12d..eb874a063a8ef6 100644 --- a/ui/views/window/non_client_view.cc +++ b/ui/views/window/non_client_view.cc @@ -43,7 +43,6 @@ bool NonClientFrameView::GetClientMask(const gfx::Size& size, NonClientView::NonClientView() : client_view_(nullptr), - mirror_client_in_rtl_(true), overlay_view_(nullptr) { SetEventTargeter( std::unique_ptr(new views::ViewTargeter(this))); @@ -166,10 +165,6 @@ void NonClientView::Layout() { // Then layout the ClientView, using those bounds. gfx::Rect client_bounds = frame_view_->GetBoundsForClientView(); - // RTL code will mirror the ClientView in the frame by default. If this isn't - // desired, do a second mirror here to get the standard LTR position. - if (base::i18n::IsRTL() && !mirror_client_in_rtl_) - client_bounds.set_x(GetMirroredXForRect(client_bounds)); if (client_bounds != client_view_->bounds()) { client_view_->SetBoundsRect(client_bounds); diff --git a/ui/views/window/non_client_view.h b/ui/views/window/non_client_view.h index 27cc19d8bad9ea..8a11a2790bd7b3 100644 --- a/ui/views/window/non_client_view.h +++ b/ui/views/window/non_client_view.h @@ -217,8 +217,6 @@ class VIEWS_EXPORT NonClientView : public View, public ViewTargeterDelegate { client_view_ = client_view; } - void set_mirror_client_in_rtl(bool mirror) { mirror_client_in_rtl_ = mirror; } - // Layout just the frame view. This is necessary on Windows when non-client // metrics such as the position of the window controls changes independently // of a window resize message. @@ -251,9 +249,6 @@ class VIEWS_EXPORT NonClientView : public View, public ViewTargeterDelegate { // implementation. ClientView* client_view_; - // Set to false if client_view_ position shouldn't be mirrored in RTL. - bool mirror_client_in_rtl_; - // The NonClientFrameView that renders the non-client portions of the window. // This object is not owned by the view hierarchy because it can be replaced // dynamically as the system settings change.