OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TEST_TEST_EVENT_PROCESSOR_H_ | 5 #ifndef UI_EVENTS_TEST_TEST_EVENT_PROCESSOR_H_ |
6 #define UI_EVENTS_TEST_TEST_EVENT_PROCESSOR_H_ | 6 #define UI_EVENTS_TEST_TEST_EVENT_PROCESSOR_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 } | 23 } |
24 | 24 |
25 int num_times_processing_finished() const { | 25 int num_times_processing_finished() const { |
26 return num_times_processing_finished_; | 26 return num_times_processing_finished_; |
27 } | 27 } |
28 | 28 |
29 void set_should_processing_occur(bool occur) { | 29 void set_should_processing_occur(bool occur) { |
30 should_processing_occur_ = occur; | 30 should_processing_occur_ = occur; |
31 } | 31 } |
32 | 32 |
| 33 EventTarget* GetRoot(); |
33 void SetRoot(std::unique_ptr<EventTarget> root); | 34 void SetRoot(std::unique_ptr<EventTarget> root); |
34 void Reset(); | 35 void Reset(); |
35 | 36 |
36 // EventProcessor: | 37 // EventProcessor: |
37 bool CanDispatchToTarget(EventTarget* target) override; | 38 bool CanDispatchToTarget(EventTarget* target) override; |
38 EventTarget* GetRootTarget() override; | 39 EventTarget* GetRootForEvent(Event* event) override; |
| 40 EventTargeter* GetDefaultEventTargeter() override; |
39 EventDispatchDetails OnEventFromSource(Event* event) override; | 41 EventDispatchDetails OnEventFromSource(Event* event) override; |
40 void OnEventProcessingStarted(Event* event) override; | 42 void OnEventProcessingStarted(Event* event) override; |
41 void OnEventProcessingFinished(Event* event) override; | 43 void OnEventProcessingFinished(Event* event) override; |
42 | 44 |
43 private: | 45 private: |
44 std::unique_ptr<EventTarget> root_; | 46 std::unique_ptr<EventTarget> root_; |
45 | 47 |
46 // Used in our override of OnEventProcessingStarted(). If this value is | 48 // Used in our override of OnEventProcessingStarted(). If this value is |
47 // false, mark incoming events as handled. | 49 // false, mark incoming events as handled. |
48 bool should_processing_occur_; | 50 bool should_processing_occur_; |
49 | 51 |
50 // Counts the number of times OnEventProcessingStarted() has been called. | 52 // Counts the number of times OnEventProcessingStarted() has been called. |
51 int num_times_processing_started_; | 53 int num_times_processing_started_; |
52 | 54 |
53 // Counts the number of times OnEventProcessingFinished() has been called. | 55 // Counts the number of times OnEventProcessingFinished() has been called. |
54 int num_times_processing_finished_; | 56 int num_times_processing_finished_; |
55 | 57 |
56 DISALLOW_COPY_AND_ASSIGN(TestEventProcessor); | 58 DISALLOW_COPY_AND_ASSIGN(TestEventProcessor); |
57 }; | 59 }; |
58 | 60 |
59 } // namespace test | 61 } // namespace test |
60 } // namespace ui | 62 } // namespace ui |
61 | 63 |
62 #endif // UI_EVENTS_TEST_TEST_EVENT_PROCESSOR_H_ | 64 #endif // UI_EVENTS_TEST_TEST_EVENT_PROCESSOR_H_ |
OLD | NEW |