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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java

Issue 2629523003: Update Search Engines settings UI for new search geolocation system. (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | 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/preferences/SearchEngineAdapter.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java
index 8320f81b07be97e7b8e2bb85c05f10ba8b9f4a69..288b6f6616d4c28d859211b710c285a5a1d7b39f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java
@@ -28,6 +28,7 @@ import org.chromium.base.ContextUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.locale.LocaleManager;
import org.chromium.chrome.browser.omnibox.geo.GeolocationHeader;
import org.chromium.chrome.browser.preferences.website.ContentSetting;
@@ -360,8 +361,16 @@ public class SearchEngineAdapter extends BaseAdapter implements LoadListener, On
ContentSetting locationPermission = locationSettings.getContentSetting();
if (locationPermission == ContentSetting.ASK) {
// Handle the case where the geoHeader being sent when no permission has been specified.
- if (checkGeoHeader && GeolocationHeader.isGeoHeaderEnabledForUrl(url, false)) {
- locationPermission = ContentSetting.ALLOW;
+ if (checkGeoHeader) {
+ if (ChromeFeatureList.isEnabled(ChromeFeatureList.CONSISTENT_OMNIBOX_GEOLOCATION)) {
+ if (WebsitePreferenceBridge.shouldUseDSEGeolocationSetting(url, false)) {
+ locationPermission = WebsitePreferenceBridge.getDSEGeolocationSetting()
+ ? ContentSetting.ALLOW
+ : ContentSetting.BLOCK;
+ }
+ } else if (GeolocationHeader.isGeoHeaderEnabledForUrl(url, false)) {
+ locationPermission = ContentSetting.ALLOW;
+ }
}
}
return locationPermission;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698