Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_VR_VR_SERVICE_H | |
| 6 #define CONTENT_BROWSER_VR_VR_SERVICE_H | |
| 7 | |
| 8 #include <map> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/memory/singleton.h" | |
| 13 #include "content/browser/vr/vr_device.h" | |
| 14 #include "content/browser/vr/vr_device_provider.h" | |
| 15 #include "content/common/content_export.h" | |
| 16 | |
| 17 namespace blink { | |
| 18 class WebVRDevice; | |
| 19 } | |
| 20 | |
| 21 namespace content { | |
| 22 | |
| 23 class CONTENT_EXPORT VRService { | |
| 24 public: | |
| 25 // Returns the VRService singleton. | |
| 26 static VRService* GetInstance(); | |
| 27 | |
| 28 void Initialize(); | |
| 29 void Shutdown(); | |
|
no sievers
2015/03/19 01:24:52
It's unclear who is supposed to call these. Initia
| |
| 30 void GetVRDevices(std::vector<blink::WebVRDevice>* webvr_devices); | |
| 31 VRDevice* GetDevice(unsigned int index); | |
| 32 | |
| 33 private: | |
| 34 friend struct DefaultSingletonTraits<VRService>; | |
| 35 friend class VRServiceTest; | |
| 36 | |
| 37 VRService(); | |
| 38 | |
| 39 // Constructor for testing. Takes ownership of the given provider. | |
| 40 VRService(VRDeviceProvider* provider); | |
|
no sievers
2015/03/19 01:24:52
nit: explicit
| |
| 41 virtual ~VRService(); | |
| 42 | |
| 43 void RegisterProvider(VRDeviceProvider* provider); | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(VRService); | |
|
no sievers
2015/03/19 01:24:52
nit: move this to the bottom
| |
| 46 | |
| 47 typedef std::vector<VRDeviceProvider*> ProviderList; | |
| 48 ProviderList providers_; | |
| 49 | |
| 50 typedef std::map<unsigned int, VRDevice*> DeviceMap; | |
| 51 DeviceMap devices_; | |
| 52 | |
| 53 bool vr_initialized_; | |
| 54 }; | |
| 55 | |
| 56 } // namespace content | |
| 57 | |
| 58 #endif // CONTENT_BROWSER_VR_VR_SERVICE_H | |
| OLD | NEW |