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