Chromium Code Reviews| 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,18 @@ |
| } |
| return false; |
| } |
| + |
| +std::string CloudPrintHelpers::GetCloudPrintAuthHeader() { |
| + std::string header; |
| + CloudPrintTokenStore* token_store = CloudPrintTokenStore::current(); |
| + if (!token_store || token_store->token().empty()) { |
| + LOG(ERROR) << "CP_PROXY: Missing OAuth token for request"; |
|
Albert Bodenhamer
2011/10/26 23:58:09
VLOG? DLOG?
|
| + } |
| + |
| + if (token_store) { |
| + header = "Authorization: OAuth "; |
| + header += token_store->token(); |
| + } |
| + return header; |
| +} |
| + |