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 "base/gfx/point.h" | 20 #include "base/gfx/point.h" |
20 #include "webkit/glue/cpp_bound_class.h" | 21 #include "webkit/glue/cpp_bound_class.h" |
21 #include "webkit/glue/webinputevent.h" | 22 #include "webkit/glue/webinputevent.h" |
22 | 23 |
| 24 #if defined(OS_WIN) |
23 struct IDataObject; | 25 struct IDataObject; |
24 struct IDropSource; | 26 struct IDropSource; |
| 27 #endif |
25 class TestShell; | 28 class TestShell; |
26 class WebView; | 29 class WebView; |
27 | 30 |
28 class EventSendingController : public CppBoundClass { | 31 class EventSendingController : public CppBoundClass { |
29 public: | 32 public: |
30 // Builds the property and method lists needed to bind this class to a JS | 33 // Builds the property and method lists needed to bind this class to a JS |
31 // object. | 34 // object. |
32 EventSendingController(TestShell* shell); | 35 EventSendingController(TestShell* shell); |
33 | 36 |
34 // Resets some static variable state. | 37 // Resets some static variable state. |
35 void Reset(); | 38 void Reset(); |
36 | 39 |
| 40 #if defined(OS_WIN) |
37 // Simulate Windows' drag&drop system call. | 41 // Simulate Windows' drag&drop system call. |
38 static void DoDragDrop(IDataObject* drag_data); | 42 static void DoDragDrop(IDataObject* drag_data); |
| 43 #endif |
39 | 44 |
40 // JS callback methods. | 45 // JS callback methods. |
41 void mouseDown(const CppArgumentList& args, CppVariant* result); | 46 void mouseDown(const CppArgumentList& args, CppVariant* result); |
42 void mouseUp(const CppArgumentList& args, CppVariant* result); | 47 void mouseUp(const CppArgumentList& args, CppVariant* result); |
43 void mouseMoveTo(const CppArgumentList& args, CppVariant* result); | 48 void mouseMoveTo(const CppArgumentList& args, CppVariant* result); |
44 void leapForward(const CppArgumentList& args, CppVariant* result); | 49 void leapForward(const CppArgumentList& args, CppVariant* result); |
45 void keyDown(const CppArgumentList& args, CppVariant* result); | 50 void keyDown(const CppArgumentList& args, CppVariant* result); |
46 void textZoomIn(const CppArgumentList& args, CppVariant* result); | 51 void textZoomIn(const CppArgumentList& args, CppVariant* result); |
47 void textZoomOut(const CppArgumentList& args, CppVariant* result); | 52 void textZoomOut(const CppArgumentList& args, CppVariant* result); |
48 | 53 |
(...skipping 28 matching lines...) Expand all Loading... |
77 // Non-owning pointer. The LayoutTestController is owned by the host. | 82 // Non-owning pointer. The LayoutTestController is owned by the host. |
78 static TestShell* shell_; | 83 static TestShell* shell_; |
79 | 84 |
80 // Location of last mouseMoveTo event. | 85 // Location of last mouseMoveTo event. |
81 static gfx::Point last_mouse_pos_; | 86 static gfx::Point last_mouse_pos_; |
82 | 87 |
83 // Currently pressed mouse button (Left/Right/Middle or None) | 88 // Currently pressed mouse button (Left/Right/Middle or None) |
84 static WebMouseEvent::Button pressed_button_; | 89 static WebMouseEvent::Button pressed_button_; |
85 }; | 90 }; |
86 | 91 |
87 #endif // WEBKIT_TOOLS_TEST_SHELL_EVENT_SENDING_CONTROLLER_H__ | 92 #endif // WEBKIT_TOOLS_TEST_SHELL_EVENT_SENDING_CONTROLLER_H_ |
88 | 93 |
OLD | NEW |