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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 ~UsbOpenDeviceFunction() override; | 162 ~UsbOpenDeviceFunction() override; |
163 | 163 |
164 private: | 164 private: |
165 void OnRequestAccessComplete(bool success); | 165 void OnRequestAccessComplete(bool success); |
166 | 166 |
167 DevicePermissionsManager* device_permissions_manager_; | 167 DevicePermissionsManager* device_permissions_manager_; |
168 scoped_refptr<device::UsbDevice> device_; | 168 scoped_refptr<device::UsbDevice> device_; |
169 scoped_ptr<extensions::core_api::usb::OpenDevice::Params> parameters_; | 169 scoped_ptr<extensions::core_api::usb::OpenDevice::Params> parameters_; |
170 }; | 170 }; |
171 | 171 |
| 172 class UsbSetConfigurationFunction : public UsbAsyncApiFunction { |
| 173 public: |
| 174 DECLARE_EXTENSION_FUNCTION("usb.setConfiguration", USB_SETCONFIGURATION) |
| 175 |
| 176 UsbSetConfigurationFunction(); |
| 177 |
| 178 protected: |
| 179 ~UsbSetConfigurationFunction() override; |
| 180 |
| 181 // AsyncApiFunction: |
| 182 bool Prepare() override; |
| 183 void AsyncWorkStart() override; |
| 184 |
| 185 private: |
| 186 scoped_ptr<extensions::core_api::usb::SetConfiguration::Params> parameters_; |
| 187 }; |
| 188 |
172 class UsbGetConfigurationFunction : public UsbAsyncApiFunction { | 189 class UsbGetConfigurationFunction : public UsbAsyncApiFunction { |
173 public: | 190 public: |
174 DECLARE_EXTENSION_FUNCTION("usb.getConfiguration", USB_GETCONFIGURATION) | 191 DECLARE_EXTENSION_FUNCTION("usb.getConfiguration", USB_GETCONFIGURATION) |
175 | 192 |
176 UsbGetConfigurationFunction(); | 193 UsbGetConfigurationFunction(); |
177 | 194 |
178 protected: | 195 protected: |
179 ~UsbGetConfigurationFunction() override; | 196 ~UsbGetConfigurationFunction() override; |
180 | 197 |
181 // AsyncApiFunction: | 198 // AsyncApiFunction: |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 // AsyncApiFunction: | 370 // AsyncApiFunction: |
354 bool Prepare() override; | 371 bool Prepare() override; |
355 void AsyncWorkStart() override; | 372 void AsyncWorkStart() override; |
356 | 373 |
357 private: | 374 private: |
358 scoped_ptr<extensions::core_api::usb::ResetDevice::Params> parameters_; | 375 scoped_ptr<extensions::core_api::usb::ResetDevice::Params> parameters_; |
359 }; | 376 }; |
360 } // namespace extensions | 377 } // namespace extensions |
361 | 378 |
362 #endif // EXTENSIONS_BROWSER_API_USB_USB_API_H_ | 379 #endif // EXTENSIONS_BROWSER_API_USB_USB_API_H_ |
OLD | NEW |