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

Unified Diff: chrome/browser/printing/cloud_print/gcd_api_flow_impl.cc

Issue 2742763002: Clean up Cloud Print API flow code. (Closed)
Patch Set: Created 3 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/printing/cloud_print/gcd_api_flow_impl.cc
diff --git a/chrome/browser/printing/cloud_print/gcd_api_flow_impl.cc b/chrome/browser/printing/cloud_print/gcd_api_flow_impl.cc
index 039a0edccfc0988149c53d07e548d41bf3966068..58be104cd9fad90aaba46fa9e2271bef129cebf7 100644
--- a/chrome/browser/printing/cloud_print/gcd_api_flow_impl.cc
+++ b/chrome/browser/printing/cloud_print/gcd_api_flow_impl.cc
@@ -25,6 +25,10 @@
namespace cloud_print {
+namespace {
+const char kCloudPrintOAuthHeaderFormat[] = "Authorization: Bearer %s";
+} // namespace
+
GCDApiFlowImpl::GCDApiFlowImpl(net::URLRequestContextGetter* request_context,
OAuth2TokenService* token_service,
const std::string& account_id)
@@ -68,16 +72,10 @@ void GCDApiFlowImpl::OnGetTokenFailure(
void GCDApiFlowImpl::CreateRequest(const GURL& url) {
net::URLFetcher::RequestType request_type = request_->GetRequestType();
+ DCHECK_EQ(net::URLFetcher::GET, request_type);
url_fetcher_ = net::URLFetcher::Create(url, request_type, this);
- if (request_type != net::URLFetcher::GET) {
- std::string upload_type;
- std::string upload_data;
- request_->GetUploadData(&upload_type, &upload_data);
- url_fetcher_->SetUploadData(upload_type, upload_data);
- }
-
data_use_measurement::DataUseUserData::AttachToFetcher(
url_fetcher_.get(), data_use_measurement::DataUseUserData::CLOUD_PRINT);
url_fetcher_->SetRequestContext(request_context_.get());
« no previous file with comments | « chrome/browser/printing/cloud_print/gcd_api_flow_impl.h ('k') | chrome/browser/printing/cloud_print/privet_confirm_api_flow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698