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

Side by Side Diff: chrome/browser/chrome_to_mobile_service.cc

Issue 9590002: JSONWriter cleanup: integrate pretty print into write options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict 7. Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_to_mobile_service.h" 5 #include "chrome/browser/chrome_to_mobile_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 scoped_ptr<DictionaryValue> job(new DictionaryValue()); 56 scoped_ptr<DictionaryValue> job(new DictionaryValue());
57 job->SetString("url", data.url.spec()); 57 job->SetString("url", data.url.spec());
58 if (data.type == ChromeToMobileService::URL) { 58 if (data.type == ChromeToMobileService::URL) {
59 job->SetString("type", kRequestTypeURL); 59 job->SetString("type", kRequestTypeURL);
60 } else { 60 } else {
61 job->SetString("snapID", data.snapshot_id); 61 job->SetString("snapID", data.snapshot_id);
62 job->SetString("type", (data.type == ChromeToMobileService::SNAPSHOT) ? 62 job->SetString("type", (data.type == ChromeToMobileService::SNAPSHOT) ?
63 kRequestTypeSnapshot : kRequestTypeDelayedSnapshot); 63 kRequestTypeSnapshot : kRequestTypeDelayedSnapshot);
64 } 64 }
65 std::string job_string; 65 std::string job_string;
66 base::JSONWriter::Write(job.get(), false, &job_string); 66 base::JSONWriter::Write(job.get(), &job_string);
67 return job_string; 67 return job_string;
68 } 68 }
69 69
70 // Get the URL for cloud print job submission; appends query params if needed. 70 // Get the URL for cloud print job submission; appends query params if needed.
71 GURL GetSubmitURL(GURL service_url, 71 GURL GetSubmitURL(GURL service_url,
72 const ChromeToMobileService::RequestData& data) { 72 const ChromeToMobileService::RequestData& data) {
73 GURL submit_url = cloud_print::GetUrlForSubmit(service_url); 73 GURL submit_url = cloud_print::GetUrlForSubmit(service_url);
74 if (data.type == ChromeToMobileService::SNAPSHOT) 74 if (data.type == ChromeToMobileService::SNAPSHOT)
75 return submit_url; 75 return submit_url;
76 76
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 return; 327 return;
328 328
329 // Ensure a second response is not sent after reporting failure below. 329 // Ensure a second response is not sent after reporting failure below.
330 request_observer_map_.erase(other); 330 request_observer_map_.erase(other);
331 break; 331 break;
332 } 332 }
333 } 333 }
334 334
335 observer->OnSendComplete(success); 335 observer->OnSendComplete(success);
336 } 336 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_manager_extension_api.cc ('k') | chrome/browser/chromeos/cros/network_library.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698