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

Unified Diff: ui/aura/window_event_dispatcher.cc

Issue 2872343003: Remove InputMethodEventHandler. (Closed)
Patch Set: addressed feedback. Created 3 years, 7 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 | « ui/aura/window_event_dispatcher.h ('k') | ui/aura/window_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_event_dispatcher.cc
diff --git a/ui/aura/window_event_dispatcher.cc b/ui/aura/window_event_dispatcher.cc
index 589529ea6c0889e70fdec7f5694377455cf2d70a..dc286d0826545413afb7ddb91314056bf84d439d 100644
--- a/ui/aura/window_event_dispatcher.cc
+++ b/ui/aura/window_event_dispatcher.cc
@@ -25,6 +25,7 @@
#include "ui/aura/window_tracker.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/hit_test.h"
+#include "ui/base/ime/input_method.h"
#include "ui/compositor/dip_util.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
@@ -92,6 +93,7 @@ WindowEventDispatcher::WindowEventDispatcher(WindowTreeHost* host)
dispatching_held_event_(nullptr),
observer_manager_(this),
event_targeter_(new WindowTargeter),
+ skip_ime_(false),
repost_event_factory_(this),
held_event_factory_(this) {
ui::GestureRecognizer::Get()->AddGestureEventHelper(this);
@@ -519,6 +521,8 @@ ui::EventDispatchDetails WindowEventDispatcher::PreDispatchEvent(
details = PreDispatchLocatedEvent(target_window, event->AsScrollEvent());
} else if (event->IsTouchEvent()) {
details = PreDispatchTouchEvent(target_window, event->AsTouchEvent());
+ } else if (event->IsKeyEvent()) {
+ details = PreDispatchKeyEvent(event->AsKeyEvent());
}
if (details.dispatcher_destroyed || details.target_destroyed)
return details;
@@ -929,4 +933,14 @@ DispatchDetails WindowEventDispatcher::PreDispatchTouchEvent(
return PreDispatchLocatedEvent(target, event);
}
+ui::EventDispatchDetails WindowEventDispatcher::PreDispatchKeyEvent(
+ ui::KeyEvent* event) {
+ if (skip_ime_ || !host_->has_input_method() ||
+ (event->flags() & ui::EF_IS_SYNTHESIZED))
+ return ui::EventDispatchDetails();
+ host_->GetInputMethod()->DispatchKeyEvent(event);
+ event->StopPropagation();
+ return ui::EventDispatchDetails();
+}
+
} // namespace aura
« no previous file with comments | « ui/aura/window_event_dispatcher.h ('k') | ui/aura/window_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698