Commit 2fdfd846 authored by azurewei's avatar azurewei Committed by Commit bot

Show/Hide the shelf when showing/hiding IME menu.

If the shelf is auto-hidden, show the opt-in IME menu with accelerator 'Alt+Shilf+K', the IME menu bubble cannot be oped right (it opens half off the screen, shifted to the right).
We should notify to bring out the shelf before showing the IME menu.

When closing the opt-in IME menu with 'Esc' key, the shelf cannot be auto hidden immediately. We should notify the auto hide state changed to auto hide the shelf.

BUG=642423
TEST=Verified on local build.

Review-Url: https://codereview.chromium.org/2432163006
Cr-Commit-Position: refs/heads/master@{#427223}
parent c3da4b51
...@@ -293,6 +293,7 @@ ImeMenuTray::~ImeMenuTray() { ...@@ -293,6 +293,7 @@ ImeMenuTray::~ImeMenuTray() {
} }
void ImeMenuTray::ShowImeMenuBubble() { void ImeMenuTray::ShowImeMenuBubble() {
should_block_shelf_auto_hide_ = true;
views::TrayBubbleView::InitParams init_params( views::TrayBubbleView::InitParams init_params(
views::TrayBubbleView::ANCHOR_TYPE_TRAY, GetAnchorAlignment(), views::TrayBubbleView::ANCHOR_TYPE_TRAY, GetAnchorAlignment(),
kTrayPopupMinWidth, kTrayPopupMaxWidth); kTrayPopupMinWidth, kTrayPopupMaxWidth);
...@@ -353,7 +354,6 @@ void ImeMenuTray::ShowImeMenuBubble() { ...@@ -353,7 +354,6 @@ void ImeMenuTray::ShowImeMenuBubble() {
bubble_.reset(new TrayBubbleWrapper(this, bubble_view)); bubble_.reset(new TrayBubbleWrapper(this, bubble_view));
SetDrawBackgroundAsActive(true); SetDrawBackgroundAsActive(true);
should_block_shelf_auto_hide_ = true;
} }
void ImeMenuTray::HideImeMenuBubble() { void ImeMenuTray::HideImeMenuBubble() {
...@@ -361,6 +361,7 @@ void ImeMenuTray::HideImeMenuBubble() { ...@@ -361,6 +361,7 @@ void ImeMenuTray::HideImeMenuBubble() {
ime_list_view_ = nullptr; ime_list_view_ = nullptr;
SetDrawBackgroundAsActive(false); SetDrawBackgroundAsActive(false);
should_block_shelf_auto_hide_ = false; should_block_shelf_auto_hide_ = false;
shelf()->UpdateAutoHideState();
} }
bool ImeMenuTray::IsImeMenuBubbleShown() { bool ImeMenuTray::IsImeMenuBubbleShown() {
......
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