Commit a429208d authored by mgiuca's avatar mgiuca Committed by Commit bot

Fixed unclickable X button in App Info dialog in RTL languages.

BubbleFrameView: Replaced GetCloseButtonBounds with
GetCloseButtonMirroredBounds. Now returns the RTL-mirrored bounds, which
is necessary for the App Info dialog's FullSizeBubbleFrameView to
correctly target events to the close button in RTL mode.

BUG=474559
TEST=Change language to Arabic. Go to chrome://extensions; click
"Details" on any extension. Click X button. Should close dialog.

Review URL: https://codereview.chromium.org/1144853002

Cr-Commit-Position: refs/heads/master@{#330678}
parent 37918d6d
...@@ -168,8 +168,13 @@ class FullSizeBubbleFrameView : public views::BubbleFrameView { ...@@ -168,8 +168,13 @@ class FullSizeBubbleFrameView : public views::BubbleFrameView {
const gfx::Rect& rect) const override { const gfx::Rect& rect) const override {
// Make sure click events can still reach the close button, even if the // Make sure click events can still reach the close button, even if the
// ClientView overlaps it. // ClientView overlaps it.
if (IsCloseButtonVisible() && GetCloseButtonBounds().Intersects(rect)) // NOTE: |rect| is in the mirrored coordinate space, so we must use the
// close button's mirrored bounds to correctly target the close button when
// in RTL mode.
if (IsCloseButtonVisible() &&
GetCloseButtonMirroredBounds().Intersects(rect)) {
return true; return true;
}
return views::BubbleFrameView::DoesIntersectRect(target, rect); return views::BubbleFrameView::DoesIntersectRect(target, rect);
} }
......
...@@ -343,8 +343,8 @@ bool BubbleFrameView::IsCloseButtonVisible() const { ...@@ -343,8 +343,8 @@ bool BubbleFrameView::IsCloseButtonVisible() const {
return close_->visible(); return close_->visible();
} }
gfx::Rect BubbleFrameView::GetCloseButtonBounds() const { gfx::Rect BubbleFrameView::GetCloseButtonMirroredBounds() const {
return close_->bounds(); return close_->GetMirroredBounds();
} }
void BubbleFrameView::MirrorArrowIfOffScreen( void BubbleFrameView::MirrorArrowIfOffScreen(
......
...@@ -88,7 +88,7 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView, ...@@ -88,7 +88,7 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect); virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect);
bool IsCloseButtonVisible() const; bool IsCloseButtonVisible() const;
gfx::Rect GetCloseButtonBounds() const; gfx::Rect GetCloseButtonMirroredBounds() const;
private: private:
FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, GetBoundsForClientView); FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, GetBoundsForClientView);
......
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