// tree of EventTargets.
class EVENTS_EXPORT EventProcessor : public EventDispatcherDelegate {
public:
- virtual ~EventProcessor() {}
+ ~EventProcessor() override {}
// Returns the root of the tree this event processor owns.
virtual EventTarget* GetRootTarget() = 0;
// EventTargets (whose root is returned by GetRootTarget()). The co-ordinate
// space of the source must be the same as the root target, except that the
// target may have a high-dpi scale applied.
+ // TODO(tdanderson|sadrul): This is only virtual for testing purposes. It
+ // should not be virtual at all.
virtual EventDispatchDetails OnEventFromSource(Event* event)
WARN_UNUSED_RESULT;
protected:
- // Prepares the event so that it can be dispatched. This is invoked before
- // an EventTargeter is used to find the target of the event. So this can be
- // used to update the event so that the targeter can operate correctly (e.g.
- // it can be used to updated the location of the event when disptaching from
- // an EventSource in high-DPI).
- virtual void PrepareEventForDispatch(Event* event);
+ // Invoked at the start of processing, before an EventTargeter is used to
+ // find the target of the event. If processing should not take place, marks
+ // |event| as handled. Otherwise updates |event| so that the targeter can
+ // operate correctly (e.g., it can be used to update the location of the
+ // event when dispatching from an EventSource in high-DPI) and updates any
+ // members in the event processor as necessary.
+ virtual void OnEventProcessingStarted(Event* event);
// Invoked when the processing of |event| has finished (i.e., when no further
// dispatching of |event| will be performed by this EventProcessor). Note