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

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell.h

Issue 2975683002: Add GeolocationManager service (Closed)
Patch Set: Add GeolocationManager service Created 3 years, 5 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 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/android/jni_weak_ref.h" 12 #include "base/android/jni_weak_ref.h"
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/single_thread_task_runner.h" 16 #include "base/single_thread_task_runner.h"
17 #include "chrome/browser/android/vr_shell/ui_interface.h" 17 #include "chrome/browser/android/vr_shell/ui_interface.h"
18 #include "chrome/browser/android/vr_shell/ui_unsupported_mode.h" 18 #include "chrome/browser/android/vr_shell/ui_unsupported_mode.h"
19 #include "chrome/browser/android/vr_shell/vr_controller_model.h" 19 #include "chrome/browser/android/vr_shell/vr_controller_model.h"
20 #include "chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.h" 20 #include "chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.h"
21 #include "content/public/browser/web_contents_observer.h" 21 #include "content/public/browser/web_contents_observer.h"
22 #include "device/geolocation/public/interfaces/geolocation_manager.mojom.h"
22 #include "device/vr/android/gvr/cardboard_gamepad_data_provider.h" 23 #include "device/vr/android/gvr/cardboard_gamepad_data_provider.h"
23 #include "device/vr/android/gvr/gvr_delegate.h" 24 #include "device/vr/android/gvr/gvr_delegate.h"
24 #include "device/vr/android/gvr/gvr_gamepad_data_provider.h" 25 #include "device/vr/android/gvr/gvr_gamepad_data_provider.h"
25 #include "device/vr/vr_service.mojom.h" 26 #include "device/vr/vr_service.mojom.h"
26 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h" 27 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h"
27 28
28 namespace blink { 29 namespace blink {
29 class WebInputEvent; 30 class WebInputEvent;
30 } 31 }
31 32
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 JNIEnv* env, 152 JNIEnv* env,
152 const base::android::JavaParamRef<jobject>& object, 153 const base::android::JavaParamRef<jobject>& object,
153 jint width, 154 jint width,
154 jint height, 155 jint height,
155 jfloat dpr); 156 jfloat dpr);
156 157
157 // Perform a UI action triggered by the javascript API. 158 // Perform a UI action triggered by the javascript API.
158 void DoUiAction(const UiAction action, 159 void DoUiAction(const UiAction action,
159 const base::DictionaryValue* arguments); 160 const base::DictionaryValue* arguments);
160 161
162 void SetHighAccuracyLocation(bool high_accuracy_location);
161 void SetContentCssSize(float width, float height, float dpr); 163 void SetContentCssSize(float width, float height, float dpr);
162 164
163 void ContentFrameWasResized(bool width_changed); 165 void ContentFrameWasResized(bool width_changed);
164 166
165 void ForceExitVr(); 167 void ForceExitVr();
166 void ExitPresent(); 168 void ExitPresent();
167 void ExitFullscreen(); 169 void ExitFullscreen();
168 void ExitVrDueToUnsupportedMode(UiUnsupportedMode mode); 170 void ExitVrDueToUnsupportedMode(UiUnsupportedMode mode);
169 171
170 void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent> event); 172 void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent> event);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 std::unique_ptr<VrMetricsHelper> metrics_helper_; 227 std::unique_ptr<VrMetricsHelper> metrics_helper_;
226 228
227 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; 229 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
228 std::unique_ptr<VrGLThread> gl_thread_; 230 std::unique_ptr<VrGLThread> gl_thread_;
229 bool thread_started_ = false; 231 bool thread_started_ = false;
230 bool reprojected_rendering_; 232 bool reprojected_rendering_;
231 233
232 UiInterface* ui_; 234 UiInterface* ui_;
233 std::unique_ptr<ToolbarHelper> toolbar_; 235 std::unique_ptr<ToolbarHelper> toolbar_;
234 236
237 device::mojom::GeolocationManagerPtr geolocation_manager_ptr;
blundell 2017/07/11 09:08:33 naming nit: geolocation_manager_
asimjour1 2017/07/11 15:04:12 Done.
238
235 jobject content_surface_ = nullptr; 239 jobject content_surface_ = nullptr;
236 bool taken_surface_ = false; 240 bool taken_surface_ = false;
237 base::CancelableClosure poll_capturing_media_task_; 241 base::CancelableClosure poll_capturing_media_task_;
238 bool is_capturing_audio_ = false; 242 bool is_capturing_audio_ = false;
239 bool is_capturing_video_ = false; 243 bool is_capturing_video_ = false;
240 bool is_capturing_screen_ = false; 244 bool is_capturing_screen_ = false;
241 bool is_bluetooth_connected_ = false; 245 bool is_bluetooth_connected_ = false;
246 bool high_accuracy_location_ = false;
242 247
243 // Are we currently providing a gamepad factory to the gamepad manager? 248 // Are we currently providing a gamepad factory to the gamepad manager?
244 bool gvr_gamepad_source_active_ = false; 249 bool gvr_gamepad_source_active_ = false;
245 bool cardboard_gamepad_source_active_ = false; 250 bool cardboard_gamepad_source_active_ = false;
246 251
247 // Registered fetchers, must remain alive for UpdateGamepadData calls. 252 // Registered fetchers, must remain alive for UpdateGamepadData calls.
248 // That's ok since the fetcher is only destroyed from VrShell's destructor. 253 // That's ok since the fetcher is only destroyed from VrShell's destructor.
249 device::GvrGamepadDataFetcher* gvr_gamepad_data_fetcher_ = nullptr; 254 device::GvrGamepadDataFetcher* gvr_gamepad_data_fetcher_ = nullptr;
250 device::CardboardGamepadDataFetcher* cardboard_gamepad_data_fetcher_ = 255 device::CardboardGamepadDataFetcher* cardboard_gamepad_data_fetcher_ =
251 nullptr; 256 nullptr;
252 int64_t cardboard_gamepad_timer_ = 0; 257 int64_t cardboard_gamepad_timer_ = 0;
253 258
254 base::WeakPtrFactory<VrShell> weak_ptr_factory_; 259 base::WeakPtrFactory<VrShell> weak_ptr_factory_;
255 260
256 DISALLOW_COPY_AND_ASSIGN(VrShell); 261 DISALLOW_COPY_AND_ASSIGN(VrShell);
257 }; 262 };
258 263
259 bool RegisterVrShell(JNIEnv* env); 264 bool RegisterVrShell(JNIEnv* env);
260 265
261 } // namespace vr_shell 266 } // namespace vr_shell
262 267
263 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ 268 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698