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

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

Issue 5572001: Send screenshots back to the client for debugging (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: update for ken's comments Created 9 years, 9 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 8f5fc1f0a0faa8dfa104e04eff27a831ca1bd7bd..f164e3d7a198b324fb0567d5b82edd3a3d4a7d0a 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_) {
Paweł Hajdan Jr. 2011/03/18 10:51:34 Is this duplication needed? Can we switch the send
Joe 2011/03/22 20:47:15 I've switched the function to use the JSON message
+ DictionaryValue dict;
+ dict.SetBoolean("success", success);
+ AutomationJSONReply(automation_, reply_message_.release())
+ .SendSuccess(&dict);
+ } else {
+ AutomationMsg_CaptureEntirePageAsPNG::WriteReplyParams(
+ reply_message_.get(), success);
+ automation_->Send(reply_message_.release());
+ }
}
delete this;
}
« no previous file with comments | « chrome/browser/automation/automation_provider_observers.h ('k') | chrome/browser/automation/testing_automation_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698