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

Unified Diff: device/hid/hid_service.h

Issue 660573007: Open HID connections asynchronously. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « device/hid/hid_connection_unittest.cc ('k') | device/hid/hid_service_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/hid_service.h
diff --git a/device/hid/hid_service.h b/device/hid/hid_service.h
index a571434e7c400d4fe5f07a39c670875a74f6ae3a..a3f71320416d26b4c9823b37debb36feb739bb8b 100644
--- a/device/hid/hid_service.h
+++ b/device/hid/hid_service.h
@@ -20,6 +20,9 @@ class HidConnection;
class HidService {
public:
+ typedef base::Callback<void(scoped_refptr<HidConnection> connection)>
+ ConnectCallback;
+
static HidService* GetInstance(
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
@@ -31,15 +34,10 @@ class HidService {
// Returns |true| if successful or |false| if |device_id| is invalid.
bool GetDeviceInfo(const HidDeviceId& device_id, HidDeviceInfo* info) const;
-#if defined(OS_CHROMEOS)
- // Requests access to the given device from the Chrome OS permission broker.
- virtual void RequestAccess(
- const HidDeviceId& device_id,
- const base::Callback<void(bool success)>& callback) = 0;
-#endif
-
- virtual scoped_refptr<HidConnection> Connect(
- const HidDeviceId& device_id) = 0;
+ // Opens a connection to a device. The callback will be run with null on
+ // failure.
+ virtual void Connect(const HidDeviceId& device_id,
+ const ConnectCallback& callback) = 0;
protected:
friend class HidConnectionTest;
« no previous file with comments | « device/hid/hid_connection_unittest.cc ('k') | device/hid/hid_service_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698