| Index: content/browser/vr/vr_service.h
|
| diff --git a/content/browser/vr/vr_service.h b/content/browser/vr/vr_service.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8281f2e30c8be0a18af5270a2fb613ec4e8bf501
|
| --- /dev/null
|
| +++ b/content/browser/vr/vr_service.h
|
| @@ -0,0 +1,58 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CONTENT_BROWSER_VR_VR_SERVICE_H
|
| +#define CONTENT_BROWSER_VR_VR_SERVICE_H
|
| +
|
| +#include <map>
|
| +#include <vector>
|
| +
|
| +#include "base/basictypes.h"
|
| +#include "base/memory/singleton.h"
|
| +#include "content/browser/vr/vr_device.h"
|
| +#include "content/browser/vr/vr_device_provider.h"
|
| +#include "content/common/content_export.h"
|
| +
|
| +namespace blink {
|
| +class WebVRDevice;
|
| +}
|
| +
|
| +namespace content {
|
| +
|
| +class CONTENT_EXPORT VRService {
|
| + public:
|
| + // Returns the VRService singleton.
|
| + static VRService* GetInstance();
|
| +
|
| + void Initialize();
|
| + void Shutdown();
|
| + void GetVRDevices(std::vector<blink::WebVRDevice>* webvr_devices);
|
| + VRDevice* GetDevice(unsigned int index);
|
| +
|
| + private:
|
| + friend struct DefaultSingletonTraits<VRService>;
|
| + friend class VRServiceTest;
|
| +
|
| + VRService();
|
| +
|
| + // Constructor for testing. Takes ownership of the given provider.
|
| + explicit VRService(VRDeviceProvider* provider);
|
| + virtual ~VRService();
|
| +
|
| + void RegisterProvider(VRDeviceProvider* provider);
|
| +
|
| + typedef std::vector<VRDeviceProvider*> ProviderList;
|
| + ProviderList providers_;
|
| +
|
| + typedef std::map<unsigned int, VRDevice*> DeviceMap;
|
| + DeviceMap devices_;
|
| +
|
| + bool vr_initialized_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(VRService);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_BROWSER_VR_VR_SERVICE_H
|
|
|