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

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

Issue 2367673002: Updated to GVR 1.0 SDK (Closed)
Patch Set: Go away, spurious CL dependency 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/android/gvr/gvr_device_provider.h ('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 82c91d6629bd26a3b0d766827690be9f5bd12fe2..6961ba3758c3d5ff8b3543c63c0c2b7af7b26a9a 100644
--- a/device/vr/android/gvr/gvr_device_provider.cc
+++ b/device/vr/android/gvr/gvr_device_provider.cc
@@ -15,9 +15,9 @@
#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"
+#include "third_party/gvr-android-sdk/src/ndk/include/vr/gvr/capi/include/gvr.h"
+#include "third_party/gvr-android-sdk/src/ndk/include/vr/gvr/capi/include/gvr_controller.h"
+#include "third_party/gvr-android-sdk/src/ndk/include/vr/gvr/capi/include/gvr_types.h"
using base::android::AttachCurrentThread;
using base::android::GetApplicationContext;
@@ -77,9 +77,6 @@ GvrDeviceProvider::GvrDeviceProvider()
main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
GvrDeviceProvider::~GvrDeviceProvider() {
- GamepadDataFetcherManager::GetInstance()->RemoveSourceFactory(
- GAMEPAD_SOURCE_GVR);
-
ExitPresent();
}
@@ -96,16 +93,9 @@ void GvrDeviceProvider::SetClient(VRClientDispatcher* client) {
}
void GvrDeviceProvider::Initialize() {
- if (!non_presenting_delegate_) {
- non_presenting_delegate_.reset(new GvrNonPresentingDelegate());
- 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()));
- }
+ if (!vr_device_) {
+ vr_device_.reset(new GvrDevice(this, nullptr));
+ client_->OnDeviceConnectionStatusChanged(vr_device_.get(), true);
}
}
@@ -123,7 +113,10 @@ void GvrDeviceProvider::ExitPresent() {
if (!vr_device_)
return;
- vr_device_->SetDelegate(non_presenting_delegate_.get());
+ vr_device_->SetDelegate(nullptr);
+
+ GamepadDataFetcherManager::GetInstance()->RemoveSourceFactory(
+ GAMEPAD_SOURCE_GVR);
GvrDelegateProvider* delegate_provider = GvrDelegateProvider::GetInstance();
if (delegate_provider)
@@ -153,6 +146,8 @@ void GvrDeviceProvider::GvrDelegateReady(GvrDelegate* delegate) {
DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
vr_device_->SetDelegate(delegate);
+ GamepadDataFetcherManager::GetInstance()->AddFactory(
+ new GvrGamepadDataFetcher::Factory(delegate, vr_device_->id()));
}
} // namespace device
« no previous file with comments | « device/vr/android/gvr/gvr_device_provider.h ('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