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

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

Issue 8387011: Chrome proxy refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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
« no previous file with comments | « chrome/service/cloud_print/cloud_print_helpers.h ('k') | chrome/service/cloud_print/cloud_print_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/cloud_print/cloud_print_helpers.cc
===================================================================
--- chrome/service/cloud_print/cloud_print_helpers.cc (revision 107156)
+++ chrome/service/cloud_print/cloud_print_helpers.cc (working copy)
@@ -14,6 +14,7 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/service/cloud_print/cloud_print_consts.h"
+#include "chrome/service/cloud_print/cloud_print_token_store.h"
#include "chrome/service/service_process.h"
#include "content/common/net/url_fetcher.h"
@@ -267,3 +268,20 @@
}
return false;
}
+
+std::string CloudPrintHelpers::GetCloudPrintAuthHeader() {
+ std::string header;
+ CloudPrintTokenStore* token_store = CloudPrintTokenStore::current();
+ if (!token_store || token_store->token().empty()) {
+ // Using LOG here for critical errors. GCP connector may run in the headless
+ // mode and error indication might be useful for user in that case.
+ LOG(ERROR) << "CP_PROXY: Missing OAuth token for request";
+ }
+
+ if (token_store) {
+ header = "Authorization: OAuth ";
+ header += token_store->token();
+ }
+ return header;
+}
+
« no previous file with comments | « chrome/service/cloud_print/cloud_print_helpers.h ('k') | chrome/service/cloud_print/cloud_print_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698