| Index: ui/events/event_processor.cc
|
| diff --git a/ui/events/event_processor.cc b/ui/events/event_processor.cc
|
| index 25c8c3fae92ca2b74e723fce69ee2fe6792b6c49..ddd18d84cf3c012ccec8cfeea1fdf0fa08372c36 100644
|
| --- a/ui/events/event_processor.cc
|
| +++ b/ui/events/event_processor.cc
|
| @@ -14,7 +14,6 @@ EventDispatchDetails EventProcessor::OnEventFromSource(Event* event) {
|
| CHECK(root);
|
| EventTargeter* targeter = root->GetEventTargeter();
|
| CHECK(targeter);
|
| - PrepareEventForDispatch(event);
|
|
|
| // If |event| is in the process of being dispatched or has already been
|
| // dispatched, then dispatch a copy of the event instead.
|
| @@ -26,32 +25,35 @@ EventDispatchDetails EventProcessor::OnEventFromSource(Event* event) {
|
| event_to_dispatch = event_copy.get();
|
| }
|
|
|
| - EventTarget* target = targeter->FindTargetForEvent(root, event_to_dispatch);
|
| EventDispatchDetails details;
|
| - while (target) {
|
| - details = DispatchEvent(target, event_to_dispatch);
|
| -
|
| - if (!dispatch_original_event) {
|
| - if (event_to_dispatch->stopped_propagation())
|
| - event->StopPropagation();
|
| - else if (event_to_dispatch->handled())
|
| - event->SetHandled();
|
| - }
|
| + if (OnEventProcessingStarted(event)) {
|
| + EventTarget* target = targeter->FindTargetForEvent(root, event_to_dispatch);
|
| + while (target) {
|
| + details = DispatchEvent(target, event_to_dispatch);
|
| +
|
| + if (!dispatch_original_event) {
|
| + if (event_to_dispatch->stopped_propagation())
|
| + event->StopPropagation();
|
| + else if (event_to_dispatch->handled())
|
| + event->SetHandled();
|
| + }
|
|
|
| - if (details.dispatcher_destroyed)
|
| - return details;
|
| + if (details.dispatcher_destroyed)
|
| + return details;
|
|
|
| - if (details.target_destroyed || event->handled())
|
| - break;
|
| + if (details.target_destroyed || event->handled())
|
| + break;
|
|
|
| - target = targeter->FindNextBestTarget(target, event_to_dispatch);
|
| + target = targeter->FindNextBestTarget(target, event_to_dispatch);
|
| + }
|
| }
|
|
|
| OnEventProcessingFinished(event);
|
| return details;
|
| }
|
|
|
| -void EventProcessor::PrepareEventForDispatch(Event* event) {
|
| +bool EventProcessor::OnEventProcessingStarted(Event* event) {
|
| + return true;
|
| }
|
|
|
| void EventProcessor::OnEventProcessingFinished(Event* event) {
|
|
|