| 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/WebDragOperation.h" |
| 23 #include "webkit/api/public/WebInputEvent.h" | 23 #include "webkit/api/public/WebInputEvent.h" |
| 24 #include "webkit/glue/cpp_bound_class.h" | 24 #include "webkit/glue/cpp_bound_class.h" |
| 25 | 25 |
| 26 class TestShell; | 26 class TestShell; |
| 27 class WebView; | |
| 28 | 27 |
| 29 namespace WebKit { | 28 namespace WebKit { |
| 30 class WebDragData; | 29 class WebDragData; |
| 30 class WebView; |
| 31 struct WebPoint; | 31 struct WebPoint; |
| 32 } | 32 } |
| 33 | 33 |
| 34 class EventSendingController : public CppBoundClass { | 34 class EventSendingController : public CppBoundClass { |
| 35 public: | 35 public: |
| 36 // Builds the property and method lists needed to bind this class to a JS | 36 // Builds the property and method lists needed to bind this class to a JS |
| 37 // object. | 37 // object. |
| 38 EventSendingController(TestShell* shell); | 38 EventSendingController(TestShell* shell); |
| 39 | 39 |
| 40 // Resets some static variable state. | 40 // Resets some static variable state. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 CppVariant wmChar; | 74 CppVariant wmChar; |
| 75 CppVariant wmDeadChar; | 75 CppVariant wmDeadChar; |
| 76 CppVariant wmSysKeyDown; | 76 CppVariant wmSysKeyDown; |
| 77 CppVariant wmSysKeyUp; | 77 CppVariant wmSysKeyUp; |
| 78 CppVariant wmSysChar; | 78 CppVariant wmSysChar; |
| 79 CppVariant wmSysDeadChar; | 79 CppVariant wmSysDeadChar; |
| 80 #endif | 80 #endif |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 // Returns the test shell's webview. | 83 // Returns the test shell's webview. |
| 84 static WebView* webview(); | 84 static WebKit::WebView* webview(); |
| 85 | 85 |
| 86 // Returns true if dragMode is true. | 86 // Returns true if dragMode is true. |
| 87 bool drag_mode() { return dragMode.isBool() && dragMode.ToBoolean(); } | 87 bool drag_mode() { return dragMode.isBool() && dragMode.ToBoolean(); } |
| 88 | 88 |
| 89 // Sometimes we queue up mouse move and mouse up events for drag drop | 89 // Sometimes we queue up mouse move and mouse up events for drag drop |
| 90 // handling purposes. These methods dispatch the event. | 90 // handling purposes. These methods dispatch the event. |
| 91 static void DoMouseMove(const WebKit::WebMouseEvent& e); | 91 static void DoMouseMove(const WebKit::WebMouseEvent& e); |
| 92 static void DoMouseUp(const WebKit::WebMouseEvent& e); | 92 static void DoMouseUp(const WebKit::WebMouseEvent& e); |
| 93 static void DoLeapForward(int milliseconds); | 93 static void DoLeapForward(int milliseconds); |
| 94 static void ReplaySavedEvents(); | 94 static void ReplaySavedEvents(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 118 // Currently pressed mouse button (Left/Right/Middle or None) | 118 // Currently pressed mouse button (Left/Right/Middle or None) |
| 119 static WebKit::WebMouseEvent::Button pressed_button_; | 119 static WebKit::WebMouseEvent::Button pressed_button_; |
| 120 | 120 |
| 121 // The last button number passed to mouseDown and mouseUp. | 121 // The last button number passed to mouseDown and mouseUp. |
| 122 // Used to determine whether the click count continues to | 122 // Used to determine whether the click count continues to |
| 123 // increment or not. | 123 // increment or not. |
| 124 static WebKit::WebMouseEvent::Button last_button_type_; | 124 static WebKit::WebMouseEvent::Button last_button_type_; |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 #endif // WEBKIT_TOOLS_TEST_SHELL_EVENT_SENDING_CONTROLLER_H_ | 127 #endif // WEBKIT_TOOLS_TEST_SHELL_EVENT_SENDING_CONTROLLER_H_ |
| OLD | NEW |