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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java

Issue 2872653002: Include GPS location as a fallback. Only read it passively. (Closed)
Patch Set: Include GPS location as a fallback. Only read it passively. Created 3 years, 7 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 | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationTracker.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java
index aca80473a283ff7ed2722f59365e0535c641ec8c..6691246d77dd159b3d002b38c374c9fa5fc29bdf 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java
@@ -265,10 +265,14 @@ public class GeolocationHeader {
Location location = null;
long locationAge = Long.MAX_VALUE;
@HeaderState int headerState = geoHeaderStateForUrl(url, isIncognito, true);
+ boolean isXGeoVisibleNetworksEnabled =
+ ChromeFeatureList.isEnabled(ChromeFeatureList.XGEO_VISIBLE_NETWORKS);
if (headerState == HEADER_ENABLED) {
// Only send X-Geo header if there's a fresh location available.
- location =
- GeolocationTracker.getLastKnownLocation(ContextUtils.getApplicationContext());
+ // Use flag controlling visible network changes to decide whether GPS location should be
+ // included as a fallback.
+ location = GeolocationTracker.getLastKnownLocation(
+ ContextUtils.getApplicationContext(), isXGeoVisibleNetworksEnabled);
if (location == null) {
recordHistogram(UMA_LOCATION_NOT_AVAILABLE);
locationAttached = false;
@@ -326,8 +330,6 @@ public class GeolocationHeader {
String locationAsciiEncoding =
new String(Base64.encode(locationAscii.getBytes(), Base64.NO_WRAP));
- boolean isXGeoVisibleNetworksEnabled =
- ChromeFeatureList.isEnabled(ChromeFeatureList.XGEO_VISIBLE_NETWORKS);
if (!isXGeoVisibleNetworksEnabled) {
return XGEO_HEADER_PREFIX + LOCATION_ASCII_PREFIX + locationAsciiEncoding;
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationTracker.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698