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

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

Issue 2718313003: Add switch to disable showing the search geolocation disclosure UI. (Closed)
Patch Set: Created 3 years, 10 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
Index: chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.cc
diff --git a/chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.cc b/chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.cc
index a45af0d7dfdc96024ee4ba41e7dabd2427a10549..91cd69c0889143249a62735c6e7f3b5205a2f011 100644
--- a/chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.cc
+++ b/chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.cc
@@ -6,6 +6,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
+#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
@@ -16,6 +17,7 @@
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_features.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings.h"
@@ -70,8 +72,10 @@ DEFINE_WEB_CONTENTS_USER_DATA_KEY(SearchGeolocationDisclosureTabHelper);
SearchGeolocationDisclosureTabHelper::SearchGeolocationDisclosureTabHelper(
content::WebContents* contents)
: content::WebContentsObserver(contents) {
- consistent_geolocation_enabled_ =
- base::FeatureList::IsEnabled(features::kConsistentOmniboxGeolocation);
+ consistent_geolocation_disclosure_enabled_ =
+ base::FeatureList::IsEnabled(features::kConsistentOmniboxGeolocation) &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableSearchGeolocationDisclosure);
}
SearchGeolocationDisclosureTabHelper::~SearchGeolocationDisclosureTabHelper() {}
@@ -83,7 +87,7 @@ void SearchGeolocationDisclosureTabHelper::NavigationEntryCommitted(
void SearchGeolocationDisclosureTabHelper::MaybeShowDisclosure(
const GURL& gurl) {
- if (!consistent_geolocation_enabled_)
+ if (!consistent_geolocation_disclosure_enabled_)
return;
if (!ShouldShowDisclosureForUrl(gurl))
« no previous file with comments | « chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698