| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 5 |
| 6 /* | 6 /* |
| 7 EventSendingController class: | 7 EventSendingController class: |
| 8 Bound to a JavaScript window.eventSender object using | 8 Bound to a JavaScript window.eventSender object using |
| 9 CppBoundClass::BindToJavascript(), this allows layout tests that are run in | 9 CppBoundClass::BindToJavascript(), this allows layout tests that are run in |
| 10 the test_shell to fire DOM events. | 10 the test_shell to fire DOM events. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 // Returns true if dragMode is true. | 65 // Returns true if dragMode is true. |
| 66 bool drag_mode() { return dragMode.isBool() && dragMode.ToBoolean(); } | 66 bool drag_mode() { return dragMode.isBool() && dragMode.ToBoolean(); } |
| 67 | 67 |
| 68 // Sometimes we queue up mouse move and mouse up events for drag drop | 68 // Sometimes we queue up mouse move and mouse up events for drag drop |
| 69 // handling purposes. These methods dispatch the event. | 69 // handling purposes. These methods dispatch the event. |
| 70 static void DoMouseMove(const WebMouseEvent& e); | 70 static void DoMouseMove(const WebMouseEvent& e); |
| 71 static void DoMouseUp(const WebMouseEvent& e); | 71 static void DoMouseUp(const WebMouseEvent& e); |
| 72 static void ReplaySavedEvents(); | 72 static void ReplaySavedEvents(); |
| 73 | 73 |
| 74 // Helper to extract the optional arg from mouseDown() and mouseUp() | 74 // Helper to return the button type given a button code |
| 75 static WebMouseEvent::Button GetButtonTypeFromSingleArg( | 75 static WebMouseEvent::Button GetButtonTypeFromButtonNumber(int button_code); |
| 76 const CppArgumentList& args); | 76 |
| 77 // Helper to extract the button number from the optional argument in |
| 78 // mouseDown and mouseUp |
| 79 static int GetButtonNumberFromSingleArg(const CppArgumentList& args); |
| 77 | 80 |
| 78 // Returns true if the key_code passed in needs a shift key modifier to | 81 // Returns true if the key_code passed in needs a shift key modifier to |
| 79 // be passed into the generated event. | 82 // be passed into the generated event. |
| 80 bool NeedsShiftModifer(wchar_t key_code); | 83 bool NeedsShiftModifer(wchar_t key_code); |
| 81 | 84 |
| 82 // Non-owning pointer. The LayoutTestController is owned by the host. | 85 // Non-owning pointer. The LayoutTestController is owned by the host. |
| 83 static TestShell* shell_; | 86 static TestShell* shell_; |
| 84 | 87 |
| 85 // Location of last mouseMoveTo event. | 88 // Location of last mouseMoveTo event. |
| 86 static gfx::Point last_mouse_pos_; | 89 static gfx::Point last_mouse_pos_; |
| 87 | 90 |
| 88 // Currently pressed mouse button (Left/Right/Middle or None) | 91 // Currently pressed mouse button (Left/Right/Middle or None) |
| 89 static WebMouseEvent::Button pressed_button_; | 92 static WebMouseEvent::Button pressed_button_; |
| 93 |
| 94 // The last button number passed to mouseDown and mouseUp. |
| 95 // Used to determine whether the click count continues to |
| 96 // increment or not. |
| 97 static int last_button_number_; |
| 90 }; | 98 }; |
| 91 | 99 |
| 92 #endif // WEBKIT_TOOLS_TEST_SHELL_EVENT_SENDING_CONTROLLER_H_ | 100 #endif // WEBKIT_TOOLS_TEST_SHELL_EVENT_SENDING_CONTROLLER_H_ |
| 93 | 101 |
| OLD | NEW |