Commit 2ff9f1ea authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Fix footnote focus order in BubbleFrameView

This change inserts the footnote container before the close button so
that it comes before caption buttons in focus order. Ideally there'd be
a good way to express inserting it "after the contents view" but afaict
there's no such notion in here.

Bug: 1061352
Change-Id: I460588ae1baee6c26d6fbc7aa7037789d771497b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335337
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794514}
parent a96543bf
...@@ -532,9 +532,13 @@ void BubbleFrameView::SetFootnoteView(std::unique_ptr<View> view) { ...@@ -532,9 +532,13 @@ void BubbleFrameView::SetFootnoteView(std::unique_ptr<View> view) {
delete footnote_container_; delete footnote_container_;
footnote_container_ = nullptr; footnote_container_ = nullptr;
if (view) { if (view) {
// Insert the footnote container before |close_| so that the footnote is
// inserted before caption buttons in the focus cycle.
int radius = bubble_border_ ? bubble_border_->corner_radius() : 0; int radius = bubble_border_ ? bubble_border_->corner_radius() : 0;
footnote_container_ = AddChildView(std::make_unique<FootnoteContainerView>( footnote_container_ =
footnote_margins_, std::move(view), radius)); AddChildViewAt(std::make_unique<FootnoteContainerView>(
footnote_margins_, std::move(view), radius),
GetIndexOf(close_));
} }
InvalidateLayout(); InvalidateLayout();
} }
......
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