| 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. |
| 11 | 11 |
| 12 The OSX reference file is in | 12 The OSX reference file is in |
| 13 WebKit/WebKitTools/DumpRenderTree/EventSendingController.m | 13 WebKit/WebKitTools/DumpRenderTree/EventSendingController.m |
| 14 */ | 14 */ |
| 15 | 15 |
| 16 #ifndef WEBKIT_TOOLS_TEST_SHELL_EVENT_SENDING_CONTROLLER_H_ | 16 #ifndef WEBKIT_TOOLS_TEST_SHELL_EVENT_SENDING_CONTROLLER_H_ |
| 17 #define WEBKIT_TOOLS_TEST_SHELL_EVENT_SENDING_CONTROLLER_H_ | 17 #define WEBKIT_TOOLS_TEST_SHELL_EVENT_SENDING_CONTROLLER_H_ |
| 18 | 18 |
| 19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 20 #include "base/gfx/point.h" | 20 #include "base/gfx/point.h" |
| 21 #include "base/task.h" | 21 #include "base/task.h" |
| 22 #include "webkit/api/public/WebDragOperation.h" |
| 22 #include "webkit/api/public/WebInputEvent.h" | 23 #include "webkit/api/public/WebInputEvent.h" |
| 23 #include "webkit/glue/cpp_bound_class.h" | 24 #include "webkit/glue/cpp_bound_class.h" |
| 24 | 25 |
| 25 class TestShell; | 26 class TestShell; |
| 26 class WebView; | 27 class WebView; |
| 27 | 28 |
| 28 namespace WebKit { | 29 namespace WebKit { |
| 29 class WebDragData; | 30 class WebDragData; |
| 30 class WebMouseEvent; | 31 class WebMouseEvent; |
| 32 struct WebPoint; |
| 31 } | 33 } |
| 32 | 34 |
| 33 class EventSendingController : public CppBoundClass { | 35 class EventSendingController : public CppBoundClass { |
| 34 public: | 36 public: |
| 35 // Builds the property and method lists needed to bind this class to a JS | 37 // Builds the property and method lists needed to bind this class to a JS |
| 36 // object. | 38 // object. |
| 37 EventSendingController(TestShell* shell); | 39 EventSendingController(TestShell* shell); |
| 38 | 40 |
| 39 // Resets some static variable state. | 41 // Resets some static variable state. |
| 40 void Reset(); | 42 void Reset(); |
| 41 | 43 |
| 42 // Simulate drag&drop system call. | 44 // Simulate drag&drop system call. |
| 43 static void DoDragDrop(const WebKit::WebDragData& drag_data); | 45 static void DoDragDrop(const WebKit::WebPoint &event_pos, |
| 46 const WebKit::WebDragData& drag_data, |
| 47 WebKit::WebDragOperationsMask operations_mask); |
| 44 | 48 |
| 45 // JS callback methods. | 49 // JS callback methods. |
| 46 void mouseDown(const CppArgumentList& args, CppVariant* result); | 50 void mouseDown(const CppArgumentList& args, CppVariant* result); |
| 47 void mouseUp(const CppArgumentList& args, CppVariant* result); | 51 void mouseUp(const CppArgumentList& args, CppVariant* result); |
| 48 void mouseMoveTo(const CppArgumentList& args, CppVariant* result); | 52 void mouseMoveTo(const CppArgumentList& args, CppVariant* result); |
| 49 void leapForward(const CppArgumentList& args, CppVariant* result); | 53 void leapForward(const CppArgumentList& args, CppVariant* result); |
| 50 void keyDown(const CppArgumentList& args, CppVariant* result); | 54 void keyDown(const CppArgumentList& args, CppVariant* result); |
| 51 void dispatchMessage(const CppArgumentList& args, CppVariant* result); | 55 void dispatchMessage(const CppArgumentList& args, CppVariant* result); |
| 52 void textZoomIn(const CppArgumentList& args, CppVariant* result); | 56 void textZoomIn(const CppArgumentList& args, CppVariant* result); |
| 53 void textZoomOut(const CppArgumentList& args, CppVariant* result); | 57 void textZoomOut(const CppArgumentList& args, CppVariant* result); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // Currently pressed mouse button (Left/Right/Middle or None) | 115 // Currently pressed mouse button (Left/Right/Middle or None) |
| 112 static WebKit::WebMouseEvent::Button pressed_button_; | 116 static WebKit::WebMouseEvent::Button pressed_button_; |
| 113 | 117 |
| 114 // The last button number passed to mouseDown and mouseUp. | 118 // The last button number passed to mouseDown and mouseUp. |
| 115 // Used to determine whether the click count continues to | 119 // Used to determine whether the click count continues to |
| 116 // increment or not. | 120 // increment or not. |
| 117 static int last_button_number_; | 121 static int last_button_number_; |
| 118 }; | 122 }; |
| 119 | 123 |
| 120 #endif // WEBKIT_TOOLS_TEST_SHELL_EVENT_SENDING_CONTROLLER_H_ | 124 #endif // WEBKIT_TOOLS_TEST_SHELL_EVENT_SENDING_CONTROLLER_H_ |
| OLD | NEW |