OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_USB_USB_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_USB_USB_API_H_ |
6 #define EXTENSIONS_BROWSER_API_USB_USB_API_H_ | 6 #define EXTENSIONS_BROWSER_API_USB_USB_API_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 238 |
239 DISALLOW_COPY_AND_ASSIGN(UsbCloseDeviceFunction); | 239 DISALLOW_COPY_AND_ASSIGN(UsbCloseDeviceFunction); |
240 }; | 240 }; |
241 | 241 |
242 class UsbClaimInterfaceFunction : public UsbConnectionFunction { | 242 class UsbClaimInterfaceFunction : public UsbConnectionFunction { |
243 public: | 243 public: |
244 DECLARE_EXTENSION_FUNCTION("usb.claimInterface", USB_CLAIMINTERFACE) | 244 DECLARE_EXTENSION_FUNCTION("usb.claimInterface", USB_CLAIMINTERFACE) |
245 | 245 |
246 UsbClaimInterfaceFunction(); | 246 UsbClaimInterfaceFunction(); |
247 | 247 |
248 private: | 248 protected: |
249 ~UsbClaimInterfaceFunction() override; | 249 ~UsbClaimInterfaceFunction() override; |
250 | 250 |
251 // ExtensionFunction: | 251 // ExtensionFunction: |
252 ResponseAction Run() override; | 252 ResponseAction Run() override; |
253 | 253 |
254 void OnComplete(bool success); | 254 void OnComplete(bool success); |
255 | 255 |
256 DISALLOW_COPY_AND_ASSIGN(UsbClaimInterfaceFunction); | 256 DISALLOW_COPY_AND_ASSIGN(UsbClaimInterfaceFunction); |
257 }; | 257 }; |
258 | 258 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 327 |
328 private: | 328 private: |
329 ~UsbInterruptTransferFunction() override; | 329 ~UsbInterruptTransferFunction() override; |
330 | 330 |
331 // ExtensionFunction: | 331 // ExtensionFunction: |
332 ResponseAction Run() override; | 332 ResponseAction Run() override; |
333 | 333 |
334 DISALLOW_COPY_AND_ASSIGN(UsbInterruptTransferFunction); | 334 DISALLOW_COPY_AND_ASSIGN(UsbInterruptTransferFunction); |
335 }; | 335 }; |
336 | 336 |
337 class UsbIsochronousTransferFunction : public UsbConnectionFunction { | 337 class UsbIsochronousTransferFunction : public UsbTransferFunction { |
338 public: | 338 public: |
339 DECLARE_EXTENSION_FUNCTION("usb.isochronousTransfer", USB_ISOCHRONOUSTRANSFER) | 339 DECLARE_EXTENSION_FUNCTION("usb.isochronousTransfer", USB_ISOCHRONOUSTRANSFER) |
340 | 340 |
341 UsbIsochronousTransferFunction(); | 341 UsbIsochronousTransferFunction(); |
342 | 342 |
343 private: | 343 private: |
344 ~UsbIsochronousTransferFunction() override; | 344 ~UsbIsochronousTransferFunction() override; |
345 | 345 |
346 // ExtensionFunction: | 346 // ExtensionFunction: |
347 ResponseAction Run() override; | 347 ResponseAction Run() override; |
348 | 348 |
349 void OnCompleted( | |
350 scoped_refptr<net::IOBuffer> data, | |
351 const std::vector<device::UsbDeviceHandle::IsochronousPacket>& packets); | |
352 | |
353 DISALLOW_COPY_AND_ASSIGN(UsbIsochronousTransferFunction); | 349 DISALLOW_COPY_AND_ASSIGN(UsbIsochronousTransferFunction); |
354 }; | 350 }; |
355 | 351 |
356 class UsbResetDeviceFunction : public UsbConnectionFunction { | 352 class UsbResetDeviceFunction : public UsbConnectionFunction { |
357 public: | 353 public: |
358 DECLARE_EXTENSION_FUNCTION("usb.resetDevice", USB_RESETDEVICE) | 354 DECLARE_EXTENSION_FUNCTION("usb.resetDevice", USB_RESETDEVICE) |
359 | 355 |
360 UsbResetDeviceFunction(); | 356 UsbResetDeviceFunction(); |
361 | 357 |
362 private: | 358 private: |
363 ~UsbResetDeviceFunction() override; | 359 ~UsbResetDeviceFunction() override; |
364 | 360 |
365 // ExtensionFunction: | 361 // ExtensionFunction: |
366 ResponseAction Run() override; | 362 ResponseAction Run() override; |
367 | 363 |
368 void OnComplete(bool success); | 364 void OnComplete(bool success); |
369 | 365 |
370 scoped_ptr<extensions::api::usb::ResetDevice::Params> parameters_; | 366 scoped_ptr<extensions::api::usb::ResetDevice::Params> parameters_; |
371 | 367 |
372 DISALLOW_COPY_AND_ASSIGN(UsbResetDeviceFunction); | 368 DISALLOW_COPY_AND_ASSIGN(UsbResetDeviceFunction); |
373 }; | 369 }; |
374 } // namespace extensions | 370 } // namespace extensions |
375 | 371 |
376 #endif // EXTENSIONS_BROWSER_API_USB_USB_API_H_ | 372 #endif // EXTENSIONS_BROWSER_API_USB_USB_API_H_ |
OLD | NEW |