Chromium Code Reviews| 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 5b9cd38b88a8bb2f1deb7240b993a381c04807e3..098064059ba76b82651300171bf5e2c6dcd02418 100644 |
| --- a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc |
| +++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc |
| @@ -8,6 +8,7 @@ |
| #include "ash/common/shelf/wm_shelf_util.h" |
| #include "ash/common/shell_window_ids.h" |
| #include "ash/common/system/chromeos/ime_menu/ime_list_view.h" |
| +#include "ash/common/system/tray/fixed_sized_scroll_view.h" |
| #include "ash/common/system/tray/system_tray_delegate.h" |
| #include "ash/common/system/tray/system_tray_notifier.h" |
| #include "ash/common/system/tray/tray_constants.h" |
| @@ -28,6 +29,11 @@ namespace ash { |
| namespace { |
| +// Returns the max height of ImeListView. |
| +int GetImeListViewMaxHeight() { |
| + return GetTrayConstant(TRAY_POPUP_ITEM_HEIGHT) * 7; |
|
James Cook
2016/08/23 15:47:12
nit: Use a named constant for 7, like const int ma
|
| +} |
| + |
| class ImeMenuLabel : public views::Label { |
| public: |
| ImeMenuLabel() {} |
| @@ -258,9 +264,14 @@ void ImeMenuTray::ShowImeMenuBubble() { |
| bubble_view->set_margins(gfx::Insets(7, 0, 0, 0)); |
| bubble_view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); |
| + ImeListView* ime_list_view = |
| + new ImeListView(nullptr, false, ImeListView::SHOW_SINGLE_IME); |
| + if (ime_list_view->scroll_content()->height() > GetImeListViewMaxHeight()) { |
| + ime_list_view->scroller()->SetFixedSize( |
| + gfx::Size(kTrayPopupMaxWidth, GetImeListViewMaxHeight())); |
| + } |
| // Adds IME list to the bubble. |
| - bubble_view->AddChildView( |
| - new ImeListView(nullptr, false, ImeListView::SHOW_SINGLE_IME)); |
| + bubble_view->AddChildView(ime_list_view); |
| // Adds IME buttons to the bubble if needed. |
| LoginStatus login = |