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

Unified Diff: ui/events/event_processor.cc

Issue 2681613002: Avoid two targeting phases in aura client-lib and EventProcessor. (Closed)
Patch Set: 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
« ui/aura/mus/window_tree_client.cc ('K') | « ui/events/event_processor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event_processor.cc
diff --git a/ui/events/event_processor.cc b/ui/events/event_processor.cc
index 61d2e72138a8dc51beb04f960b19197d715c750d..e44c042cc8d2da934a228c020cbcbbf304035f42 100644
--- a/ui/events/event_processor.cc
+++ b/ui/events/event_processor.cc
@@ -9,6 +9,10 @@
namespace ui {
+EventProcessor::~EventProcessor() {
+ delete event_target_;
sadrul 2017/02/07 04:04:54 This shouldn't be taking ownership of the event-ta
riajiang 2017/02/07 17:42:40 Right! And no longer need this event_target_ anymo
+}
+
EventDispatchDetails EventProcessor::OnEventFromSource(Event* event) {
EventTarget* root = GetRootTarget();
CHECK(root);
@@ -26,9 +30,13 @@ EventDispatchDetails EventProcessor::OnEventFromSource(Event* event) {
}
OnEventProcessingStarted(event_to_dispatch);
- EventTarget* target = NULL;
- if (!event_to_dispatch->handled())
+ EventTarget* target = nullptr;
+ if (event_target_) {
+ target = event_target_;
+ event_target_ = nullptr;
+ } else if (!event_to_dispatch->handled()) {
target = targeter->FindTargetForEvent(root, event_to_dispatch);
+ }
EventDispatchDetails details;
while (target) {
« ui/aura/mus/window_tree_client.cc ('K') | « ui/events/event_processor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698