Commit 7e72f7b0 authored by Tatsuhisa Yamaguchi's avatar Tatsuhisa Yamaguchi Committed by Commit Bot

Adjust bubble size based on anchor position

Bug: 858957
Test: manually verified |max_height| in the changed line gives same value as before in the horizontal shelf mode. Also the bubble fits in screen with docked magnifier turned on.
Change-Id: Ia40179b8842f8ececd5f1d0e96e851493b1a378b
Reviewed-on: https://chromium-review.googlesource.com/1131043Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Commit-Queue: Tatsuhisa Yamaguchi <yamaguchi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573671}
parent 7a84e2bf
......@@ -80,8 +80,14 @@ UnifiedSystemTrayBubble::UnifiedSystemTrayBubble(UnifiedSystemTray* tray,
init_params.close_on_deactivate = false;
bubble_view_ = new views::TrayBubbleView(init_params);
int max_height = tray->shelf()->GetUserWorkAreaBounds().height() -
kPaddingFromScreenTop -
// TODO(yamaguchi): Reconsider this formula. The y-position of the top edge
// still differes by few pixels between the horizontal and vertical shelf
// modes.
int free_space_height_above_anchor =
tray->shelf()->GetSystemTrayAnchor()->GetBoundsInScreen().y() -
tray->shelf()->GetUserWorkAreaBounds().y();
int max_height = free_space_height_above_anchor - kPaddingFromScreenTop -
bubble_view_->GetBorderInsets().height();
unified_view_ = controller_->CreateView();
time_to_click_recorder_ =
......
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