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

Side by Side Diff: chrome/browser/extensions/api/usb/usb_api.h

Issue 11577017: Update USB extension API with suggestions from review. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Picking up IDL lexer changes. Created 8 years 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/usb/usb_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/usb/usb_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698