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

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

Issue 2783993002: Send vrdisplayactivate to the most recently focused navigator listening for displayactivate. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | device/vr/vr_device_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/context_utils.h" 9 #include "base/android/context_utils.h"
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 device::GvrDelegateProvider* GvrDeviceProvider::GetDelegateProvider() { 39 device::GvrDelegateProvider* GvrDeviceProvider::GetDelegateProvider() {
40 device::GvrDelegateProvider* provider = 40 device::GvrDelegateProvider* provider =
41 device::GvrDelegateProvider::GetInstance(); 41 device::GvrDelegateProvider::GetInstance();
42 Initialize(provider); 42 Initialize(provider);
43 return provider; 43 return provider;
44 } 44 }
45 45
46 void GvrDeviceProvider::Initialize() { 46 void GvrDeviceProvider::Initialize() {
47 // TODO(mthiesse): Clean up how we connect the GvrDelegateProvider to the
48 // GvrDeviceProvider so we don't have to call this function multiple times.
49 // Ideally the DelegateProvider would always be available, and GetInstance()
50 // would create it.
51 Initialize(device::GvrDelegateProvider::GetInstance()); 47 Initialize(device::GvrDelegateProvider::GetInstance());
52 } 48 }
53 49
54 void GvrDeviceProvider::Initialize(device::GvrDelegateProvider* provider) { 50 void GvrDeviceProvider::Initialize(device::GvrDelegateProvider* provider) {
55 if (!provider) 51 if (!provider)
56 return; 52 return;
57 provider->SetDeviceProvider(this); 53 provider->SetDeviceProvider(this);
58 } 54 }
59 55
60 void GvrDeviceProvider::RequestPresent( 56 void GvrDeviceProvider::RequestPresent(
(...skipping 17 matching lines...) Expand all
78 74
79 void GvrDeviceProvider::SetListeningForActivate(bool listening) { 75 void GvrDeviceProvider::SetListeningForActivate(bool listening) {
80 device::GvrDelegateProvider* delegate_provider = GetDelegateProvider(); 76 device::GvrDelegateProvider* delegate_provider = GetDelegateProvider();
81 if (!delegate_provider) 77 if (!delegate_provider)
82 return; 78 return;
83 79
84 delegate_provider->SetListeningForActivate(listening); 80 delegate_provider->SetListeningForActivate(listening);
85 } 81 }
86 82
87 } // namespace device 83 } // namespace device
OLDNEW
« no previous file with comments | « no previous file | device/vr/vr_device_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698