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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/memory/ref_counted.h" | |
14 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
15 #include "base/message_loop/message_loop_proxy.h" | |
16 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
17 #include "device/hid/hid_device_info.h" | 15 #include "device/hid/hid_device_info.h" |
18 #include "extensions/browser/browser_context_keyed_api_factory.h" | 16 #include "extensions/browser/browser_context_keyed_api_factory.h" |
19 #include "extensions/common/api/hid.h" | 17 #include "extensions/common/api/hid.h" |
20 | 18 |
21 namespace extensions { | 19 namespace extensions { |
22 | 20 |
23 class HidDeviceManager : public BrowserContextKeyedAPI { | 21 class HidDeviceManager : public BrowserContextKeyedAPI { |
24 public: | 22 public: |
25 explicit HidDeviceManager(content::BrowserContext* context); | 23 explicit HidDeviceManager(content::BrowserContext* context); |
(...skipping 22 matching lines...) Expand all Loading... |
48 base::ThreadChecker thread_checker_; | 46 base::ThreadChecker thread_checker_; |
49 | 47 |
50 int next_resource_id_; | 48 int next_resource_id_; |
51 | 49 |
52 typedef std::map<int, device::HidDeviceId> ResourceIdToDeviceIdMap; | 50 typedef std::map<int, device::HidDeviceId> ResourceIdToDeviceIdMap; |
53 typedef std::map<device::HidDeviceId, int> DeviceIdToResourceIdMap; | 51 typedef std::map<device::HidDeviceId, int> DeviceIdToResourceIdMap; |
54 | 52 |
55 ResourceIdToDeviceIdMap device_ids_; | 53 ResourceIdToDeviceIdMap device_ids_; |
56 DeviceIdToResourceIdMap resource_ids_; | 54 DeviceIdToResourceIdMap resource_ids_; |
57 | 55 |
58 scoped_refptr<base::MessageLoopProxy> ui_message_loop_; | |
59 | |
60 DISALLOW_COPY_AND_ASSIGN(HidDeviceManager); | 56 DISALLOW_COPY_AND_ASSIGN(HidDeviceManager); |
61 }; | 57 }; |
62 | 58 |
63 } // namespace extensions | 59 } // namespace extensions |
64 | 60 |
65 #endif // EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ | 61 #endif // EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ |
OLD | NEW |