| Index: ui/aura/root_window.cc
|
| diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
|
| index 8ac31e76f47df6b693badcdfd21e7dbc53534c80..ac8e7bdc408f60240005d7d28c11c32faa02d51d 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) {
|
| @@ -476,6 +474,13 @@ void RootWindow::SetTransform(const ui::Transform& transform) {
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| +// RootWindow, ui::EventTarget implementation:
|
| +
|
| +ui::EventTarget* RootWindow::GetParentTarget() {
|
| + return Env::GetInstance();
|
| +}
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| // RootWindow, ui::CompositorDelegate implementation:
|
|
|
| void RootWindow::ScheduleDraw() {
|
| @@ -664,6 +669,22 @@ 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);
|
| +
|
| + // It is necessary to dispatch the event to the event-handlers on env first.
|
| + // TODO(sad): Fix touch-event handling so it can use the same
|
| + // event-dispatching code used for other events.
|
| + ui::EventTarget::DispatcherApi dispatch_target_helper(Env::GetInstance());
|
| + const ui::EventHandlerList& pre_target =
|
| + dispatch_target_helper.pre_target_list();
|
| + 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 +695,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,12 +810,9 @@ 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());
|
| }
|
|
|
| void RootWindow::ProcessPostTargetList(ui::EventHandlerList* list) {
|
| - // TODO(sad):
|
| }
|
|
|
| bool RootWindow::DispatchLongPressGestureEvent(ui::GestureEvent* event) {
|
|
|