OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_EVENTS_EVENT_TARGET_H_ | 5 #ifndef UI_EVENTS_EVENT_TARGET_H_ |
6 #define UI_EVENTS_EVENT_TARGET_H_ | 6 #define UI_EVENTS_EVENT_TARGET_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "ui/events/event_handler.h" | 13 #include "ui/events/event_handler.h" |
14 #include "ui/events/events_export.h" | 14 #include "ui/events/events_export.h" |
15 | 15 |
16 namespace ui { | 16 namespace ui { |
17 | 17 |
18 class EventDispatcher; | 18 class EventDispatcher; |
19 class EventTargeter; | 19 class EventTargeter; |
20 class EventTargetIterator; | 20 class EventTargetIterator; |
21 class LocatedEvent; | 21 class LocatedEvent; |
22 | 22 |
(...skipping 17 matching lines...) Expand all Loading... |
40 EventTarget(); | 40 EventTarget(); |
41 virtual ~EventTarget(); | 41 virtual ~EventTarget(); |
42 | 42 |
43 virtual bool CanAcceptEvent(const Event& event) = 0; | 43 virtual bool CanAcceptEvent(const Event& event) = 0; |
44 | 44 |
45 // Returns the parent EventTarget in the event-target tree. | 45 // Returns the parent EventTarget in the event-target tree. |
46 virtual EventTarget* GetParentTarget() = 0; | 46 virtual EventTarget* GetParentTarget() = 0; |
47 | 47 |
48 // Returns an iterator an EventTargeter can use to iterate over the list of | 48 // Returns an iterator an EventTargeter can use to iterate over the list of |
49 // child EventTargets. | 49 // child EventTargets. |
50 virtual scoped_ptr<EventTargetIterator> GetChildIterator() const = 0; | 50 virtual std::unique_ptr<EventTargetIterator> GetChildIterator() const = 0; |
51 | 51 |
52 // Returns the EventTargeter that should be used to find the target for an | 52 // Returns the EventTargeter that should be used to find the target for an |
53 // event in the subtree rooted at this EventTarget. | 53 // event in the subtree rooted at this EventTarget. |
54 virtual EventTargeter* GetEventTargeter() = 0; | 54 virtual EventTargeter* GetEventTargeter() = 0; |
55 | 55 |
56 // Updates the states in |event| (e.g. location) to be suitable for |target|, | 56 // Updates the states in |event| (e.g. location) to be suitable for |target|, |
57 // so that |event| can be dispatched to |target|. | 57 // so that |event| can be dispatched to |target|. |
58 virtual void ConvertEventToTarget(EventTarget* target, | 58 virtual void ConvertEventToTarget(EventTarget* target, |
59 LocatedEvent* event); | 59 LocatedEvent* event); |
60 | 60 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 EventHandlerList pre_target_list_; | 100 EventHandlerList pre_target_list_; |
101 EventHandlerList post_target_list_; | 101 EventHandlerList post_target_list_; |
102 EventHandler* target_handler_; | 102 EventHandler* target_handler_; |
103 | 103 |
104 DISALLOW_COPY_AND_ASSIGN(EventTarget); | 104 DISALLOW_COPY_AND_ASSIGN(EventTarget); |
105 }; | 105 }; |
106 | 106 |
107 } // namespace ui | 107 } // namespace ui |
108 | 108 |
109 #endif // UI_EVENTS_EVENT_TARGET_H_ | 109 #endif // UI_EVENTS_EVENT_TARGET_H_ |
OLD | NEW |