Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: ash/common/system/chromeos/ime_menu/ime_menu_tray.cc

Issue 2491033006: Adjust positioning of cros tray bubbles. (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
diff --git a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
index 19c12f5bedc93410ad07aea983219af0e5eccbf6..a2b71271ca8c81dbfb3f8cae093839b9ac5863f5 100644
--- a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
+++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
@@ -317,15 +317,13 @@ ImeMenuTray::~ImeMenuTray() {
void ImeMenuTray::ShowImeMenuBubble() {
should_block_shelf_auto_hide_ = true;
views::TrayBubbleView::InitParams init_params(
- views::TrayBubbleView::ANCHOR_TYPE_TRAY, GetAnchorAlignment(),
- kTrayPopupMinWidth, kTrayPopupMaxWidth);
- init_params.first_item_has_no_margin = true;
+ GetAnchorAlignment(), kTrayPopupMinWidth, kTrayPopupMaxWidth);
init_params.can_activate = true;
init_params.close_on_deactivate = true;
views::TrayBubbleView* bubble_view =
- views::TrayBubbleView::Create(tray_container(), this, &init_params);
- bubble_view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE);
+ views::TrayBubbleView::Create(GetBubbleAnchor(), this, &init_params);
+ bubble_view->set_anchor_view_insets(GetBubbleAnchorInsets());
// In the material design, we will add a title item with a separator on the
// top of the IME menu.
@@ -490,26 +488,6 @@ base::string16 ImeMenuTray::GetAccessibleNameForBubble() {
return l10n_util::GetStringUTF16(IDS_ASH_IME_MENU_ACCESSIBLE_NAME);
}
-gfx::Rect ImeMenuTray::GetAnchorRect(views::Widget* anchor_widget,
- AnchorType anchor_type,
- AnchorAlignment anchor_alignment) const {
- gfx::Rect rect =
- GetBubbleAnchorRect(anchor_widget, anchor_type, anchor_alignment);
-
- if (IsHorizontalAlignment(shelf_alignment())) {
- // Moves the bubble to make its center aligns the center of the tray.
- int horizontal_offset =
- -rect.width() + (tray_container()->width() + kTrayPopupMinWidth) / 2;
- rect.Offset(horizontal_offset, 0);
- } else {
- // For vertical alignment, sets the bubble's bottom aligned to the bottom
- // of the icon for now.
- int vertical_offset = -rect.height() + tray_container()->height();
- rect.Offset(0, vertical_offset);
- }
- return rect;
-}
-
void ImeMenuTray::OnBeforeBubbleWidgetInit(
views::Widget* anchor_widget,
views::Widget* bubble_widget,
« no previous file with comments | « ash/common/system/chromeos/ime_menu/ime_menu_tray.h ('k') | ash/common/system/chromeos/palette/palette_tray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698