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

Unified Diff: chrome/browser/android/search_geolocation/search_geolocation_service.cc

Issue 2853763005: Don't enable the DSE geolocation setting until EULA accepted (Closed)
Patch Set: Created 3 years, 8 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/android/javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/search_geolocation/search_geolocation_service.cc
diff --git a/chrome/browser/android/search_geolocation/search_geolocation_service.cc b/chrome/browser/android/search_geolocation/search_geolocation_service.cc
index 7977997bc388d14e5911407c73c86ad6cbbe28a9..fa0564c6c206af1387d52b4916af5c8cf5b60cca 100644
--- a/chrome/browser/android/search_geolocation/search_geolocation_service.cc
+++ b/chrome/browser/android/search_geolocation/search_geolocation_service.cc
@@ -8,6 +8,7 @@
#include "base/feature_list.h"
#include "base/values.h"
#include "chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
@@ -23,6 +24,7 @@
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.h"
#include "components/search_engines/template_url_service_observer.h"
+#include "components/web_resource/web_resource_pref_names.h"
#include "url/gurl.h"
#include "url/url_constants.h"
@@ -158,6 +160,15 @@ bool SearchGeolocationService::UseDSEGeolocationSetting(
if (!UseConsistentSearchGeolocation())
return false;
+ // Don't use the DSE setting until the EULA has been acceptd. This prevents
+ // the disclosure being shown on the privacy policy before accepting the UELA,
+ // and would also stop the privacy policy ever getting geolocation access by
+ // default.
+ if (g_browser_process && g_browser_process->local_state() &&
+ !g_browser_process->local_state()->GetBoolean(prefs::kEulaAccepted)) {
+ return false;
+ }
+
if (requesting_origin.scheme() != url::kHttpsScheme)
return false;
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698