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

Unified Diff: content/browser/vr/vr_device_manager.cc

Issue 1200303002: Android WebVR implementation, Cardboard 0.5.5 SDK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed vr_transform_utils, using ui/gfx/transform_utils instead Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/vr/vr_device_manager.h ('k') | content/browser/vr/vr_device_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,9 +4,14 @@
#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 {
namespace {
@@ -15,8 +20,14 @@ VRDeviceManager* g_vr_device_manager = nullptr;
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 @@ mojo::Array<VRDeviceInfoPtr> VRDeviceManager::GetVRDevices() {
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) {
« no previous file with comments | « content/browser/vr/vr_device_manager.h ('k') | content/browser/vr/vr_device_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698