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

Unified Diff: extensions/browser/api/usb/usb_api.cc

Issue 1034333002: Check USB device path access when prompting users to select a device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move MockPermissionBrokerClient into its own header. Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/api/device_permissions_prompt.cc ('k') | extensions/browser/api/usb/usb_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/usb/usb_api.cc
diff --git a/extensions/browser/api/usb/usb_api.cc b/extensions/browser/api/usb/usb_api.cc
index e1a4627e2e95d4fb450c0bef7b937f4d60f46d4f..f1fcd239c1428d22a6df91bce31bac1dc33ea898 100644
--- a/extensions/browser/api/usb/usb_api.cc
+++ b/extensions/browser/api/usb/usb_api.cc
@@ -242,7 +242,6 @@ const char* ConvertTransferStatusToApi(const UsbTransferStatus status) {
}
}
-#if defined(OS_CHROMEOS)
void RequestUsbDevicesAccessHelper(
ScopedDeviceVector devices,
std::vector<scoped_refptr<UsbDevice> >::iterator i,
@@ -282,7 +281,6 @@ void RequestUsbDevicesAccess(
interface_id,
callback));
}
-#endif // OS_CHROMEOS
base::DictionaryValue* CreateTransferInfo(UsbTransferStatus status,
scoped_refptr<net::IOBuffer> data,
@@ -600,14 +598,10 @@ void UsbFindDevicesFunction::AsyncWorkStart() {
}
}
-#if defined(OS_CHROMEOS)
RequestUsbDevicesAccess(
devices.Pass(),
interface_id,
base::Bind(&UsbFindDevicesFunction::OpenDevices, this));
-#else
- OpenDevices(devices.Pass());
-#endif // OS_CHROMEOS
}
void UsbFindDevicesFunction::OpenDevices(ScopedDeviceVector devices) {
@@ -792,13 +786,9 @@ void UsbOpenDeviceFunction::AsyncWorkStart() {
return;
}
-#if defined(OS_CHROMEOS)
device_->RequestUsbAccess(
-1, /* any interface, unused by the permission broker */
base::Bind(&UsbOpenDeviceFunction::OnRequestAccessComplete, this));
-#else
- OnRequestAccessComplete(true);
-#endif // OS_CHROMEOS
}
void UsbOpenDeviceFunction::OnRequestAccessComplete(bool success) {
« no previous file with comments | « extensions/browser/api/device_permissions_prompt.cc ('k') | extensions/browser/api/usb/usb_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698