Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/usb/web_usb_permission_provider.h" | |
| 6 #include "content/public/browser/browser_thread.h" | |
| 7 | |
| 8 namespace chrome { | |
| 9 | |
| 10 // static | |
| 11 void WebUSBPermissionProvider::Create( | |
| 12 content::RenderFrameHost* render_frame_host, | |
| 13 mojo::InterfaceRequest<PermissionProvider> request) { | |
| 14 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | |
|
Lei Zhang
2015/09/05 00:24:20
DCHECK_CURRENTLY_ON()
Reilly Grant (use Gerrit)
2015/09/05 00:56:25
Done.
| |
| 15 DCHECK(render_frame_host); | |
| 16 | |
| 17 // The created object is strongly bound to (and owned by) the pipe. | |
| 18 new WebUSBPermissionProvider(render_frame_host, request.Pass()); | |
| 19 } | |
| 20 | |
| 21 WebUSBPermissionProvider::WebUSBPermissionProvider( | |
| 22 content::RenderFrameHost* render_frame_host, | |
| 23 mojo::InterfaceRequest<PermissionProvider> request) | |
| 24 : binding_(this, request.Pass()), | |
| 25 render_frame_host_(render_frame_host) {} | |
| 26 | |
| 27 WebUSBPermissionProvider::~WebUSBPermissionProvider() {} | |
| 28 | |
| 29 void WebUSBPermissionProvider::HasDevicePermission( | |
| 30 mojo::Array<mojo::String> requested_guids, | |
| 31 const HasDevicePermissionCallback& callback) { | |
| 32 // TODO(reillyg): Look up permissions granted to the render frame host's | |
| 33 // current origin in the render frame process's browser context. | |
| 34 ignore_result(render_frame_host_); | |
|
Lei Zhang
2015/09/05 00:24:20
What's this suppose to do?
Reilly Grant (use Gerrit)
2015/09/05 00:56:25
It silences a warning that the private member is u
Lei Zhang
2015/09/05 01:18:14
Add a comment?
// Make a dummy reference to the v
Reilly Grant (use Gerrit)
2015/09/05 01:56:46
Done.
| |
| 35 mojo::Array<mojo::String> allowed_guids(0); | |
| 36 callback.Run(allowed_guids.Pass()); | |
| 37 } | |
| 38 | |
| 39 } // namespace chrome | |
| OLD | NEW |