OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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_COMMON_AUTOMATION_EVENTS_H_ | |
6 #define CHROME_COMMON_AUTOMATION_EVENTS_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | |
12 | |
13 // A request to evaluate a script in a given frame. | |
14 struct ScriptEvaluationRequest { | |
15 ScriptEvaluationRequest(); | |
16 ScriptEvaluationRequest(const std::string& script, | |
17 const std::string& frame_xpath); | |
18 ~ScriptEvaluationRequest(); | |
19 | |
20 std::string script; | |
21 std::string frame_xpath; | |
22 }; | |
23 | |
24 // An extension to a normal mouse event that includes data for determining the | |
25 // location of the mouse event. | |
26 struct AutomationMouseEvent { | |
27 AutomationMouseEvent(); | |
28 ~AutomationMouseEvent(); | |
29 | |
30 WebKit::WebMouseEvent mouse_event; | |
31 | |
32 // A list of scripts that when evaluated returns a coordinate for the event. | |
33 // The scripts are chained together in that the output for one script | |
34 // provides the input for the next. Each script must result in exactly one | |
35 // JavaScript object. This object will be passed to the next script | |
36 // as arguments[0]. The only exceptions to this are the first script, which | |
37 // is passed null. The last script should result in a single JavaScript | |
38 // object with integer 'x' and 'y' properties. | |
39 // If empty, the coordinates in the normal mouse event are used. | |
40 std::vector<ScriptEvaluationRequest> location_script_chain; | |
41 }; | |
42 | |
43 #endif // CHROME_COMMON_AUTOMATION_EVENTS_H_ | |
OLD | NEW |