Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: chrome/browser/local_discovery/privet_http.h

Issue 318283002: Added new GCD/Privet interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_LOCAL_DISCOVERY_PRIVET_HTTP_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 scoped_ptr<PWGRasterConverter> pwg_raster_converter) = 0; 178 scoped_ptr<PWGRasterConverter> pwg_raster_converter) = 0;
179 179
180 virtual PrivetHTTPClient* GetHTTPClient() = 0; 180 virtual PrivetHTTPClient* GetHTTPClient() = 0;
181 }; 181 };
182 182
183 // Privet HTTP client. Must outlive the operations it creates. 183 // Privet HTTP client. Must outlive the operations it creates.
184 class PrivetV1HTTPClient { 184 class PrivetV1HTTPClient {
185 public: 185 public:
186 virtual ~PrivetV1HTTPClient() {} 186 virtual ~PrivetV1HTTPClient() {}
187 187
188 static scoped_ptr<PrivetV1HTTPClient> CreateDefault(
189 scoped_ptr<PrivetHTTPClient> info_client);
190
188 // A name for the HTTP client, e.g. the device name for the privet device. 191 // A name for the HTTP client, e.g. the device name for the privet device.
189 virtual const std::string& GetName() = 0; 192 virtual const std::string& GetName() = 0;
190 193
191 static scoped_ptr<PrivetV1HTTPClient> CreateDefault(
192 scoped_ptr<PrivetHTTPClient> info_client);
193
194 // Creates operation to query basic information about local device. 194 // Creates operation to query basic information about local device.
195 virtual scoped_ptr<PrivetJSONOperation> CreateInfoOperation( 195 virtual scoped_ptr<PrivetJSONOperation> CreateInfoOperation(
196 const PrivetJSONOperation::ResultCallback& callback) = 0; 196 const PrivetJSONOperation::ResultCallback& callback) = 0;
197 197
198 // Creates operation to register local device using Privet v1 protocol. 198 // Creates operation to register local device using Privet v1 protocol.
199 virtual scoped_ptr<PrivetRegisterOperation> CreateRegisterOperation( 199 virtual scoped_ptr<PrivetRegisterOperation> CreateRegisterOperation(
200 const std::string& user, 200 const std::string& user,
201 PrivetRegisterOperation::Delegate* delegate) = 0; 201 PrivetRegisterOperation::Delegate* delegate) = 0;
202 202
203 // Creates operation to query capabilities of local printer. 203 // Creates operation to query capabilities of local printer.
204 virtual scoped_ptr<PrivetJSONOperation> CreateCapabilitiesOperation( 204 virtual scoped_ptr<PrivetJSONOperation> CreateCapabilitiesOperation(
205 const PrivetJSONOperation::ResultCallback& callback) = 0; 205 const PrivetJSONOperation::ResultCallback& callback) = 0;
206 206
207 // Creates operation to submit print job to local printer. 207 // Creates operation to submit print job to local printer.
208 virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation( 208 virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation(
209 PrivetLocalPrintOperation::Delegate* delegate) = 0; 209 PrivetLocalPrintOperation::Delegate* delegate) = 0;
210 210
211 // Creates operation to list files on local Privet storage. 211 // Creates operation to list files on local Privet storage.
212 virtual scoped_ptr<PrivetJSONOperation> CreateStorageListOperation( 212 virtual scoped_ptr<PrivetJSONOperation> CreateStorageListOperation(
213 const std::string& path, 213 const std::string& path,
214 const PrivetJSONOperation::ResultCallback& callback) = 0; 214 const PrivetJSONOperation::ResultCallback& callback) = 0;
215 215
216 // Creates operation to read data from local Privet storage. 216 // Creates operation to read data from local Privet storage.
217 virtual scoped_ptr<PrivetDataReadOperation> CreateStorageReadOperation( 217 virtual scoped_ptr<PrivetDataReadOperation> CreateStorageReadOperation(
218 const std::string& path, 218 const std::string& path,
219 const PrivetDataReadOperation::ResultCallback& callback) = 0; 219 const PrivetDataReadOperation::ResultCallback& callback) = 0;
220 }; 220 };
221 221
222 // Privet HTTP client. Must outlive the operations it creates.
223 class PrivetV3HTTPClient {
224 public:
225 virtual ~PrivetV3HTTPClient() {}
226
227 static scoped_ptr<PrivetV3HTTPClient> CreateDefault(
228 scoped_ptr<PrivetHTTPClient> info_client);
229
230 // A name for the HTTP client, e.g. the device name for the privet device.
231 virtual const std::string& GetName() = 0;
232
233 // Creates operation to query basic information about local device.
234 virtual scoped_ptr<PrivetJSONOperation> CreateInfoOperation(
235 const PrivetJSONOperation::ResultCallback& callback) = 0;
236 };
237
222 } // namespace local_discovery 238 } // namespace local_discovery
223 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ 239 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698