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

Unified Diff: chrome/browser/automation/automation_tab_helper.cc

Issue 10384023: Determine the element location and click synchronously on the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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
Index: chrome/browser/automation/automation_tab_helper.cc
diff --git a/chrome/browser/automation/automation_tab_helper.cc b/chrome/browser/automation/automation_tab_helper.cc
index 89cc381e1cfb7cc71f8dc023511b3a1d06df1c67..fd16dedaccb49750f2a55fb8664d0f0d5408580c 100644
--- a/chrome/browser/automation/automation_tab_helper.cc
+++ b/chrome/browser/automation/automation_tab_helper.cc
@@ -10,6 +10,7 @@
#include "content/public/browser/web_contents.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_macros.h"
+#include "ui/gfx/point.h"
#include "ui/gfx/size.h"
using content::WebContents;
@@ -61,6 +62,11 @@ void AutomationTabHelper::HeapProfilerDump(const std::string& reason) {
}
#endif // !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS))
+void AutomationTabHelper::ProcessMouseEvent(
+ const AutomationMouseEvent& event) {
+ Send(new AutomationMsg_ProcessMouseEvent(routing_id(), event));
+}
+
bool AutomationTabHelper::has_pending_loads() const {
return is_loading_ || !pending_client_redirects_.empty();
}
@@ -119,12 +125,28 @@ void AutomationTabHelper::OnSnapshotEntirePageACK(
OnSnapshotEntirePageACK(success, png_data, error_msg));
}
+void AutomationTabHelper::OnWillProcessMouseEventAt(const gfx::Point& point) {
+ FOR_EACH_OBSERVER(TabEventObserver, observers_,
+ OnWillProcessMouseEventAt(point));
+}
+
+void AutomationTabHelper::OnProcessMouseEventACK(
+ bool success,
+ const std::string& error_msg) {
+ FOR_EACH_OBSERVER(TabEventObserver, observers_,
+ OnProcessMouseEventACK(success, error_msg));
+}
+
bool AutomationTabHelper::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
bool msg_is_good = true;
IPC_BEGIN_MESSAGE_MAP_EX(AutomationTabHelper, message, msg_is_good)
IPC_MESSAGE_HANDLER(AutomationMsg_SnapshotEntirePageACK,
OnSnapshotEntirePageACK)
+ IPC_MESSAGE_HANDLER(AutomationMsg_WillProcessMouseEventAt,
+ OnWillProcessMouseEventAt)
+ IPC_MESSAGE_HANDLER(AutomationMsg_ProcessMouseEventACK,
+ OnProcessMouseEventACK)
IPC_MESSAGE_HANDLER(AutomationMsg_WillPerformClientRedirect,
OnWillPerformClientRedirect)
IPC_MESSAGE_HANDLER(AutomationMsg_DidCompleteOrCancelClientRedirect,

Powered by Google App Engine
This is Rietveld 408576698