OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_WEBUSB_DESCRIPTORS_H_ | 5 #ifndef DEVICE_USB_WEBUSB_DESCRIPTORS_H_ |
6 #define DEVICE_USB_WEBUSB_DESCRIPTORS_H_ | 6 #define DEVICE_USB_WEBUSB_DESCRIPTORS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 GURL landing_page; | 60 GURL landing_page; |
61 }; | 61 }; |
62 | 62 |
63 bool ParseWebUsbUrlDescriptor(const std::vector<uint8_t>& bytes, GURL* output); | 63 bool ParseWebUsbUrlDescriptor(const std::vector<uint8_t>& bytes, GURL* output); |
64 | 64 |
65 void ReadWebUsbDescriptors( | 65 void ReadWebUsbDescriptors( |
66 scoped_refptr<UsbDeviceHandle> device_handle, | 66 scoped_refptr<UsbDeviceHandle> device_handle, |
67 const base::Callback<void(scoped_ptr<WebUsbAllowedOrigins> allowed_origins, | 67 const base::Callback<void(scoped_ptr<WebUsbAllowedOrigins> allowed_origins, |
68 const GURL& landing_page)>& callback); | 68 const GURL& landing_page)>& callback); |
69 | 69 |
| 70 // Check if the origin is allowed. |
| 71 bool FindInWebUsbAllowedOrigins( |
| 72 const device::WebUsbAllowedOrigins* allowed_origins, |
| 73 const GURL& origin); |
| 74 |
70 } // device | 75 } // device |
71 | 76 |
72 #endif // DEVICE_USB_WEBUSB_DESCRIPTORS_H_ | 77 #endif // DEVICE_USB_WEBUSB_DESCRIPTORS_H_ |
OLD | NEW |