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

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

Issue 419713002: Support permission_broker for chrome.hid devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix hid in app_shell after its move to //extensions Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « device/hid/hid_service.cc ('k') | device/hid/hid_service_linux.cc » ('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_LINUX_H_ 5 #ifndef DEVICE_HID_HID_SERVICE_LINUX_H_
6 #define DEVICE_HID_HID_SERVICE_LINUX_H_ 6 #define DEVICE_HID_HID_SERVICE_LINUX_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h"
10 #include "device/hid/device_monitor_linux.h" 11 #include "device/hid/device_monitor_linux.h"
11 #include "device/hid/hid_device_info.h" 12 #include "device/hid/hid_device_info.h"
12 #include "device/hid/hid_service.h" 13 #include "device/hid/hid_service.h"
13 14
14 struct udev_device; 15 struct udev_device;
15 16
16 namespace device { 17 namespace device {
17 18
18 class HidConnection; 19 class HidConnection;
19 20
20 class HidServiceLinux : public HidService, 21 class HidServiceLinux : public HidService,
21 public DeviceMonitorLinux::Observer { 22 public DeviceMonitorLinux::Observer {
22 public: 23 public:
23 HidServiceLinux(); 24 HidServiceLinux(scoped_refptr<base::MessageLoopProxy> ui_message_loop);
24 25
25 virtual scoped_refptr<HidConnection> Connect(const HidDeviceId& device_id) 26 virtual scoped_refptr<HidConnection> Connect(const HidDeviceId& device_id)
26 OVERRIDE; 27 OVERRIDE;
27 28
28 // Implements DeviceMonitorLinux::Observer: 29 // Implements DeviceMonitorLinux::Observer:
29 virtual void OnDeviceAdded(udev_device* device) OVERRIDE; 30 virtual void OnDeviceAdded(udev_device* device) OVERRIDE;
30 virtual void OnDeviceRemoved(udev_device* device) OVERRIDE; 31 virtual void OnDeviceRemoved(udev_device* device) OVERRIDE;
31 32
32 private: 33 private:
33 virtual ~HidServiceLinux(); 34 virtual ~HidServiceLinux();
34 35
36 void OnRequestAccessComplete(
37 const std::string& path,
38 scoped_ptr<HidDeviceInfo> device_info,
39 bool success);
40
41 scoped_refptr<base::MessageLoopProxy> ui_message_loop_;
42
43 base::WeakPtrFactory<HidServiceLinux> weak_factory_;
44
35 DISALLOW_COPY_AND_ASSIGN(HidServiceLinux); 45 DISALLOW_COPY_AND_ASSIGN(HidServiceLinux);
36 }; 46 };
37 47
38 } // namespace device 48 } // namespace device
39 49
40 #endif // DEVICE_HID_HID_SERVICE_LINUX_H_ 50 #endif // DEVICE_HID_HID_SERVICE_LINUX_H_
OLDNEW
« no previous file with comments | « device/hid/hid_service.cc ('k') | device/hid/hid_service_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698