Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9731)

Unified Diff: chrome/common/automation_events.h

Issue 10384023: Determine the element location and click synchronously on the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/automation_events.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/automation_events.h
diff --git a/chrome/common/automation_events.h b/chrome/common/automation_events.h
new file mode 100644
index 0000000000000000000000000000000000000000..f9862dcd945016131d2c10c25238abd4b65e4214
--- /dev/null
+++ b/chrome/common/automation_events.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_COMMON_AUTOMATION_EVENTS_H_
+#define CHROME_COMMON_AUTOMATION_EVENTS_H_
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
+
+// A request to evaluate a script in a given frame.
+struct ScriptEvaluationRequest {
+ ScriptEvaluationRequest();
+ ScriptEvaluationRequest(const std::string& script,
+ const std::string& frame_xpath);
+ ~ScriptEvaluationRequest();
+
+ std::string script;
+ std::string frame_xpath;
+};
+
+// An extension to a normal mouse event that includes data for determining the
+// location of the mouse event.
+struct AutomationMouseEvent {
+ AutomationMouseEvent();
+ ~AutomationMouseEvent();
+
+ WebKit::WebMouseEvent mouse_event;
+
+ // A list of scripts that when evaluated returns a coordinate for the event.
+ // The scripts are chained together in that the output for one script
+ // provides the input for the next. Each script must result in exactly one
+ // JavaScript object. This object will be passed to the next script
+ // as arguments[0]. The only exceptions to this are the first script, which
+ // is passed null. The last script should result in a single JavaScript
+ // object with integer 'x' and 'y' properties.
+ // If empty, the coordinates in the normal mouse event are used.
+ std::vector<ScriptEvaluationRequest> location_script_chain;
+};
+
+#endif // CHROME_COMMON_AUTOMATION_EVENTS_H_
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/automation_events.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698