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

Side by Side Diff: device/hid/hid_service.h

Issue 641203003: Read HID report descriptor from sysfs and request permission on connect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary code. 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 unified diff | Download patch
« no previous file with comments | « no previous file | device/hid/hid_service_linux.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DEVICE_HID_HID_SERVICE_H_ 5 #ifndef DEVICE_HID_HID_SERVICE_H_
6 #define DEVICE_HID_HID_SERVICE_H_ 6 #define DEVICE_HID_HID_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 13 matching lines...) Expand all
24 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, 24 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
25 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); 25 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
26 26
27 // Enumerates and returns a list of device identifiers. 27 // Enumerates and returns a list of device identifiers.
28 virtual void GetDevices(std::vector<HidDeviceInfo>* devices); 28 virtual void GetDevices(std::vector<HidDeviceInfo>* devices);
29 29
30 // Fills in a DeviceInfo struct with info for the given device_id. 30 // Fills in a DeviceInfo struct with info for the given device_id.
31 // Returns |true| if successful or |false| if |device_id| is invalid. 31 // Returns |true| if successful or |false| if |device_id| is invalid.
32 bool GetDeviceInfo(const HidDeviceId& device_id, HidDeviceInfo* info) const; 32 bool GetDeviceInfo(const HidDeviceId& device_id, HidDeviceInfo* info) const;
33 33
34 #if defined(OS_CHROMEOS)
35 // Requests access to the given device from the Chrome OS permission broker.
36 virtual void RequestAccess(
37 const HidDeviceId& device_id,
38 const base::Callback<void(bool success)>& callback) = 0;
39 #endif
40
34 virtual scoped_refptr<HidConnection> Connect( 41 virtual scoped_refptr<HidConnection> Connect(
35 const HidDeviceId& device_id) = 0; 42 const HidDeviceId& device_id) = 0;
36 43
37 protected: 44 protected:
38 friend class HidConnectionTest; 45 friend class HidConnectionTest;
39 46
40 typedef std::map<HidDeviceId, HidDeviceInfo> DeviceMap; 47 typedef std::map<HidDeviceId, HidDeviceInfo> DeviceMap;
41 48
42 HidService(); 49 HidService();
43 virtual ~HidService(); 50 virtual ~HidService();
44 51
45 void AddDevice(const HidDeviceInfo& info); 52 void AddDevice(const HidDeviceInfo& info);
46 void RemoveDevice(const HidDeviceId& device_id); 53 void RemoveDevice(const HidDeviceId& device_id);
47 54
48 const DeviceMap& devices() const { return devices_; } 55 const DeviceMap& devices() const { return devices_; }
49 56
50 base::ThreadChecker thread_checker_; 57 base::ThreadChecker thread_checker_;
51 58
52 private: 59 private:
53 class Destroyer; 60 class Destroyer;
54 61
55 DeviceMap devices_; 62 DeviceMap devices_;
56 63
57 DISALLOW_COPY_AND_ASSIGN(HidService); 64 DISALLOW_COPY_AND_ASSIGN(HidService);
58 }; 65 };
59 66
60 } // namespace device 67 } // namespace device
61 68
62 #endif // DEVICE_HID_HID_SERVICE_H_ 69 #endif // DEVICE_HID_HID_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | device/hid/hid_service_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698