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

Unified Diff: chrome/browser/usb/web_usb_permission_provider.cc

Issue 2581543002: Add infrastructure for a USB device blocklist. (Closed)
Patch Set: Fix typo. Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/usb/usb_chooser_controller.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/usb/web_usb_permission_provider.cc
diff --git a/chrome/browser/usb/web_usb_permission_provider.cc b/chrome/browser/usb/web_usb_permission_provider.cc
index fe270111cb401d4df78ada9c3b5a974a7e1b21e8..7645ed362816d95c204377dd9d73ca082422bb9f 100644
--- a/chrome/browser/usb/web_usb_permission_provider.cc
+++ b/chrome/browser/usb/web_usb_permission_provider.cc
@@ -10,6 +10,7 @@
#include "base/command_line.h"
#include "base/stl_util.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/usb/usb_blocklist.h"
#include "chrome/browser/usb/usb_chooser_context.h"
#include "chrome/browser/usb/usb_chooser_context_factory.h"
#include "chrome/browser/usb/usb_tab_helper.h"
@@ -59,6 +60,10 @@ bool WebUSBPermissionProvider::HasDevicePermission(
content::RenderFrameHost* render_frame_host,
scoped_refptr<const device::UsbDevice> device) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ if (UsbBlocklist::Get().IsExcluded(device))
+ return false;
+
WebContents* web_contents =
WebContents::FromRenderFrameHost(render_frame_host);
GURL embedding_origin =
« no previous file with comments | « chrome/browser/usb/usb_chooser_controller.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698