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

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

Issue 2746233002: Fixes 2D-to-WebVR site transitions when browsing in VR. (Closed)
Patch Set: Created 3 years, 9 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
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>
11 #include <memory> 11 #include <memory>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/threading/thread_checker.h" 16 #include "base/threading/thread_checker.h"
17 #include "base/timer/timer.h" 17 #include "base/timer/timer.h"
18 #include "device/vr/vr_device.h" 18 #include "device/vr/vr_device.h"
19 #include "device/vr/vr_device_provider.h" 19 #include "device/vr/vr_device_provider.h"
20 #include "device/vr/vr_export.h" 20 #include "device/vr/vr_export.h"
21 #include "device/vr/vr_service.mojom.h" 21 #include "device/vr/vr_service.mojom.h"
22 #include "device/vr/vr_service_impl.h" 22 #include "device/vr/vr_service_impl.h"
23 #include "mojo/public/cpp/bindings/binding_set.h" 23 #include "mojo/public/cpp/bindings/binding_set.h"
24 24
25 namespace device { 25 namespace device {
26 26
27 // Singleton used to provide the system's VR devices to VRServiceImpl instances.
mthiesse 2017/03/13 22:17:29 nit: s/system/platform/?
tiborg 2017/03/13 23:00:58 Done.
27 class VRDeviceManager { 28 class VRDeviceManager {
28 public: 29 public:
29 DEVICE_VR_EXPORT virtual ~VRDeviceManager(); 30 DEVICE_VR_EXPORT virtual ~VRDeviceManager();
30 31
31 // Returns the VRDeviceManager singleton. 32 // Returns the VRDeviceManager singleton.
32 static VRDeviceManager* GetInstance(); 33 static VRDeviceManager* GetInstance();
33 34
34 // Adds a listener for device manager events. VRDeviceManager does not own 35 // Adds a listener for device manager events. VRDeviceManager does not own
35 // this object. 36 // this object. Automatically connects all currently available VR devices to
amp 2017/03/13 22:26:05 That's quite an additional comment here. Can we a
tiborg 2017/03/13 23:00:58 Elaborated a bit. Is this more understandable?
amp 2017/03/14 17:05:50 Yes, it doesn't sound like magic now. :)
37 // this service.
36 void AddService(VRServiceImpl* service); 38 void AddService(VRServiceImpl* service);
37 void RemoveService(VRServiceImpl* service); 39 void RemoveService(VRServiceImpl* service);
38 40
39 DEVICE_VR_EXPORT bool GetVRDevices(VRServiceImpl* service);
40 DEVICE_VR_EXPORT unsigned int GetNumberOfConnectedDevices(); 41 DEVICE_VR_EXPORT unsigned int GetNumberOfConnectedDevices();
41 42
42 void ListeningForActivateChanged(bool listening); 43 void ListeningForActivateChanged(bool listening);
43 44
44 private: 45 private:
45 friend class VRDeviceManagerTest; 46 friend class VRDeviceManagerTest;
46 friend class VRDisplayImplTest; 47 friend class VRDisplayImplTest;
47 friend class VRServiceImplTest; 48 friend class VRServiceImplTest;
48 49
49 VRDeviceManager(); 50 VRDeviceManager();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 base::ThreadChecker thread_checker_; 85 base::ThreadChecker thread_checker_;
85 86
86 base::RepeatingTimer timer_; 87 base::RepeatingTimer timer_;
87 88
88 DISALLOW_COPY_AND_ASSIGN(VRDeviceManager); 89 DISALLOW_COPY_AND_ASSIGN(VRDeviceManager);
89 }; 90 };
90 91
91 } // namespace content 92 } // namespace content
92 93
93 #endif // CONTENT_BROWSER_VR_VR_DEVICE_MANAGER_H 94 #endif // CONTENT_BROWSER_VR_VR_DEVICE_MANAGER_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698