Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: chrome/browser/ui/android/usb_chooser_dialog_android.cc

Issue 2746313002: Remove RenderFrameHost pointer from ChooserController. (Closed)
Patch Set: Fix Android build and juncai@ comment. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698