OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_AURA_TEST_TEST_WINDOW_DELEGATE_H_ | 5 #ifndef UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ |
6 #define UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ | 6 #define UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 DISALLOW_COPY_AND_ASSIGN(MaskedWindowDelegate); | 104 DISALLOW_COPY_AND_ASSIGN(MaskedWindowDelegate); |
105 }; | 105 }; |
106 | 106 |
107 // Keeps track of mouse/key events. | 107 // Keeps track of mouse/key events. |
108 class EventCountDelegate : public TestWindowDelegate { | 108 class EventCountDelegate : public TestWindowDelegate { |
109 public: | 109 public: |
110 EventCountDelegate(); | 110 EventCountDelegate(); |
111 | 111 |
112 // Overridden from TestWindowDelegate: | 112 // Overridden from TestWindowDelegate: |
113 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; | 113 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; |
114 virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; | 114 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; |
115 | 115 |
116 // Returns the counts of mouse motion events in the | 116 // Returns the counts of mouse motion events in the |
117 // form of "<enter> <move> <leave>". | 117 // form of "<enter> <move> <leave>". |
118 std::string GetMouseMotionCountsAndReset(); | 118 std::string GetMouseMotionCountsAndReset(); |
119 | 119 |
120 // Returns the counts of mouse button events in the | 120 // Returns the counts of mouse button events in the |
121 // form of "<press> <release>". | 121 // form of "<press> <release>". |
122 std::string GetMouseButtonCountsAndReset(); | 122 std::string GetMouseButtonCountsAndReset(); |
123 | 123 |
124 // Returns the counts of key events in the form of | 124 // Returns the counts of key events in the form of |
125 // "<press> <release>". | 125 // "<press> <release>". |
126 std::string GetKeyCountsAndReset(); | 126 std::string GetKeyCountsAndReset(); |
127 | 127 |
128 private: | 128 private: |
129 int mouse_enter_count_; | 129 int mouse_enter_count_; |
130 int mouse_move_count_; | 130 int mouse_move_count_; |
131 int mouse_leave_count_; | 131 int mouse_leave_count_; |
132 int mouse_press_count_; | 132 int mouse_press_count_; |
133 int mouse_release_count_; | 133 int mouse_release_count_; |
134 int key_press_count_; | 134 int key_press_count_; |
135 int key_release_count_; | 135 int key_release_count_; |
136 | 136 |
137 DISALLOW_COPY_AND_ASSIGN(EventCountDelegate); | 137 DISALLOW_COPY_AND_ASSIGN(EventCountDelegate); |
138 }; | 138 }; |
139 | 139 |
140 } // namespace test | 140 } // namespace test |
141 } // namespace aura | 141 } // namespace aura |
142 | 142 |
143 #endif // UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ | 143 #endif // UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ |
OLD | NEW |