Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Side by Side Diff: ui/aura/test/test_event_handler.h

Issue 206593004: Move TestEventHandler to ui/events/test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/test/test_event_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_AURA_TEST_TEST_EVENT_HANDLER_H_
6 #define UI_AURA_TEST_TEST_EVENT_HANDLER_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "ui/events/event_handler.h"
11
12 namespace aura {
13 namespace test {
14
15 // A simple EventHandler that keeps track of the number of key events that it's
16 // seen.
17 class TestEventHandler : public ui::EventHandler {
18 public:
19 TestEventHandler();
20 virtual ~TestEventHandler();
21
22 int num_key_events() const { return num_key_events_; }
23 int num_mouse_events() const { return num_mouse_events_; }
24 int num_scroll_events() const { return num_scroll_events_; }
25 int num_touch_events() const { return num_touch_events_; }
26 int num_gesture_events() const { return num_gesture_events_; }
27
28 void Reset();
29
30 // ui::EventHandler overrides:
31 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
32 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
33 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
34 virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
35 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
36
37 private:
38 // How many events have been received of each type?
39 int num_key_events_;
40 int num_mouse_events_;
41 int num_scroll_events_;
42 int num_touch_events_;
43 int num_gesture_events_;
44
45 DISALLOW_COPY_AND_ASSIGN(TestEventHandler);
46 };
47
48 } // namespace test
49 } // namespace aura
50
51 #endif // UI_AURA_TEST_TEST_EVENT_HANDLER_H_
OLDNEW
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/test/test_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698