Index: chrome/browser/android/vr_shell/vr_shell.cc |
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc |
index 5da786abd0626936ee2b52e51eb13dcd96dc4298..0bbde8ac3df3b9fc8ac6b2f0e9de86b9d0d8f791 100644 |
--- a/chrome/browser/android/vr_shell/vr_shell.cc |
+++ b/chrome/browser/android/vr_shell/vr_shell.cc |
@@ -45,12 +45,15 @@ |
#include "content/public/browser/web_contents.h" |
#include "content/public/common/content_features.h" |
#include "content/public/common/referrer.h" |
+#include "content/public/common/service_manager_connection.h" |
+#include "device/geolocation/public/interfaces/geolocation_manager.mojom.h" |
#include "device/vr/android/gvr/cardboard_gamepad_data_fetcher.h" |
#include "device/vr/android/gvr/gvr_device.h" |
#include "device/vr/android/gvr/gvr_device_provider.h" |
#include "device/vr/android/gvr/gvr_gamepad_data_fetcher.h" |
#include "gpu/command_buffer/common/mailbox.h" |
#include "jni/VrShellImpl_jni.h" |
+#include "services/service_manager/public/cpp/connector.h" |
#include "third_party/WebKit/public/platform/WebInputEvent.h" |
#include "ui/android/view_android.h" |
#include "ui/android/window_android.h" |
@@ -72,7 +75,7 @@ namespace { |
vr_shell::VrShell* g_instance; |
constexpr base::TimeDelta poll_media_access_interval_ = |
- base::TimeDelta::FromSecondsD(0.1); |
+ base::TimeDelta::FromSecondsD(0.2); |
constexpr base::TimeDelta kExitVrDueToUnsupportedModeDelay = |
base::TimeDelta::FromSeconds(5); |
@@ -644,6 +647,12 @@ void VrShell::PollMediaAccessFlag() { |
if (web_contents->IsConnectedToBluetoothDevice()) |
num_tabs_bluetooth_connected++; |
} |
+ auto* connector = |
+ content::ServiceManagerConnection::GetForProcess()->GetConnector(); |
+ connector->BindInterface("content_browser", &geolocation_manager_ptr); |
+ |
+ geolocation_manager_ptr->IsHighAccuracyLocationBeingCaptured(base::Bind( |
+ &VrShell::SetHighAccuracyLocation, weak_ptr_factory_.GetWeakPtr())); |
bool is_capturing_audio = num_tabs_capturing_audio > 0; |
bool is_capturing_video = num_tabs_capturing_video > 0; |
@@ -667,6 +676,12 @@ void VrShell::PollMediaAccessFlag() { |
} |
} |
+void VrShell::SetHighAccuracyLocation(bool high_accuracy_location) { |
+ if (high_accuracy_location != high_accuracy_location_) |
+ ui_->SetLocationAccessIndicator(high_accuracy_location); |
+ high_accuracy_location_ = high_accuracy_location; |
+} |
+ |
void VrShell::SetContentCssSize(float width, float height, float dpr) { |
JNIEnv* env = base::android::AttachCurrentThread(); |
Java_VrShellImpl_setContentCssSize(env, j_vr_shell_.obj(), width, height, |