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

Unified Diff: chrome/service/cloud_print/cloud_print_url_fetcher.cc

Issue 6523040: Added support to the Windows cloud print proxy to print XPS documents directl... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Code review changes 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/service/cloud_print/cloud_print_url_fetcher.cc
===================================================================
--- chrome/service/cloud_print/cloud_print_url_fetcher.cc (revision 74874)
+++ chrome/service/cloud_print/cloud_print_url_fetcher.cc (working copy)
@@ -18,12 +18,14 @@
num_retries_(0) {
}
-void CloudPrintURLFetcher::StartGetRequest(const GURL& url,
- Delegate* delegate,
- const std::string& auth_token,
- int max_retries) {
+void CloudPrintURLFetcher::StartGetRequest(
+ const GURL& url,
+ Delegate* delegate,
+ const std::string& auth_token,
+ int max_retries,
+ const std::string& additional_headers) {
StartRequestHelper(url, URLFetcher::GET, delegate, auth_token, max_retries,
- std::string(), std::string());
+ std::string(), std::string(), additional_headers);
}
void CloudPrintURLFetcher::StartPostRequest(
@@ -32,9 +34,10 @@
const std::string& auth_token,
int max_retries,
const std::string& post_data_mime_type,
- const std::string& post_data) {
+ const std::string& post_data,
+ const std::string& additional_headers) {
StartRequestHelper(url, URLFetcher::POST, delegate, auth_token, max_retries,
- post_data_mime_type, post_data);
+ post_data_mime_type, post_data, additional_headers);
}
// URLFetcher::Delegate implementation.
@@ -113,7 +116,8 @@
const std::string& auth_token,
int max_retries,
const std::string& post_data_mime_type,
- const std::string& post_data) {
+ const std::string& post_data,
+ const std::string& additional_headers) {
DCHECK(delegate);
request_.reset(new URLFetcher(url, request_type, this));
request_->set_request_context(GetRequestContextGetter());
@@ -125,6 +129,10 @@
headers += auth_token;
headers += "\r\n";
headers += kChromeCloudPrintProxyHeader;
+ if (!additional_headers.empty()) {
+ headers += "\r\n";
+ headers += additional_headers;
+ }
request_->set_extra_request_headers(headers);
if (request_type == URLFetcher::POST) {
request_->set_upload_data(post_data_mime_type, post_data);
« no previous file with comments | « chrome/service/cloud_print/cloud_print_url_fetcher.h ('k') | chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698