OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "chrome/browser/ui/android/usb_chooser_dialog_android.h" | 5 #include "chrome/browser/ui/android/usb_chooser_dialog_android.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 return false; | 229 return false; |
230 | 230 |
231 // On Android it is not possible to read the WebUSB descriptors until Chrome | 231 // On Android it is not possible to read the WebUSB descriptors until Chrome |
232 // has been granted permission to open it. Instead we must list all devices | 232 // has been granted permission to open it. Instead we must list all devices |
233 // and perform the allowed origins check after the device has been selected. | 233 // and perform the allowed origins check after the device has been selected. |
234 if (!device->permission_granted()) | 234 if (!device->permission_granted()) |
235 return true; | 235 return true; |
236 | 236 |
237 return device::FindInWebUsbAllowedOrigins( | 237 return device::FindInWebUsbAllowedOrigins( |
238 device->webusb_allowed_origins(), | 238 device->webusb_allowed_origins(), |
239 render_frame_host_->GetLastCommittedURL().GetOrigin()); | 239 render_frame_host_->GetLastCommittedURL().GetOrigin(), base::nullopt, |
| 240 base::nullopt); |
240 } | 241 } |
241 | 242 |
242 // static | 243 // static |
243 bool UsbChooserDialogAndroid::Register(JNIEnv* env) { | 244 bool UsbChooserDialogAndroid::Register(JNIEnv* env) { |
244 return RegisterNativesImpl(env); | 245 return RegisterNativesImpl(env); |
245 } | 246 } |
OLD | NEW |