Index: content/browser/vr/vr_device_manager.cc |
diff --git a/content/browser/vr/vr_device_manager.cc b/content/browser/vr/vr_device_manager.cc |
index 476149c27be14ced93cc52a018761a17a9e92a70..07e420da38b7c5c2cd560cfa558ba7e1f59a4dc2 100644 |
--- a/content/browser/vr/vr_device_manager.cc |
+++ b/content/browser/vr/vr_device_manager.cc |
@@ -4,8 +4,13 @@ |
#include "content/browser/vr/vr_device_manager.h" |
+#include "base/bind.h" |
#include "base/memory/singleton.h" |
#include "third_party/WebKit/public/platform/modules/vr/WebVR.h" |
+ |
+#if defined(OS_ANDROID) |
+#include "content/browser/vr/android/cardboard/cardboard_vr_device_provider.h" |
+#endif |
namespace content { |
@@ -15,8 +20,14 @@ |
VRDeviceManager::VRDeviceManager() |
: vr_initialized_(false), keep_alive_(false) { |
- bindings_.set_error_handler(this); |
+ bindings_.set_connection_error_handler( |
+ base::Bind(&VRDeviceManager::OnConnectionError, base::Unretained(this))); |
// Register VRDeviceProviders for the current platform |
+#if defined(OS_ANDROID) |
+ scoped_ptr<VRDeviceProvider> cardboard_provider( |
+ new CardboardVRDeviceProvider()); |
+ RegisterProvider(cardboard_provider.Pass()); |
+#endif |
} |
VRDeviceManager::VRDeviceManager(scoped_ptr<VRDeviceProvider> provider) |
@@ -70,7 +81,7 @@ |
std::vector<VRDevice*> devices; |
for (const auto& provider : providers_) |
- provider->GetDevices(devices); |
+ provider->GetDevices(&devices); |
mojo::Array<VRDeviceInfoPtr> out_devices(0); |
for (const auto& device : devices) { |