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
3 // found in the LICENSE file.
5 #ifndef UI_EVENTS_TEST_TEST_EVENT_PROCESSOR_H_
6 #define UI_EVENTS_TEST_TEST_EVENT_PROCESSOR_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/events/event_processor.h"
14 class TestEventProcessor : public EventProcessor {
17 virtual ~TestEventProcessor();
19 int num_times_processing_finished() const {
20 return num_times_processing_finished_;
23 void SetRoot(scoped_ptr<EventTarget> root);
27 virtual bool CanDispatchToTarget(EventTarget* target) OVERRIDE;
28 virtual EventTarget* GetRootTarget() OVERRIDE;
29 virtual EventDispatchDetails OnEventFromSource(Event* event) OVERRIDE;
30 virtual void OnEventProcessingFinished(Event* event) OVERRIDE;
33 scoped_ptr<EventTarget> root_;
35 // Counts the number of times OnEventProcessingFinished() has been called.
36 int num_times_processing_finished_;
38 DISALLOW_COPY_AND_ASSIGN(TestEventProcessor);
44 #endif // UI_EVENTS_TEST_TEST_EVENT_PROCESSOR_H_