Commit a5e24275 authored by Regan Hsu's avatar Regan Hsu Committed by Chromium LUCI CQ

[CrOS PhoneHub] Display PhoneHub bubble view on bottom on a L/R shelf.

Instead of displaying the PhoneHub UI in the middle of the screen
when shelf position is right/left, it is now displayed on the bottom.

Screenshots:
Left shelf - https://screenshot.googleplex.com/5LBcDUSEWY5vER6
Right shelf - https://screenshot.googleplex.com/4AboKZpVjH89tMS
Bottom shelf - https://screenshot.googleplex.com/iumxiW5ohmL9L7w

Fixed: 1159098
Bug: 1106937
Change-Id: Ie715e0f61b46bce469e5aa661e43ac46680d8138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2600626Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#838947}
parent 7a0180a8
...@@ -153,7 +153,9 @@ void PhoneHubTray::ShowBubble(bool show_by_click) { ...@@ -153,7 +153,9 @@ void PhoneHubTray::ShowBubble(bool show_by_click) {
TrayBubbleView::InitParams init_params; TrayBubbleView::InitParams init_params;
init_params.delegate = this; init_params.delegate = this;
init_params.parent_window = GetBubbleWindowContainer(); init_params.parent_window = GetBubbleWindowContainer();
init_params.anchor_view = GetBubbleAnchor(); init_params.anchor_mode = TrayBubbleView::AnchorMode::kRect;
init_params.anchor_rect = shelf()->GetSystemTrayAnchorRect();
init_params.insets = GetTrayBubbleInsets();
init_params.shelf_alignment = shelf()->alignment(); init_params.shelf_alignment = shelf()->alignment();
init_params.preferred_width = kTrayMenuWidth; init_params.preferred_width = kTrayMenuWidth;
init_params.close_on_deactivate = true; init_params.close_on_deactivate = true;
...@@ -163,8 +165,6 @@ void PhoneHubTray::ShowBubble(bool show_by_click) { ...@@ -163,8 +165,6 @@ void PhoneHubTray::ShowBubble(bool show_by_click) {
init_params.show_by_click = show_by_click; init_params.show_by_click = show_by_click;
TrayBubbleView* bubble_view = new TrayBubbleView(init_params); TrayBubbleView* bubble_view = new TrayBubbleView(init_params);
bubble_view->set_anchor_view_insets(GetBubbleAnchorInsets());
bubble_view->set_margins(GetSecondaryBubbleInsets());
bubble_view->SetBorder(views::CreateEmptyBorder(kBubblePadding)); bubble_view->SetBorder(views::CreateEmptyBorder(kBubblePadding));
// Creates header view on top for displaying phone status and settings icon. // Creates header view on top for displaying phone status and settings icon.
......
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