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

Unified Diff: chrome/browser/android/vr_shell/vr_shell.cc

Issue 2975683002: Add GeolocationManager service (Closed)
Patch Set: typo 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | chrome/browser/vr/ui_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fd602959400e0e4e322236f8768677d7dcc4bc31..87c1c025e95e5205985dc50dd94e14cfe14e5222 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_config.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_config_);
+
+ geolocation_config_->IsHighAccuracyLocationBeingCaptured(
+ base::Bind(&VrShell::SetHighAccuracyLocation, base::Unretained(this)));
bool is_capturing_audio = num_tabs_capturing_audio > 0;
bool is_capturing_video = num_tabs_capturing_video > 0;
@@ -667,6 +676,13 @@ void VrShell::PollMediaAccessFlag() {
}
}
+void VrShell::SetHighAccuracyLocation(bool high_accuracy_location) {
+ if (high_accuracy_location == high_accuracy_location_)
+ return;
+ 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,
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | chrome/browser/vr/ui_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698