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

Side by Side Diff: device/vr/vr_device_manager.h

Issue 2510993002: Notify VRDeviceProviders when there are pages listening for vrdisplayactivate (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 | « device/vr/android/gvr/gvr_device_provider.cc ('k') | device/vr/vr_device_manager.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 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
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
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
OLDNEW
« no previous file with comments | « device/vr/android/gvr/gvr_device_provider.cc ('k') | device/vr/vr_device_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698