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

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

Issue 2661303003: Improve performance of search geolocation disclosure check. (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/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 43745792a37222d37066afc052d1dab92539d5ae..234628461110657fefbc6d6f84580b20cba66fa8 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
@@ -87,11 +87,6 @@ void SearchGeolocationDisclosureTabHelper::MaybeShowDisclosure(
if (!ShouldShowDisclosureForUrl(gurl))
return;
- // Check that the Chrome app has geolocation permission.
- JNIEnv* env = base::android::AttachCurrentThread();
- if (!Java_GeolocationHeader_hasGeolocationPermission(env))
- return;
-
// Don't show the infobar if the user has dismissed it, or they've seen it
// enough times already.
PrefService* prefs = GetProfile()->GetPrefs();
@@ -116,6 +111,11 @@ void SearchGeolocationDisclosureTabHelper::MaybeShowDisclosure(
return;
}
+ // Check that the Chrome app has geolocation permission.
+ JNIEnv* env = base::android::AttachCurrentThread();
+ if (!Java_GeolocationHeader_hasGeolocationPermission(env))
+ return;
raymes 2017/02/01 18:04:41 As discussed in person, we may want to move this r
+
// Record metrics for the state of permissions before the disclosure has been
// shown.
RecordPreDisclosureMetrics(gurl);
« 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