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

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: Addressed feedback. 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 b69109eb2360aab9f44f2615a3cf70c5837c85c5..128a591547fc3555731dfc7e9b3c030ad9ba63db 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -52,6 +52,7 @@
#include "ui/base/ui_base_types.h"
#include "ui/display/screen.h"
#include "ui/events/event.h"
+#include "ui/events/event_sink.h"
#include "ui/gfx/geometry/dip_util.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/size.h"
@@ -1282,18 +1283,6 @@ void WindowTreeClient::OnWindowInputEvent(uint32_t event_id,
WindowMus* window = GetWindowByServerId(window_id); // May be null.
- if (event->IsKeyEvent()) {
- DCHECK(!matches_pointer_watcher); // PointerWatcher isn't for key events.
- if (!window || !window->GetWindow()->GetHost()) {
- tree_->OnWindowInputEventAck(event_id, ui::mojom::EventResult::UNHANDLED);
- return;
- }
- InputMethodMus* input_method = GetWindowTreeHostMus(window)->input_method();
- input_method->DispatchKeyEvent(event->AsKeyEvent(),
- CreateEventResultCallback(event_id));
- return;
- }
-
if (matches_pointer_watcher && has_pointer_watcher_) {
DCHECK(event->IsPointerEvent());
std::unique_ptr<ui::Event> event_in_dip(ui::Event::Clone(*event));
@@ -1308,6 +1297,15 @@ void WindowTreeClient::OnWindowInputEvent(uint32_t event_id,
return;
}
+ if (event->IsKeyEvent()) {
+ InputMethodMus* input_method = GetWindowTreeHostMus(window)->input_method();
+ if (input_method) {
+ input_method->DispatchKeyEvent(event->AsKeyEvent(),
+ CreateEventResultCallback(event_id));
+ return;
+ }
+ }
+
EventAckHandler ack_handler(CreateEventResultCallback(event_id));
// TODO(moshayedi): crbug.com/617222. No need to convert to ui::MouseEvent or
// ui::TouchEvent once we have proper support for pointer events.

Powered by Google App Engine
This is Rietveld 408576698