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 7031002781fb81249231a9240e1a7cb98f196612..f264e4d4805a9a7cad33ca76b042834253dad7c3 100644 |
--- a/ui/aura/mus/window_tree_client.cc |
+++ b/ui/aura/mus/window_tree_client.cc |
@@ -1283,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)); |
@@ -1319,6 +1307,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. |