OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/service/cloud_print/cloud_print_service_helpers.h" | 5 #include "chrome/service/cloud_print/cloud_print_service_helpers.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "chrome/common/cloud_print/cloud_print_constants.h" | 8 #include "chrome/common/cloud_print/cloud_print_constants.h" |
9 #include "chrome/common/cloud_print/cloud_print_helpers.h" | 9 #include "chrome/common/cloud_print/cloud_print_helpers.h" |
10 #include "chrome/service/cloud_print/cloud_print_token_store.h" | 10 #include "chrome/service/cloud_print/cloud_print_token_store.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 const printing::PrinterBasicInfo& printer_info, | 75 const printing::PrinterBasicInfo& printer_info, |
76 const std::string& mime_boundary) { | 76 const std::string& mime_boundary) { |
77 return GetPostDataForPrinterTags( | 77 return GetPostDataForPrinterTags( |
78 printer_info.options, | 78 printer_info.options, |
79 mime_boundary, | 79 mime_boundary, |
80 kCloudPrintServiceProxyTagPrefix, | 80 kCloudPrintServiceProxyTagPrefix, |
81 kCloudPrintServiceTagsHashTagName); | 81 kCloudPrintServiceTagsHashTagName); |
82 } | 82 } |
83 | 83 |
84 bool IsDryRunJob(const std::vector<std::string>& tags) { | 84 bool IsDryRunJob(const std::vector<std::string>& tags) { |
85 return ContainsValue(tags, kCloudPrintServiceTagDryRunFlag); | 85 return base::ContainsValue(tags, kCloudPrintServiceTagDryRunFlag); |
86 } | 86 } |
87 | 87 |
88 std::string GetCloudPrintAuthHeaderFromStore() { | 88 std::string GetCloudPrintAuthHeaderFromStore() { |
89 CloudPrintTokenStore* token_store = CloudPrintTokenStore::current(); | 89 CloudPrintTokenStore* token_store = CloudPrintTokenStore::current(); |
90 if (!token_store || token_store->token().empty()) { | 90 if (!token_store || token_store->token().empty()) { |
91 // Using LOG here for critical errors. GCP connector may run in the headless | 91 // Using LOG here for critical errors. GCP connector may run in the headless |
92 // mode and error indication might be useful for user in that case. | 92 // mode and error indication might be useful for user in that case. |
93 LOG(ERROR) << "CP_PROXY: Missing OAuth token for request"; | 93 LOG(ERROR) << "CP_PROXY: Missing OAuth token for request"; |
94 return std::string(); | 94 return std::string(); |
95 } | 95 } |
96 return GetCloudPrintAuthHeader(token_store->token()); | 96 return GetCloudPrintAuthHeader(token_store->token()); |
97 } | 97 } |
98 | 98 |
99 } // namespace cloud_print | 99 } // namespace cloud_print |
OLD | NEW |