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

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

Issue 2474843002: Add virtual keyboard item into opt-in IME menu. (Closed)
Patch Set: 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
« no previous file with comments | « ash/common/system/chromeos/ime_menu/ime_menu_tray.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(&current_ime_);
« no previous file with comments | « ash/common/system/chromeos/ime_menu/ime_menu_tray.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698