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

Unified Diff: components/arc/ime/arc_ime_service.cc

Issue 2039233003: Showing virtual keyboard when input type changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ImeHost.ShowImeIfNeeded to ARC bridge Created 4 years, 6 months 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 | « components/arc/ime/arc_ime_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/ime/arc_ime_service.cc
diff --git a/components/arc/ime/arc_ime_service.cc b/components/arc/ime/arc_ime_service.cc
index 3e4e4da932d13f4cb61a9b6306c4a0731139f688..7f268a4894ff5346a8dae4e8cb799329ee34141b 100644
--- a/components/arc/ime/arc_ime_service.cc
+++ b/components/arc/ime/arc_ime_service.cc
@@ -126,22 +126,11 @@ void ArcImeService::OnWindowFocused(aura::Window* gained_focus,
// Overridden from arc::ArcImeBridge::Delegate
void ArcImeService::OnTextInputTypeChanged(ui::TextInputType type) {
- if (ime_type_ == type)
kinaba 2016/06/14 04:22:08 Although it's a matter of taste, can we keep this
takaoka 2016/06/14 05:55:51 Done.
- return;
+ ui::TextInputType previous_type = ime_type_;
ime_type_ = type;
-
ui::InputMethod* const input_method = GetInputMethod();
- if (input_method) {
+ if (input_method && ime_type_ != previous_type) {
input_method->OnTextInputTypeChanged(this);
- if (input_method->GetTextInputClient() == this &&
- ime_type_ != ui::TEXT_INPUT_TYPE_NONE) {
- // TODO(kinaba): crbug.com/581282. This is tentative short-term solution.
- //
- // For fully correct implementation, rather than to piggyback the "show"
- // request with the input type change, we need dedicated IPCs to share the
- // virtual keyboard show/hide states between Chromium and ARC.
- input_method->ShowImeIfNeeded();
kinaba 2016/06/14 04:22:08 Removing this code at once causes a regression in
takaoka 2016/06/14 05:55:51 Done.
- }
}
}
@@ -161,6 +150,13 @@ void ArcImeService::OnCancelComposition() {
input_method->CancelComposition(this);
}
+void ArcImeService::ShowImeIfNeeded() {
+ ui::InputMethod* const input_method = GetInputMethod();
+ if (input_method && input_method->GetTextInputClient() == this) {
+ input_method->ShowImeIfNeeded();
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
// Oberridden from ui::TextInputClient:
« no previous file with comments | « components/arc/ime/arc_ime_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698