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 #ifndef CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 void CompleteWithError(const std::string& error); | 37 void CompleteWithError(const std::string& error); |
38 | 38 |
39 ApiResourceManager<UsbDeviceResource>* manager_; | 39 ApiResourceManager<UsbDeviceResource>* manager_; |
40 }; | 40 }; |
41 | 41 |
42 class UsbAsyncApiTransferFunction : public UsbAsyncApiFunction { | 42 class UsbAsyncApiTransferFunction : public UsbAsyncApiFunction { |
43 protected: | 43 protected: |
44 UsbAsyncApiTransferFunction(); | 44 UsbAsyncApiTransferFunction(); |
45 virtual ~UsbAsyncApiTransferFunction(); | 45 virtual ~UsbAsyncApiTransferFunction(); |
46 | 46 |
47 bool ConvertDirectionSafely(const std::string& input, | 47 bool ConvertDirectionSafely(const extensions::api::usb::Direction& input, |
48 UsbDevice::TransferDirection* output); | 48 UsbDevice::TransferDirection* output); |
49 bool ConvertRequestTypeSafely(const std::string& input, | 49 bool ConvertRequestTypeSafely(const extensions::api::usb::RequestType& input, |
50 UsbDevice::TransferRequestType* output); | 50 UsbDevice::TransferRequestType* output); |
51 bool ConvertRecipientSafely(const std::string& input, | 51 bool ConvertRecipientSafely(const extensions::api::usb::Recipient& input, |
52 UsbDevice::TransferRecipient* output); | 52 UsbDevice::TransferRecipient* output); |
53 | 53 |
54 void OnCompleted(UsbTransferStatus status, | 54 void OnCompleted(UsbTransferStatus status, |
55 scoped_refptr<net::IOBuffer> data, | 55 scoped_refptr<net::IOBuffer> data, |
56 size_t length); | 56 size_t length); |
57 }; | 57 }; |
58 | 58 |
59 class UsbFindDevicesFunction : public UsbAsyncApiFunction { | 59 class UsbFindDevicesFunction : public UsbAsyncApiFunction { |
60 public: | 60 public: |
61 DECLARE_EXTENSION_FUNCTION_NAME("usb.findDevices"); | 61 DECLARE_EXTENSION_FUNCTION_NAME("usb.findDevices"); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 virtual bool Prepare() OVERRIDE; | 207 virtual bool Prepare() OVERRIDE; |
208 virtual void AsyncWorkStart() OVERRIDE; | 208 virtual void AsyncWorkStart() OVERRIDE; |
209 | 209 |
210 private: | 210 private: |
211 scoped_ptr<extensions::api::usb::IsochronousTransfer::Params> parameters_; | 211 scoped_ptr<extensions::api::usb::IsochronousTransfer::Params> parameters_; |
212 }; | 212 }; |
213 | 213 |
214 } // namespace extensions | 214 } // namespace extensions |
215 | 215 |
216 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ | 216 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ |
OLD | NEW |