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 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_HTTP_H_ |
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ | 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_HTTP_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "chrome/browser/local_discovery/privet_url_fetcher.h" | 11 #include "chrome/browser/printing/cloud_print/privet_url_fetcher.h" |
12 #include "net/base/host_port_pair.h" | 12 #include "net/base/host_port_pair.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class RefCountedBytes; | 15 class RefCountedBytes; |
16 } | 16 } |
17 | 17 |
18 namespace gfx { | 18 namespace gfx { |
19 class Size; | 19 class Size; |
20 } | 20 } |
21 | 21 |
22 namespace printing { | 22 namespace printing { |
23 class PdfRenderSettings; | 23 class PdfRenderSettings; |
| 24 class PWGRasterConverter; |
24 } | 25 } |
25 | 26 |
26 namespace local_discovery { | 27 namespace cloud_print { |
27 | 28 |
28 class PWGRasterConverter; | |
29 class PrivetHTTPClient; | 29 class PrivetHTTPClient; |
30 | 30 |
31 // Represents a simple request that returns pure JSON. | 31 // Represents a simple request that returns pure JSON. |
32 class PrivetJSONOperation { | 32 class PrivetJSONOperation { |
33 public: | 33 public: |
34 // If value is null, the operation failed. | 34 // If value is null, the operation failed. |
35 typedef base::Callback<void( | 35 typedef base::Callback<void( |
36 const base::DictionaryValue* /*value*/)> ResultCallback; | 36 const base::DictionaryValue* /*value*/)> ResultCallback; |
37 | 37 |
38 virtual ~PrivetJSONOperation() {} | 38 virtual ~PrivetJSONOperation() {} |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 virtual void SetUsername(const std::string& username) = 0; | 169 virtual void SetUsername(const std::string& username) = 0; |
170 virtual void SetJobname(const std::string& jobname) = 0; | 170 virtual void SetJobname(const std::string& jobname) = 0; |
171 // If |offline| is true, we will indicate to the printer not to post the job | 171 // If |offline| is true, we will indicate to the printer not to post the job |
172 // to Google Cloud Print. | 172 // to Google Cloud Print. |
173 virtual void SetOffline(bool offline) = 0; | 173 virtual void SetOffline(bool offline) = 0; |
174 // Document page size. | 174 // Document page size. |
175 virtual void SetPageSize(const gfx::Size& page_size) = 0; | 175 virtual void SetPageSize(const gfx::Size& page_size) = 0; |
176 | 176 |
177 // For testing, inject an alternative PWG raster converter. | 177 // For testing, inject an alternative PWG raster converter. |
178 virtual void SetPWGRasterConverterForTesting( | 178 virtual void SetPWGRasterConverterForTesting( |
179 scoped_ptr<PWGRasterConverter> pwg_raster_converter) = 0; | 179 scoped_ptr<printing::PWGRasterConverter> pwg_raster_converter) = 0; |
180 | 180 |
181 virtual PrivetHTTPClient* GetHTTPClient() = 0; | 181 virtual PrivetHTTPClient* GetHTTPClient() = 0; |
182 }; | 182 }; |
183 | 183 |
184 // Privet HTTP client. Must outlive the operations it creates. | 184 // Privet HTTP client. Must outlive the operations it creates. |
185 class PrivetV1HTTPClient { | 185 class PrivetV1HTTPClient { |
186 public: | 186 public: |
187 virtual ~PrivetV1HTTPClient() {} | 187 virtual ~PrivetV1HTTPClient() {} |
188 | 188 |
189 static scoped_ptr<PrivetV1HTTPClient> CreateDefault( | 189 static scoped_ptr<PrivetV1HTTPClient> CreateDefault( |
(...skipping 13 matching lines...) Expand all Loading... |
203 | 203 |
204 // Creates operation to query capabilities of local printer. | 204 // Creates operation to query capabilities of local printer. |
205 virtual scoped_ptr<PrivetJSONOperation> CreateCapabilitiesOperation( | 205 virtual scoped_ptr<PrivetJSONOperation> CreateCapabilitiesOperation( |
206 const PrivetJSONOperation::ResultCallback& callback) = 0; | 206 const PrivetJSONOperation::ResultCallback& callback) = 0; |
207 | 207 |
208 // Creates operation to submit print job to local printer. | 208 // Creates operation to submit print job to local printer. |
209 virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation( | 209 virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation( |
210 PrivetLocalPrintOperation::Delegate* delegate) = 0; | 210 PrivetLocalPrintOperation::Delegate* delegate) = 0; |
211 }; | 211 }; |
212 | 212 |
213 } // namespace local_discovery | 213 } // namespace cloud_print |
214 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ | 214 |
| 215 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_HTTP_H_ |
OLD | NEW |