| 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(); | |
| 34 void SetRoot(std::unique_ptr<EventTarget> root); | 33 void SetRoot(std::unique_ptr<EventTarget> root); |
| 35 void Reset(); | 34 void Reset(); |
| 36 | 35 |
| 37 // EventProcessor: | 36 // EventProcessor: |
| 38 bool CanDispatchToTarget(EventTarget* target) override; | 37 bool CanDispatchToTarget(EventTarget* target) override; |
| 39 EventTarget* GetRootForEvent(Event* event) override; | 38 EventTarget* GetRootTarget() override; |
| 40 EventTargeter* GetDefaultEventTargeter() override; | |
| 41 EventDispatchDetails OnEventFromSource(Event* event) override; | 39 EventDispatchDetails OnEventFromSource(Event* event) override; |
| 42 void OnEventProcessingStarted(Event* event) override; | 40 void OnEventProcessingStarted(Event* event) override; |
| 43 void OnEventProcessingFinished(Event* event) override; | 41 void OnEventProcessingFinished(Event* event) override; |
| 44 | 42 |
| 45 private: | 43 private: |
| 46 std::unique_ptr<EventTarget> root_; | 44 std::unique_ptr<EventTarget> root_; |
| 47 | 45 |
| 48 // Used in our override of OnEventProcessingStarted(). If this value is | 46 // Used in our override of OnEventProcessingStarted(). If this value is |
| 49 // false, mark incoming events as handled. | 47 // false, mark incoming events as handled. |
| 50 bool should_processing_occur_; | 48 bool should_processing_occur_; |
| 51 | 49 |
| 52 // Counts the number of times OnEventProcessingStarted() has been called. | 50 // Counts the number of times OnEventProcessingStarted() has been called. |
| 53 int num_times_processing_started_; | 51 int num_times_processing_started_; |
| 54 | 52 |
| 55 // Counts the number of times OnEventProcessingFinished() has been called. | 53 // Counts the number of times OnEventProcessingFinished() has been called. |
| 56 int num_times_processing_finished_; | 54 int num_times_processing_finished_; |
| 57 | 55 |
| 58 DISALLOW_COPY_AND_ASSIGN(TestEventProcessor); | 56 DISALLOW_COPY_AND_ASSIGN(TestEventProcessor); |
| 59 }; | 57 }; |
| 60 | 58 |
| 61 } // namespace test | 59 } // namespace test |
| 62 } // namespace ui | 60 } // namespace ui |
| 63 | 61 |
| 64 #endif // UI_EVENTS_TEST_TEST_EVENT_PROCESSOR_H_ | 62 #endif // UI_EVENTS_TEST_TEST_EVENT_PROCESSOR_H_ |
| OLD | NEW |