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

Unified Diff: extensions/browser/api/hid/hid_api.h

Issue 1115213004: Add chrome.hid.getUserSelectedDevices API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 6 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
Index: extensions/browser/api/hid/hid_api.h
diff --git a/extensions/browser/api/hid/hid_api.h b/extensions/browser/api/hid/hid_api.h
index afa1cfa12386093c1ab10763e29877f04e4a9f09..da705c8e9a67e5aecd43aebf8b930fb5159a6e80 100644
--- a/extensions/browser/api/hid/hid_api.h
+++ b/extensions/browser/api/hid/hid_api.h
@@ -17,6 +17,7 @@
namespace device {
class HidConnection;
+class HidDeviceInfo;
class HidService;
} // namespace device
@@ -26,6 +27,8 @@ class IOBuffer;
namespace extensions {
+class DevicePermissionsPrompt;
+
class HidGetDevicesFunction : public UIThreadExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("hid.getDevices", HID_GETDEVICES);
@@ -43,6 +46,28 @@ class HidGetDevicesFunction : public UIThreadExtensionFunction {
DISALLOW_COPY_AND_ASSIGN(HidGetDevicesFunction);
};
+class HidGetUserSelectedDevicesFunction : public UIThreadExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("hid.getUserSelectedDevices",
+ HID_GETUSERSELECTEDDEVICES)
+
+ HidGetUserSelectedDevicesFunction();
+
+ private:
+ ~HidGetUserSelectedDevicesFunction() override;
+
+ // ExtensionFunction:
+ ResponseAction Run() override;
+
+ void OnDevicesChosen(
+ const std::vector<scoped_refptr<device::HidDeviceInfo>>& devices);
+
+ HidDeviceManager* device_manager_;
+ scoped_ptr<DevicePermissionsPrompt> prompt_;
+
+ DISALLOW_COPY_AND_ASSIGN(HidGetUserSelectedDevicesFunction);
+};
+
class HidConnectFunction : public UIThreadExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("hid.connect", HID_CONNECT);
« no previous file with comments | « chrome/browser/ui/views/extensions/device_permissions_dialog_view.cc ('k') | extensions/browser/api/hid/hid_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698