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

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

Issue 2831583005: Enable Config::MUS to use classic IME instead of servicified IME. (Closed)
Patch Set: Fix compile errors in non ChromeOS. Created 3 years, 8 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
Index: ui/aura/mus/window_tree_client.cc
diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc
index 6f5956f9f4bae396b86542f3f28ea016abbcb7b1..3c87da5b008e9222b73f692e0f0f44896af9a99a 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -184,6 +184,12 @@ void DispatchEventToTarget(ui::Event* event, WindowMus* target) {
GetWindowTreeHostMus(target)->SendEventToSink(event);
}
+void IMEAckCallback(std::unique_ptr<EventResultCallback> result_callback,
+ bool handled) {
+ result_callback->Run(handled ? ui::mojom::EventResult::HANDLED
+ : ui::mojom::EventResult::UNHANDLED);
+}
+
} // namespace
WindowTreeClient::WindowTreeClient(
@@ -1235,9 +1241,10 @@ void WindowTreeClient::OnWindowInputEvent(uint32_t event_id,
tree_->OnWindowInputEventAck(event_id, ui::mojom::EventResult::UNHANDLED);
return;
}
- InputMethodMus* input_method = GetWindowTreeHostMus(window)->input_method();
- input_method->DispatchKeyEvent(event->AsKeyEvent(),
- CreateEventResultCallback(event_id));
+ GetWindowTreeHostMus(window)->DispatchEventToInputMethod(
+ event->AsKeyEvent(),
+ base::MakeUnique<InputMethodMus::AckCallback>(base::Bind(
+ &IMEAckCallback, Passed(CreateEventResultCallback(event_id)))));
return;
}

Powered by Google App Engine
This is Rietveld 408576698