OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_VR_VR_DEVICE_MANAGER_H | 5 #ifndef DEVICE_VR_VR_DEVICE_MANAGER_H |
6 #define DEVICE_VR_VR_DEVICE_MANAGER_H | 6 #define DEVICE_VR_VR_DEVICE_MANAGER_H |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 21 matching lines...) Expand all Loading... |
32 static VRDeviceManager* GetInstance(); | 32 static VRDeviceManager* GetInstance(); |
33 | 33 |
34 // Adds a listener for device manager events. VRDeviceManager does not own | 34 // Adds a listener for device manager events. VRDeviceManager does not own |
35 // this object. | 35 // this object. |
36 void AddService(VRServiceImpl* service); | 36 void AddService(VRServiceImpl* service); |
37 void RemoveService(VRServiceImpl* service); | 37 void RemoveService(VRServiceImpl* service); |
38 | 38 |
39 DEVICE_VR_EXPORT bool GetVRDevices(VRServiceImpl* service); | 39 DEVICE_VR_EXPORT bool GetVRDevices(VRServiceImpl* service); |
40 DEVICE_VR_EXPORT unsigned int GetNumberOfConnectedDevices(); | 40 DEVICE_VR_EXPORT unsigned int GetNumberOfConnectedDevices(); |
41 | 41 |
| 42 void ListeningForActivateChanged(bool listening); |
| 43 |
42 private: | 44 private: |
43 friend class VRDeviceManagerTest; | 45 friend class VRDeviceManagerTest; |
44 friend class VRServiceImplTest; | 46 friend class VRServiceImplTest; |
45 | 47 |
46 VRDeviceManager(); | 48 VRDeviceManager(); |
47 // Constructor for testing. | 49 // Constructor for testing. |
48 DEVICE_VR_EXPORT explicit VRDeviceManager( | 50 DEVICE_VR_EXPORT explicit VRDeviceManager( |
49 std::unique_ptr<VRDeviceProvider> provider); | 51 std::unique_ptr<VRDeviceProvider> provider); |
50 | 52 |
51 DEVICE_VR_EXPORT VRDevice* GetDevice(unsigned int index); | 53 DEVICE_VR_EXPORT VRDevice* GetDevice(unsigned int index); |
(...skipping 18 matching lines...) Expand all Loading... |
70 bool vr_initialized_; | 72 bool vr_initialized_; |
71 | 73 |
72 using ServiceList = std::vector<VRServiceImpl*>; | 74 using ServiceList = std::vector<VRServiceImpl*>; |
73 ServiceList services_; | 75 ServiceList services_; |
74 | 76 |
75 // For testing. If true will not delete self when consumer count reaches 0. | 77 // For testing. If true will not delete self when consumer count reaches 0. |
76 bool keep_alive_; | 78 bool keep_alive_; |
77 | 79 |
78 bool has_scheduled_poll_; | 80 bool has_scheduled_poll_; |
79 | 81 |
| 82 bool has_activate_listeners_; |
| 83 |
80 base::ThreadChecker thread_checker_; | 84 base::ThreadChecker thread_checker_; |
81 | 85 |
82 base::RepeatingTimer timer_; | 86 base::RepeatingTimer timer_; |
83 | 87 |
84 DISALLOW_COPY_AND_ASSIGN(VRDeviceManager); | 88 DISALLOW_COPY_AND_ASSIGN(VRDeviceManager); |
85 }; | 89 }; |
86 | 90 |
87 } // namespace content | 91 } // namespace content |
88 | 92 |
89 #endif // CONTENT_BROWSER_VR_VR_DEVICE_MANAGER_H | 93 #endif // CONTENT_BROWSER_VR_VR_DEVICE_MANAGER_H |
OLD | NEW |