Commit af729121 authored by Adithya Srinivasan's avatar Adithya Srinivasan Committed by Commit Bot

Revert "Change BubbleDialogDelegateView RTL mirroring to happen when setting the arrow."

This reverts commit a3996e55.

Reason for revert: This is causing GlobalErrorBubbleViewTest.Basic
to fail in MSAN builds (example failing build: https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Linux%20ChromiumOS%20MSan%20Tests/12590)

Original change's description:
> Change BubbleDialogDelegateView RTL mirroring to happen when setting the arrow.
> 
> Previously this was done during creation of the nonclient view. This created issues in cases where the arrow was explicitly reset to a value fitting for only LTR after nonclient view creation.
> 
> Bug: 956001
> Change-Id: I2d71c3a97df1192337f7548ab1da733604526c3a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1585930
> Commit-Queue: Caroline Rising <corising@chromium.org>
> Reviewed-by: Dana Fried <dfried@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#654625}

TBR=dfried@chromium.org,corising@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 956001
Change-Id: Ib4367b996d9c4e3418e8463558912f641713a5fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1588440Reviewed-by: default avatarAdithya Srinivasan <adithyas@chromium.org>
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654871}
parent e51dbe82
...@@ -168,8 +168,13 @@ NonClientFrameView* BubbleDialogDelegateView::CreateNonClientFrameView( ...@@ -168,8 +168,13 @@ NonClientFrameView* BubbleDialogDelegateView::CreateNonClientFrameView(
provider->GetInsetsMetric(INSETS_DIALOG_SUBSECTION)); provider->GetInsetsMetric(INSETS_DIALOG_SUBSECTION));
frame->SetFootnoteView(CreateFootnoteView()); frame->SetFootnoteView(CreateFootnoteView());
BubbleBorder::Arrow adjusted_arrow = arrow();
if (base::i18n::IsRTL()) {
adjusted_arrow = BubbleBorder::horizontal_mirror(adjusted_arrow);
arrow_ = adjusted_arrow;
}
std::unique_ptr<BubbleBorder> border = std::unique_ptr<BubbleBorder> border =
std::make_unique<BubbleBorder>(arrow(), GetShadow(), color()); std::make_unique<BubbleBorder>(adjusted_arrow, GetShadow(), color());
if (CustomShadowsSupported() && ShouldHaveRoundCorners()) { if (CustomShadowsSupported() && ShouldHaveRoundCorners()) {
border->SetCornerRadius( border->SetCornerRadius(
base::FeatureList::IsEnabled(features::kEnableMDRoundedCornersOnDialogs) base::FeatureList::IsEnabled(features::kEnableMDRoundedCornersOnDialogs)
...@@ -273,8 +278,6 @@ void BubbleDialogDelegateView::SetHighlightedButton( ...@@ -273,8 +278,6 @@ void BubbleDialogDelegateView::SetHighlightedButton(
} }
void BubbleDialogDelegateView::SetArrow(BubbleBorder::Arrow arrow) { void BubbleDialogDelegateView::SetArrow(BubbleBorder::Arrow arrow) {
if (base::i18n::IsRTL())
arrow = BubbleBorder::horizontal_mirror(arrow);
if (arrow_ == arrow) if (arrow_ == arrow)
return; return;
arrow_ = arrow; arrow_ = arrow;
...@@ -318,12 +321,12 @@ BubbleDialogDelegateView::BubbleDialogDelegateView(View* anchor_view, ...@@ -318,12 +321,12 @@ BubbleDialogDelegateView::BubbleDialogDelegateView(View* anchor_view,
: close_on_deactivate_(true), : close_on_deactivate_(true),
anchor_view_tracker_(std::make_unique<ViewTracker>()), anchor_view_tracker_(std::make_unique<ViewTracker>()),
anchor_widget_(nullptr), anchor_widget_(nullptr),
arrow_(arrow),
shadow_(shadow), shadow_(shadow),
color_explicitly_set_(false), color_explicitly_set_(false),
accept_events_(true), accept_events_(true),
adjust_if_offscreen_(true), adjust_if_offscreen_(true),
parent_window_(nullptr) { parent_window_(nullptr) {
SetArrow(arrow);
LayoutProvider* provider = LayoutProvider::Get(); LayoutProvider* provider = LayoutProvider::Get();
// An individual bubble should override these margins if its layout differs // An individual bubble should override these margins if its layout differs
// from the typical title/text/buttons. // from the typical title/text/buttons.
......
...@@ -81,7 +81,7 @@ class VIEWS_EXPORT BubbleDialogDelegateView : public DialogDelegateView, ...@@ -81,7 +81,7 @@ class VIEWS_EXPORT BubbleDialogDelegateView : public DialogDelegateView,
// The anchor rect is used in the absence of an assigned anchor view. // The anchor rect is used in the absence of an assigned anchor view.
const gfx::Rect& anchor_rect() const { return anchor_rect_; } const gfx::Rect& anchor_rect() const { return anchor_rect_; }
// Set the desired arrow for the bubble. The arrow will be mirrored for RTL. BubbleBorder::Arrow arrow() const { return arrow_; }
void SetArrow(BubbleBorder::Arrow arrow); void SetArrow(BubbleBorder::Arrow arrow);
BubbleBorder::Shadow GetShadow() const; BubbleBorder::Shadow GetShadow() const;
...@@ -140,8 +140,6 @@ class VIEWS_EXPORT BubbleDialogDelegateView : public DialogDelegateView, ...@@ -140,8 +140,6 @@ class VIEWS_EXPORT BubbleDialogDelegateView : public DialogDelegateView,
BubbleBorder::Arrow arrow, BubbleBorder::Arrow arrow,
BubbleBorder::Shadow shadow = BubbleBorder::DIALOG_SHADOW); BubbleBorder::Shadow shadow = BubbleBorder::DIALOG_SHADOW);
BubbleBorder::Arrow arrow() const { return arrow_; }
// Get bubble bounds from the anchor rect and client view's preferred size. // Get bubble bounds from the anchor rect and client view's preferred size.
virtual gfx::Rect GetBubbleBounds(); virtual gfx::Rect GetBubbleBounds();
...@@ -220,8 +218,8 @@ class VIEWS_EXPORT BubbleDialogDelegateView : public DialogDelegateView, ...@@ -220,8 +218,8 @@ class VIEWS_EXPORT BubbleDialogDelegateView : public DialogDelegateView,
// The anchor rect used in the absence of an anchor view. // The anchor rect used in the absence of an anchor view.
mutable gfx::Rect anchor_rect_; mutable gfx::Rect anchor_rect_;
// The arrow's default location on the bubble post-RTL mirroring if needed. // The arrow's location on the bubble.
BubbleBorder::Arrow arrow_ = BubbleBorder::NONE; BubbleBorder::Arrow arrow_;
// Bubble border shadow to use. // Bubble border shadow to use.
BubbleBorder::Shadow shadow_; BubbleBorder::Shadow shadow_;
......
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