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

Side by Side Diff: device/vr/android/gvr/gvr_device_provider.cc

Issue 2317483002: Add support of vrdisplayconnect and vrdisplaydisconnect event (Closed)
Patch Set: Fix typo of Event reason 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/vr/android/gvr/gvr_device_provider.h" 5 #include "device/vr/android/gvr/gvr_device_provider.h"
6 6
7 #include "base/android/context_utils.h" 7 #include "base/android/context_utils.h"
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/jni_utils.h" 9 #include "base/android/jni_utils.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 Java_GvrDeviceProvider_getNativeContext(env, j_device_.obj()); 51 Java_GvrDeviceProvider_getNativeContext(env, j_device_.obj());
52 52
53 if (!gvr_api) 53 if (!gvr_api)
54 return; 54 return;
55 55
56 GvrApiManager::GetInstance()->Initialize( 56 GvrApiManager::GetInstance()->Initialize(
57 reinterpret_cast<gvr_context*>(gvr_api)); 57 reinterpret_cast<gvr_context*>(gvr_api));
58 } 58 }
59 } 59 }
60 60
61 void GvrDeviceProvider::SetClient(VRClientDispatcher* client) {
62 if (!vr_device_)
63 return;
64 vr_device_->SetClient(client);
65 }
66
61 void GvrDeviceProvider::OnGvrApiInitialized(gvr::GvrApi* gvr_api) { 67 void GvrDeviceProvider::OnGvrApiInitialized(gvr::GvrApi* gvr_api) {
62 if (!vr_device_) 68 if (!vr_device_)
63 vr_device_.reset(new GvrDevice(this, gvr_api)); 69 vr_device_.reset(new GvrDevice(this, gvr_api));
64 70
65 // Should fire a vrdisplayconnected event here. 71 // Should fire a vrdisplayconnected event here.
66 } 72 }
67 73
68 void GvrDeviceProvider::OnGvrApiShutdown() { 74 void GvrDeviceProvider::OnGvrApiShutdown() {
69 // Nothing to do here just yet. Eventually want to shut down the VRDevice 75 // Nothing to do here just yet. Eventually want to shut down the VRDevice
70 } 76 }
71 77
78 void GvrDeviceProvider::PollEvents() {
79 if (vr_device_)
80 vr_device_->PollEvents();
81 }
82
72 } // namespace device 83 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698