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

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

Issue 517923002: Add more generic filters to the chrome.usb.getDevices API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Function comments are descriptive. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/usb_service/usb_device_filter_unittest.cc ('k') | extensions/browser/api/usb/usb_api.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.h
diff --git a/extensions/browser/api/usb/usb_api.h b/extensions/browser/api/usb/usb_api.h
index 3dd0d2b5d5e6b022b56e3e7eca16b9d86484a318..1549f97f7391aabc9a42a8b3189348128f93ef67 100644
--- a/extensions/browser/api/usb/usb_api.h
+++ b/extensions/browser/api/usb/usb_api.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "components/usb_service/usb_device.h"
+#include "components/usb_service/usb_device_filter.h"
#include "components/usb_service/usb_device_handle.h"
#include "extensions/browser/api/api_resource_manager.h"
#include "extensions/browser/api/async_api_function.h"
@@ -31,7 +32,13 @@ class UsbAsyncApiFunction : public AsyncApiFunction {
virtual bool PrePrepare() OVERRIDE;
virtual bool Respond() OVERRIDE;
- scoped_refptr<usb_service::UsbDevice> GetDeviceOrOrCompleteWithError(
+ static void CreateDeviceFilter(
+ const extensions::core_api::usb::DeviceFilter& input,
+ usb_service::UsbDeviceFilter* output);
+
+ bool HasDevicePermission(scoped_refptr<usb_service::UsbDevice> device);
+
+ scoped_refptr<usb_service::UsbDevice> GetDeviceOrCompleteWithError(
const extensions::core_api::usb::Device& input_device);
scoped_refptr<usb_service::UsbDeviceHandle>
« no previous file with comments | « components/usb_service/usb_device_filter_unittest.cc ('k') | extensions/browser/api/usb/usb_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698