OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/cloud_print/cloud_print_helpers.h" | 5 #include "chrome/common/cloud_print/cloud_print_helpers.h" |
6 | 6 |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/common/guid.h" | |
14 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
15 | 14 |
16 namespace cloud_print { | 15 namespace cloud_print { |
17 | 16 |
18 const char kPrinterListValue[] = "printers"; | 17 const char kPrinterListValue[] = "printers"; |
19 const char kSuccessValue[] = "success"; | 18 const char kSuccessValue[] = "success"; |
20 | 19 |
21 // Certain cloud print requests require Chrome's X-CloudPrint-Proxy header. | 20 // Certain cloud print requests require Chrome's X-CloudPrint-Proxy header. |
22 const char kChromeCloudPrintProxyHeader[] = "X-CloudPrint-Proxy: Chrome"; | 21 const char kChromeCloudPrintProxyHeader[] = "X-CloudPrint-Proxy: Chrome"; |
23 | 22 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 84 } |
86 | 85 |
87 // Create a MIME boundary marker (27 '-' characters followed by 16 hex digits). | 86 // Create a MIME boundary marker (27 '-' characters followed by 16 hex digits). |
88 void CreateMimeBoundaryForUpload(std::string* out) { | 87 void CreateMimeBoundaryForUpload(std::string* out) { |
89 int r1 = base::RandInt(0, kint32max); | 88 int r1 = base::RandInt(0, kint32max); |
90 int r2 = base::RandInt(0, kint32max); | 89 int r2 = base::RandInt(0, kint32max); |
91 base::SStringPrintf(out, "---------------------------%08X%08X", r1, r2); | 90 base::SStringPrintf(out, "---------------------------%08X%08X", r1, r2); |
92 } | 91 } |
93 | 92 |
94 } // namespace cloud_print | 93 } // namespace cloud_print |
OLD | NEW |