| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 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 CHROME_TEST_CHROMEDRIVER_UI_EVENTS_H_ | |
| 6 #define CHROME_TEST_CHROMEDRIVER_UI_EVENTS_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "ui/base/keycodes/keyboard_codes.h" | |
| 11 | |
| 12 // Specifies the type of the mouse event. | |
| 13 enum MouseEventType { | |
| 14 kPressedMouseEventType = 0, | |
| 15 kReleasedMouseEventType, | |
| 16 kMovedMouseEventType | |
| 17 }; | |
| 18 | |
| 19 // Specifies the mouse buttons. | |
| 20 enum MouseButton { | |
| 21 kLeftMouseButton = 0, | |
| 22 kMiddleMouseButton, | |
| 23 kRightMouseButton, | |
| 24 kNoneMouseButton | |
| 25 }; | |
| 26 | |
| 27 struct MouseEvent { | |
| 28 MouseEvent(MouseEventType type, | |
| 29 MouseButton button, | |
| 30 int x, | |
| 31 int y, | |
| 32 int click_count); | |
| 33 ~MouseEvent(); | |
| 34 | |
| 35 MouseEventType type; | |
| 36 MouseButton button; | |
| 37 int x; | |
| 38 int y; | |
| 39 // |click_count| should not be negative. | |
| 40 int click_count; | |
| 41 }; | |
| 42 | |
| 43 // Specifies the type of the keyboard event. | |
| 44 enum KeyEventType { | |
| 45 kKeyDownEventType = 0, | |
| 46 kKeyUpEventType, | |
| 47 kRawKeyDownEventType, | |
| 48 kCharEventType | |
| 49 }; | |
| 50 | |
| 51 // Specifies modifier keys as stated in | |
| 52 // third_party/WebKit/Source/WebCore/inspector/Inspector.json. | |
| 53 // Notice: |kNumLockKeyModifierMask| is for usage in the key_converter.cc | |
| 54 // and keycode_text_conversion_x.cc only, not for inspector. | |
| 55 enum KeyModifierMask { | |
| 56 kAltKeyModifierMask = 1 << 0, | |
| 57 kControlKeyModifierMask = 1 << 1, | |
| 58 kMetaKeyModifierMask = 1 << 2, | |
| 59 kShiftKeyModifierMask = 1 << 3, | |
| 60 kNumLockKeyModifierMask = 1 << 4 | |
| 61 }; | |
| 62 | |
| 63 struct KeyEvent { | |
| 64 KeyEvent(KeyEventType type, | |
| 65 int modifiers, | |
| 66 const std::string& modified_text, | |
| 67 const std::string& unmodified_text, | |
| 68 ui::KeyboardCode key_code); | |
| 69 ~KeyEvent(); | |
| 70 | |
| 71 KeyEventType type; | |
| 72 int modifiers; | |
| 73 std::string modified_text; | |
| 74 std::string unmodified_text; | |
| 75 ui::KeyboardCode key_code; | |
| 76 }; | |
| 77 | |
| 78 #endif // CHROME_TEST_CHROMEDRIVER_UI_EVENTS_H_ | |
| OLD | NEW |