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

Side by Side Diff: chrome/browser/usb/web_usb_permission_provider.cc

Issue 1316203006: Convert DeviceManagerDelegate to PermissionProvider mojo interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed thestig@'s comments. Created 5 years, 3 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
« no previous file with comments | « chrome/browser/usb/web_usb_permission_provider.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « chrome/browser/usb/web_usb_permission_provider.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698