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

Unified Diff: ui/aura/root_window.cc

Issue 10960015: aura: Start converting event-filters into event-handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: leak Created 8 years, 3 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/root_window.cc
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 8ac31e76f47df6b693badcdfd21e7dbc53534c80..9f8da7d9b15e50c5d01d47cda03482db7621ae8b 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -64,8 +64,6 @@ void GetEventFiltersToNotify(Window* target, EventFilters* filters) {
filters->push_back(target->event_filter());
target = target->parent();
}
- if (Env::GetInstance()->event_filter())
- filters->push_back(Env::GetInstance()->event_filter());
}
float GetDeviceScaleFactorFromDisplay(const Window* window) {
@@ -664,6 +662,18 @@ ui::TouchStatus RootWindow::ProcessTouchEvent(Window* target,
if (!target->IsVisible())
return ui::TOUCH_STATUS_UNKNOWN;
+ ui::Event::DispatcherApi dispatch_helper(event);
+ dispatch_helper.set_target(target);
+
+ const ui::EventHandlerList& pre_target =
+ Env::GetInstance()->pre_target_handlers();
+ for (ui::EventHandlerList::const_iterator iter = pre_target.begin();
+ iter != pre_target.end(); ++iter) {
+ ui::TouchStatus status = (*iter)->OnTouchEvent(event);
+ if (status != ui::TOUCH_STATUS_UNKNOWN)
+ return status;
+ }
+
EventFilters filters;
if (target == this)
GetEventFiltersToNotify(target, &filters);
@@ -674,8 +684,6 @@ ui::TouchStatus RootWindow::ProcessTouchEvent(Window* target,
WindowTracker tracker;
tracker.Add(target);
- ui::Event::DispatcherApi dispatcher(event);
- dispatcher.set_target(target);
for (EventFilters::const_reverse_iterator it = filters.rbegin(),
rend = filters.rend();
it != rend; ++it) {
@@ -791,8 +799,10 @@ bool RootWindow::CanDispatchToTarget(ui::EventTarget* target) {
}
void RootWindow::ProcessPreTargetList(ui::EventHandlerList* list) {
- if (Env::GetInstance()->event_filter())
- list->insert(list->begin(), Env::GetInstance()->event_filter());
+ const ui::EventHandlerList& pre_target =
+ Env::GetInstance()->pre_target_handlers();
+ if (pre_target.size() > 0)
+ list->insert(list->begin(), pre_target.begin(), pre_target.end());
}
void RootWindow::ProcessPostTargetList(ui::EventHandlerList* list) {
« ui/aura/env.h ('K') | « ui/aura/env.cc ('k') | ui/aura/shared/compound_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698