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

Unified Diff: device/vr/android/gvr/gvr_device_provider.cc

Issue 2351573002: Added support for GVR controllers (Closed)
Patch Set: Added appropriate Webkit dep to device/vr/BUILD.gn Created 4 years, 3 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 | « device/vr/DEPS ('k') | device/vr/android/gvr/gvr_gamepad_data_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/android/gvr/gvr_device_provider.cc
diff --git a/device/vr/android/gvr/gvr_device_provider.cc b/device/vr/android/gvr/gvr_device_provider.cc
index 21061f96ecc56b98a8f091cc1765bd7b1afa06b6..82c91d6629bd26a3b0d766827690be9f5bd12fe2 100644
--- a/device/vr/android/gvr/gvr_device_provider.cc
+++ b/device/vr/android/gvr/gvr_device_provider.cc
@@ -12,9 +12,12 @@
#include "base/android/scoped_java_ref.h"
#include "device/vr/android/gvr/gvr_delegate.h"
#include "device/vr/android/gvr/gvr_device.h"
+#include "device/vr/android/gvr/gvr_gamepad_data_fetcher.h"
#include "device/vr/vr_device_manager.h"
#include "jni/GvrDeviceProvider_jni.h"
#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr.h"
+#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr_controller.h"
+#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr_types.h"
using base::android::AttachCurrentThread;
using base::android::GetApplicationContext;
@@ -74,6 +77,9 @@ GvrDeviceProvider::GvrDeviceProvider()
main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
GvrDeviceProvider::~GvrDeviceProvider() {
+ GamepadDataFetcherManager::GetInstance()->RemoveSourceFactory(
+ GAMEPAD_SOURCE_GVR);
+
ExitPresent();
}
@@ -95,6 +101,10 @@ void GvrDeviceProvider::Initialize() {
if (non_presenting_delegate_->gvr_api()) {
vr_device_.reset(new GvrDevice(this, non_presenting_delegate_.get()));
client_->OnDeviceConnectionStatusChanged(vr_device_.get(), true);
+
+ GamepadDataFetcherManager::GetInstance()->AddFactory(
+ new GvrGamepadDataFetcher::Factory(non_presenting_delegate_.get(),
+ vr_device_->id()));
}
}
}
« no previous file with comments | « device/vr/DEPS ('k') | device/vr/android/gvr/gvr_gamepad_data_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698