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 8f5fc1f0a0faa8dfa104e04eff27a831ca1bd7bd..cf97ffc2c0f5720dd8659f9adc313d160e0757ad 100644 |
| --- a/chrome/browser/automation/automation_provider_observers.cc |
| +++ b/chrome/browser/automation/automation_provider_observers.cc |
| @@ -1668,12 +1668,14 @@ void SavePackageNotificationObserver::Observe( |
| PageSnapshotTaker::PageSnapshotTaker(AutomationProvider* automation, |
| IPC::Message* reply_message, |
| RenderViewHost* render_view, |
| - const FilePath& path) |
| + const FilePath& path, |
| + bool use_json_interface) |
| : automation_(automation->AsWeakPtr()), |
| reply_message_(reply_message), |
| render_view_(render_view), |
| image_path_(path), |
| - received_width_(false) {} |
| + received_width_(false), |
| + use_json_interface_(use_json_interface) {} |
| PageSnapshotTaker::~PageSnapshotTaker() {} |
| @@ -1732,9 +1734,16 @@ void PageSnapshotTaker::ExecuteScript(const std::wstring& javascript) { |
| void PageSnapshotTaker::SendMessage(bool success) { |
| if (automation_) { |
| - AutomationMsg_CaptureEntirePageAsPNG::WriteReplyParams(reply_message_.get(), |
| - success); |
| - automation_->Send(reply_message_.release()); |
| + if (use_json_interface_) { |
| + DictionaryValue dict; |
| + dict.SetBoolean("result", success); |
|
kkania
2011/03/17 18:35:11
change this to "success" to match what you have in
Joe
2011/03/18 00:33:32
Done.
|
| + AutomationJSONReply(automation_, reply_message_.release()) |
| + .SendSuccess(&dict); |
| + } else { |
| + AutomationMsg_CaptureEntirePageAsPNG::WriteReplyParams( |
| + reply_message_.get(), success); |
| + automation_->Send(reply_message_.release()); |
| + } |
| } |
| delete this; |
| } |