OLD | NEW |
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 EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ |
6 #define EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ | 6 #define EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 scoped_ptr<base::ListValue> CreateApiDeviceList( | 94 scoped_ptr<base::ListValue> CreateApiDeviceList( |
95 const Extension* extension, | 95 const Extension* extension, |
96 const std::vector<device::HidDeviceFilter>& filters); | 96 const std::vector<device::HidDeviceFilter>& filters); |
97 void OnEnumerationComplete(const std::vector<device::HidDeviceInfo>& devices); | 97 void OnEnumerationComplete(const std::vector<device::HidDeviceInfo>& devices); |
98 | 98 |
99 void DispatchEvent(const std::string& event_name, | 99 void DispatchEvent(const std::string& event_name, |
100 scoped_ptr<base::ListValue> event_args, | 100 scoped_ptr<base::ListValue> event_args, |
101 const device::HidDeviceInfo& device_info); | 101 const device::HidDeviceInfo& device_info); |
102 | 102 |
103 base::ThreadChecker thread_checker_; | 103 base::ThreadChecker thread_checker_; |
104 base::WeakPtrFactory<HidDeviceManager> weak_factory_; | |
105 EventRouter* event_router_; | 104 EventRouter* event_router_; |
106 bool initialized_; | 105 bool initialized_; |
107 ScopedObserver<device::HidService, device::HidService::Observer> | 106 ScopedObserver<device::HidService, device::HidService::Observer> |
108 hid_service_observer_; | 107 hid_service_observer_; |
109 bool enumeration_ready_; | 108 bool enumeration_ready_; |
110 ScopedVector<GetApiDevicesParams> pending_enumerations_; | 109 ScopedVector<GetApiDevicesParams> pending_enumerations_; |
111 int next_resource_id_; | 110 int next_resource_id_; |
112 ResourceIdToDeviceIdMap device_ids_; | 111 ResourceIdToDeviceIdMap device_ids_; |
113 DeviceIdToResourceIdMap resource_ids_; | 112 DeviceIdToResourceIdMap resource_ids_; |
| 113 base::WeakPtrFactory<HidDeviceManager> weak_factory_; |
114 | 114 |
115 DISALLOW_COPY_AND_ASSIGN(HidDeviceManager); | 115 DISALLOW_COPY_AND_ASSIGN(HidDeviceManager); |
116 }; | 116 }; |
117 | 117 |
118 } // namespace extensions | 118 } // namespace extensions |
119 | 119 |
120 #endif // EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ | 120 #endif // EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ |
OLD | NEW |