Media Galleries API Metadata: Fix bugs in utility process cleanup.
[chromium-blink-merge.git] / ui / events / event_targeter.h
blobb93cc550b73c124e61e8018e7e4f4bf76cdb80e7
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_EVENTS_EVENT_TARGETER_H_
6 #define UI_EVENTS_EVENT_TARGETER_H_
8 #include "base/compiler_specific.h"
9 #include "ui/events/event.h"
10 #include "ui/events/events_export.h"
12 namespace ui {
14 class Event;
15 class EventTarget;
16 class LocatedEvent;
18 class EVENTS_EXPORT EventTargeter {
19 public:
20 virtual ~EventTargeter();
22 // Returns the target |event| should be dispatched to. If there is no such
23 // target, this should return NULL.
24 virtual EventTarget* FindTargetForEvent(EventTarget* root,
25 Event* event);
27 // Same as FindTargetForEvent(), but used for positional events. The location
28 // etc. of |event| are in |root|'s coordinate system. When finding the target
29 // for the event, the targeter can mutate the |event| (e.g. chnage the
30 // coordinate to be in the returned target's coordinate sustem) so that it can
31 // be dispatched to the target without any farther modification.
32 virtual EventTarget* FindTargetForLocatedEvent(EventTarget* root,
33 LocatedEvent* event);
35 // Returns true of |target| or one of its descendants can be a target of
36 // |event|. Note that the location etc. of |event| is in |target|'s parent's
37 // coordinate system.
38 virtual bool SubtreeShouldBeExploredForEvent(EventTarget* target,
39 const LocatedEvent& event);
42 } // namespace ui
44 #endif // UI_EVENTS_EVENT_TARGETER_H_