Chromium Code Reviews| 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; |
| +} |