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 92423349d3f77378cda459cd1a10ffb70d3008b1..bbc93630ed182e57bde088cbc43dc61298cd5670 100644 |
| --- a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc |
| +++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc |
| @@ -279,7 +279,8 @@ ImeMenuTray::ImeMenuTray(WmShelf* wm_shelf) |
| label_(new ImeMenuLabel()), |
| show_keyboard_(false), |
| force_show_keyboard_(false), |
| - should_block_shelf_auto_hide_(false) { |
| + should_block_shelf_auto_hide_(false), |
| + keyboard_suppressed_(false) { |
| SetupLabelForTray(label_); |
| tray_container()->AddChildView(label_); |
| SetContentsBackground(); |
| @@ -321,8 +322,8 @@ void ImeMenuTray::ShowImeMenuBubble() { |
| } |
| // Adds IME list to the bubble. |
| - ime_list_view_ = |
| - new ImeListView(nullptr, false, ImeListView::SHOW_SINGLE_IME); |
| + ime_list_view_ = new ImeListView(nullptr, ShouldShowKeyboardToggle(), |
| + ImeListView::SHOW_SINGLE_IME); |
| uint32_t current_height = ime_list_view_->scroll_content()->height(); |
| const gfx::Range height_range = GetImeListViewRange(); |
| @@ -406,6 +407,11 @@ bool ImeMenuTray::ShouldBlockShelfAutoHide() const { |
| return should_block_shelf_auto_hide_; |
| } |
| +bool ImeMenuTray::ShouldShowKeyboardToggle() const { |
| + return keyboard_suppressed_ && |
|
tdanderson
2016/11/03 21:17:20
I left the following comment in https://chromiumco
Azure Wei
2016/11/20 08:56:23
The method return true when the 'smart deploy togg
|
| + !WmShell::Get()->accessibility_delegate()->IsVirtualKeyboardEnabled(); |
| +} |
| + |
| void ImeMenuTray::SetShelfAlignment(ShelfAlignment alignment) { |
| TrayBackgroundView::SetShelfAlignment(alignment); |
| if (!MaterialDesignController::IsShelfMaterial()) |
| @@ -534,6 +540,12 @@ void ImeMenuTray::OnKeyboardHidden() { |
| force_show_keyboard_ = false; |
| } |
| +void ImeMenuTray::OnKeyboardSuppressionChanged(bool suppressed) { |
| + if (suppressed != keyboard_suppressed_ && bubble_) |
| + HideImeMenuBubble(); |
| + keyboard_suppressed_ = suppressed; |
| +} |
| + |
| void ImeMenuTray::UpdateTrayLabel() { |
| WmShell::Get()->system_tray_delegate()->GetCurrentIME(¤t_ime_); |