Commit a9f2053a authored by eugenebut's avatar eugenebut Committed by Commit bot

[MacViews] Anchor Bookmarks bubble to top-right corner.

Currently Bookmarks bubble is anchored to center-top, so its right part
may be displayed offscreen. Regression happened after this CL:
https://codereview.chromium.org/1759453002/patch/240001/250007
which defer anchoring to LocationBarBubbleDelegateView (which in it's
turn uses NONE arrow, and makes center-top anchoring).

bookmark_bubble_view.cc was the only bubble that lost its explicit TOP_RIGHT.
So other bubbles don't need a similar update. Regression affects MacViews,
but not other platforms, because other platforms infer a TOP_RIGHT in
location_bar_bubble_delegate_view.cc. MacViews does not, because it's
anchored to a point, not a View.

This change restores anchoring to top right and does not impact other platforms
(tested on Windows). The change makes MacViews version worse in RTL, because
omnibox is not mirrored on mac. Since omnibox will be mirrored eventually,
leaving it as it is.

BUG=600209

Review-Url: https://codereview.chromium.org/2351593002
Cr-Commit-Position: refs/heads/master@{#419877}
parent 5525a348
...@@ -80,6 +80,10 @@ views::Widget* BookmarkBubbleView::ShowBubble( ...@@ -80,6 +80,10 @@ views::Widget* BookmarkBubbleView::ShowBubble(
bookmark_bubble_ = bookmark_bubble_ =
new BookmarkBubbleView(anchor_view, observer, std::move(delegate), new BookmarkBubbleView(anchor_view, observer, std::move(delegate),
profile, url, !already_bookmarked); profile, url, !already_bookmarked);
// Bookmark bubble should always anchor TOP_RIGHT, but the
// LocationBarBubbleDelegateView does not know that and may use different
// arrow anchoring.
bookmark_bubble_->set_arrow(views::BubbleBorder::TOP_RIGHT);
if (!anchor_view) { if (!anchor_view) {
bookmark_bubble_->SetAnchorRect(anchor_rect); bookmark_bubble_->SetAnchorRect(anchor_rect);
bookmark_bubble_->set_parent_window(parent_window); bookmark_bubble_->set_parent_window(parent_window);
......
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