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 DEVICE_USB_USB_DEVICE_IMPL_H_ | 5 #ifndef DEVICE_USB_USB_DEVICE_IMPL_H_ |
6 #define DEVICE_USB_USB_DEVICE_IMPL_H_ | 6 #define DEVICE_USB_USB_DEVICE_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
13 #include "device/usb/usb_descriptors.h" | 13 #include "device/usb/usb_descriptors.h" |
14 #include "device/usb/usb_device.h" | 14 #include "device/usb/usb_device.h" |
| 15 #include "device/usb/webusb_descriptors.h" |
15 | 16 |
16 struct libusb_device; | 17 struct libusb_device; |
17 struct libusb_config_descriptor; | 18 struct libusb_config_descriptor; |
18 struct libusb_device_handle; | 19 struct libusb_device_handle; |
19 | 20 |
20 namespace base { | 21 namespace base { |
21 class SequencedTaskRunner; | 22 class SequencedTaskRunner; |
22 } | 23 } |
23 | 24 |
24 namespace dbus { | 25 namespace dbus { |
(...skipping 24 matching lines...) Expand all Loading... |
49 void set_manufacturer_string(const base::string16& value) { | 50 void set_manufacturer_string(const base::string16& value) { |
50 manufacturer_string_ = value; | 51 manufacturer_string_ = value; |
51 } | 52 } |
52 void set_product_string(const base::string16& value) { | 53 void set_product_string(const base::string16& value) { |
53 product_string_ = value; | 54 product_string_ = value; |
54 } | 55 } |
55 void set_serial_number(const base::string16& value) { | 56 void set_serial_number(const base::string16& value) { |
56 serial_number_ = value; | 57 serial_number_ = value; |
57 } | 58 } |
58 void set_device_path(const std::string& value) { device_path_ = value; } | 59 void set_device_path(const std::string& value) { device_path_ = value; } |
| 60 void set_webusb_allowed_origins(scoped_ptr<WebUsbDescriptorSet> descriptors) { |
| 61 webusb_allowed_origins_ = descriptors.Pass(); |
| 62 } |
| 63 void set_webusb_landing_page(const GURL& url) { webusb_landing_page_ = url; } |
59 | 64 |
60 PlatformUsbDevice platform_device() const { return platform_device_; } | 65 PlatformUsbDevice platform_device() const { return platform_device_; } |
61 | 66 |
62 protected: | 67 protected: |
63 friend class UsbServiceImpl; | 68 friend class UsbServiceImpl; |
64 friend class UsbDeviceHandleImpl; | 69 friend class UsbDeviceHandleImpl; |
65 | 70 |
66 // Called by UsbServiceImpl only; | 71 // Called by UsbServiceImpl only; |
67 UsbDeviceImpl(scoped_refptr<UsbContext> context, | 72 UsbDeviceImpl(scoped_refptr<UsbContext> context, |
68 PlatformUsbDevice platform_device, | 73 PlatformUsbDevice platform_device, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 120 |
116 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 121 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
117 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 122 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
118 | 123 |
119 DISALLOW_COPY_AND_ASSIGN(UsbDeviceImpl); | 124 DISALLOW_COPY_AND_ASSIGN(UsbDeviceImpl); |
120 }; | 125 }; |
121 | 126 |
122 } // namespace device | 127 } // namespace device |
123 | 128 |
124 #endif // DEVICE_USB_USB_DEVICE_IMPL_H_ | 129 #endif // DEVICE_USB_USB_DEVICE_IMPL_H_ |
OLD | NEW |