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" | |
Lei Zhang
2015/09/05 01:18:14
nit: blank line after.
Reilly Grant (use Gerrit)
2015/09/05 01:56:47
Done.
| |
6 #include "content/public/browser/browser_thread.h" | |
7 | |
8 // static | |
9 void WebUSBPermissionProvider::Create( | |
10 content::RenderFrameHost* render_frame_host, | |
11 mojo::InterfaceRequest<PermissionProvider> request) { | |
12 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | |
Lei Zhang
2015/09/05 01:18:15
Does WebUSBPermissionProvider live on the UI threa
Reilly Grant (use Gerrit)
2015/09/05 01:56:47
Done.
| |
13 DCHECK(render_frame_host); | |
14 | |
15 // The created object is strongly bound to (and owned by) the pipe. | |
16 new WebUSBPermissionProvider(render_frame_host, request.Pass()); | |
17 } | |
18 | |
19 WebUSBPermissionProvider::WebUSBPermissionProvider( | |
20 content::RenderFrameHost* render_frame_host, | |
21 mojo::InterfaceRequest<PermissionProvider> request) | |
22 : binding_(this, request.Pass()), | |
23 render_frame_host_(render_frame_host) {} | |
24 | |
25 WebUSBPermissionProvider::~WebUSBPermissionProvider() {} | |
26 | |
27 void WebUSBPermissionProvider::HasDevicePermission( | |
28 mojo::Array<mojo::String> requested_guids, | |
29 const HasDevicePermissionCallback& callback) { | |
30 // TODO(reillyg): Look up permissions granted to the render frame host's | |
31 // current origin in the render frame process's browser context. | |
32 ignore_result(render_frame_host_); | |
33 mojo::Array<mojo::String> allowed_guids(0); | |
34 callback.Run(allowed_guids.Pass()); | |
35 } | |
OLD | NEW |