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

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

Issue 6614023: Convert ChromeDriver to use only the JSON automation interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 10 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_provider_observers.cc
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 7afc0d0c5a9159b6d46229df7b99f28195d8b204..ede73e06cca6bd4581815a1409371812d9a2c347 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -2009,6 +2009,10 @@ void AllTabsStoppedLoadingObserver::Observe(
}
void AllTabsStoppedLoadingObserver::CheckIfStopped() {
+ if (!automation_) {
+ delete this;
+ return;
+ }
bool done_loading = true;
BrowserList::const_iterator iter = BrowserList::begin();
for (; iter != BrowserList::end(); ++iter) {
@@ -2095,3 +2099,23 @@ void WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread() {
automation_->Send(reply_message_.release());
Release();
}
+
+ExecuteJavascriptObserver::ExecuteJavascriptObserver(
+ AutomationProvider* automation,
+ IPC::Message* reply_message)
+ : automation_(automation->AsWeakPtr()),
+ reply_message_(reply_message) {
+}
+
+ExecuteJavascriptObserver::~ExecuteJavascriptObserver() {
+}
+
+void ExecuteJavascriptObserver::OnDomOperationCompleted(const std::string& json) {
Paweł Hajdan Jr. 2011/03/05 11:44:56 nit: 80 cols.
kkania 2011/03/07 04:31:51 Done.
+ if (automation_) {
+ DictionaryValue dict;
+ dict.SetString("result", json);
+ AutomationJSONReply(automation_, reply_message_.release())
+ .SendSuccess(&dict);
+ }
+ delete this;
+}

Powered by Google App Engine
This is Rietveld 408576698