diff options
author | gene@chromium.org <gene@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-28 18:21:51 +0000 |
---|---|---|
committer | gene@chromium.org <gene@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-28 18:21:51 +0000 |
commit | f0cb5b9f307dfaf5e1540fb753e0a41694b97387 (patch) | |
tree | db9185622a9760a80e6f136feb6e1ab282a681b1 /chrome/service/cloud_print/cloud_print_helpers.cc | |
parent | 121352a9a4a7177af585952ff2f3a1e4ec6619f5 (diff) | |
download | chromium_src-f0cb5b9f307dfaf5e1540fb753e0a41694b97387.zip chromium_src-f0cb5b9f307dfaf5e1540fb753e0a41694b97387.tar.gz chromium_src-f0cb5b9f307dfaf5e1540fb753e0a41694b97387.tar.bz2 |
Chrome proxy refactoring.Adding myself to the OWNERS file for handling cloud print proxy issues.Split proxy code from cloud_print_proxy_backend to a separate pieces: - auth code goes to cloud_print_auth.h/cc - connector logic goes to cloud_print_connector.h/cc (printer enumeration, registration and deletion) - wiring backend/frontend threads, notifications with other parts will stay in cloud_print_backend.h/ccMade proxy logic more straightforward.
Review URL: http://codereview.chromium.org/8387011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107758 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/cloud_print/cloud_print_helpers.cc')
-rw-r--r-- | chrome/service/cloud_print/cloud_print_helpers.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/service/cloud_print/cloud_print_helpers.cc b/chrome/service/cloud_print/cloud_print_helpers.cc index 492c46a..1a441d7 100644 --- a/chrome/service/cloud_print/cloud_print_helpers.cc +++ b/chrome/service/cloud_print/cloud_print_helpers.cc @@ -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" std::string StringFromJobStatus(cloud_print::PrintJobStatus status) { @@ -266,3 +267,20 @@ bool CloudPrintHelpers::IsDryRunJob(const std::vector<std::string>& tags) { } 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; +} + |