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

Unified Diff: ui/aura/mus/input_method_mus.cc

Issue 2704553002: chromeos: Makes InputMethodMus dispatch immediately if no server (Closed)
Patch Set: comment Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/input_method_mus.cc
diff --git a/ui/aura/mus/input_method_mus.cc b/ui/aura/mus/input_method_mus.cc
index d629df2a8702c6c9c379b7433293bef5a8c64700..df3ef42280be4dcb783680a923187af7cd5f4e3b 100644
--- a/ui/aura/mus/input_method_mus.cc
+++ b/ui/aura/mus/input_method_mus.cc
@@ -54,7 +54,7 @@ void InputMethodMus::DispatchKeyEvent(
// If no text input client, do nothing.
if (!GetTextInputClient()) {
- ignore_result(DispatchKeyEventPostIME(event));
+ DispatchKeyEventPostIME(event);
if (ack_callback) {
ack_callback->Run(event->handled() ? EventResult::HANDLED
: EventResult::UNHANDLED);
@@ -122,6 +122,13 @@ bool InputMethodMus::IsCandidatePopupOpen() const {
void InputMethodMus::SendKeyEventToInputMethod(
const ui::KeyEvent& event,
std::unique_ptr<EventResultCallback> ack_callback) {
+ if (!input_method_) {
+ // This code path is hit in tests that don't connect to the server.
+ DCHECK(!ack_callback);
+ std::unique_ptr<ui::Event> event_clone = ui::Event::Clone(event);
+ DispatchKeyEventPostIME(event_clone->AsKeyEvent());
+ return;
+ }
// IME driver will notify us whether it handled the event or not by calling
// ProcessKeyEventCallback(), in which we will run the |ack_callback| to tell
// the window server if client handled the event or not.
@@ -180,7 +187,7 @@ void InputMethodMus::ProcessKeyEventCallback(
// any client-side post-ime processing needs to be done. This includes cases
// like backspace, return key, etc.
std::unique_ptr<ui::Event> event_clone = ui::Event::Clone(event);
- ignore_result(DispatchKeyEventPostIME(event_clone->AsKeyEvent()));
+ DispatchKeyEventPostIME(event_clone->AsKeyEvent());
event_result =
event_clone->handled() ? EventResult::HANDLED : EventResult::UNHANDLED;
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698