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 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "device/usb/usb_device.h" | 17 #include "device/usb/usb_device.h" |
18 #include "device/usb/usb_device_filter.h" | 18 #include "device/usb/usb_device_filter.h" |
19 #include "device/usb/usb_device_handle.h" | 19 #include "device/usb/usb_device_handle.h" |
20 #include "extensions/browser/api/api_resource_manager.h" | 20 #include "extensions/browser/api/api_resource_manager.h" |
21 #include "extensions/browser/extension_function.h" | 21 #include "extensions/browser/extension_function.h" |
22 #include "extensions/common/api/usb.h" | 22 #include "extensions/common/api/usb.h" |
23 #include "net/base/io_buffer.h" | 23 #include "net/base/io_buffer.h" |
24 | 24 |
25 namespace extensions { | 25 namespace extensions { |
26 | 26 |
27 class DevicePermissionEntry; | 27 class DevicePermissionEntry; |
28 class DevicePermissions; | |
29 class DevicePermissionsPrompt; | 28 class DevicePermissionsPrompt; |
30 class DevicePermissionsManager; | 29 class DevicePermissionsManager; |
31 class UsbDeviceResource; | |
32 | 30 |
33 class UsbPermissionCheckingFunction : public UIThreadExtensionFunction { | 31 class UsbPermissionCheckingFunction : public UIThreadExtensionFunction { |
34 protected: | 32 protected: |
35 UsbPermissionCheckingFunction(); | 33 UsbPermissionCheckingFunction(); |
36 ~UsbPermissionCheckingFunction() override; | 34 ~UsbPermissionCheckingFunction() override; |
37 | 35 |
38 bool HasDevicePermission(scoped_refptr<device::UsbDevice> device); | 36 bool HasDevicePermission(scoped_refptr<device::UsbDevice> device); |
39 void RecordDeviceLastUsed(); | 37 void RecordDeviceLastUsed(); |
40 | 38 |
41 private: | 39 private: |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 367 |
370 void OnComplete(bool success); | 368 void OnComplete(bool success); |
371 | 369 |
372 std::unique_ptr<extensions::api::usb::ResetDevice::Params> parameters_; | 370 std::unique_ptr<extensions::api::usb::ResetDevice::Params> parameters_; |
373 | 371 |
374 DISALLOW_COPY_AND_ASSIGN(UsbResetDeviceFunction); | 372 DISALLOW_COPY_AND_ASSIGN(UsbResetDeviceFunction); |
375 }; | 373 }; |
376 } // namespace extensions | 374 } // namespace extensions |
377 | 375 |
378 #endif // EXTENSIONS_BROWSER_API_USB_USB_API_H_ | 376 #endif // EXTENSIONS_BROWSER_API_USB_USB_API_H_ |
OLD | NEW |