• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef UI_EVENTS_TEST_TEST_EVENT_PROCESSOR_H_
6 #define UI_EVENTS_TEST_TEST_EVENT_PROCESSOR_H_
7 
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/events/event_processor.h"
10 
11 namespace ui {
12 namespace test {
13 
14 class TestEventProcessor : public EventProcessor {
15  public:
16   TestEventProcessor();
17   virtual ~TestEventProcessor();
18 
19   void SetRoot(scoped_ptr<EventTarget> root);
20 
21   // EventProcessor:
22   virtual bool CanDispatchToTarget(EventTarget* target) OVERRIDE;
23   virtual EventTarget* GetRootTarget() OVERRIDE;
24   virtual EventDispatchDetails OnEventFromSource(Event* event) OVERRIDE;
25 
26  private:
27   scoped_ptr<EventTarget> root_;
28 
29   DISALLOW_COPY_AND_ASSIGN(TestEventProcessor);
30 };
31 
32 }  // namespace test
33 }  // namespace ui
34 
35 #endif  // UI_EVENTS_TEST_TEST_EVENT_PROCESSOR_H_
36