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

Issue 2612993002: Make geolocation API and X-Geo header access consistent (Closed)

Created:
3 years, 11 months ago by benwells
Modified:
3 years, 11 months ago
Reviewers:
msramek, raymes, gone, sky
CC:
chromium-reviews, mlamouri+watch-permissions_chromium.org, jdonnelly+watch_chromium.org, Michael van Ouwerkerk, mlamouri+watch-geolocation_chromium.org, agrieve+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make geolocation API and X-Geo header access consistent This change allows geolocation access for the default search engine if it would have access to geolocation information via the X-Geo header. To effect this, a new setting is enabled controlling whether the default search engine has geolocation access. This is only used if the search engine supports the X-Geo header, i.e. it is Google. The setting is consulted for the DSE both when deciding if the X-Geo header should be added, and when deciding if geolocation API access should be granted. To allow the UI to make sense and provide the greatest clarity, the setting should always be consistent with the underlying content setting for the DSE's origin. In this end it is initialized accordingly and various checks are in place to keep it consistent. BUG=674389 Review-Url: https://codereview.chromium.org/2612993002 Cr-Commit-Position: refs/heads/master@{#443161} Committed: https://chromium.googlesource.com/chromium/src/+/fd39adcc3b11e8ebe81754de74fc3cd191e44c29

Patch Set 1 #

Patch Set 2 : v2 #

Patch Set 3 : Fix first round of bugs from testing #

Patch Set 4 : Fix some things; rebase #

Total comments: 50

Patch Set 5 : Rebase #

Patch Set 6 : Feedback #

Patch Set 7 : Fix wups #

Total comments: 6

Patch Set 8 : Rebase #

Patch Set 9 : Fix unit tests; feedback #

Patch Set 10 : Hopefully fix tests #

Patch Set 11 : Remove stuff which shouldn't be there #

Total comments: 16

Patch Set 12 : Feedback #

Patch Set 13 : Test shenanigans #

Patch Set 14 : Rebase #

Patch Set 15 : Fix test / merge error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+722 lines, -24 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +10 lines, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +38 lines, -2 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +7 lines, -2 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +27 lines, -0 lines 0 comments Download
M chrome/android/java/strings/android_chrome_strings.grd View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +7 lines, -1 line 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +78 lines, -0 lines 0 comments Download
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/android/preferences/browser_prefs_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/android/preferences/website_preference_bridge.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +31 lines, -0 lines 0 comments Download
M chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.cc View 1 chunk +8 lines, -0 lines 0 comments Download
A chrome/browser/android/search_geolocation/search_geolocation_service.h View 1 2 3 4 5 1 chunk +144 lines, -0 lines 0 comments Download
A chrome/browser/android/search_geolocation/search_geolocation_service.cc View 1 2 3 4 5 6 7 8 1 chunk +283 lines, -0 lines 0 comments Download
M chrome/browser/content_settings/host_content_settings_map_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +39 lines, -3 lines 0 comments Download
M chrome/browser/geolocation/geolocation_permission_context.cc View 1 2 3 4 5 2 chunks +1 line, -15 lines 0 comments Download
M chrome/browser/geolocation/geolocation_permission_context_android.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/geolocation/geolocation_permission_context_android.cc View 1 2 3 4 5 6 7 8 2 chunks +27 lines, -0 lines 0 comments Download
M chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/common/pref_names.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 62 (43 generated)
benwells
Welcome back Raymes ;) Sorry to dump this on you first thing back, I thought ...
3 years, 11 months ago (2017-01-08 21:30:59 UTC) #10
benwells
BTW this change affects the logic, and a little of the UI. The UI stuff ...
3 years, 11 months ago (2017-01-08 21:33:43 UTC) #11
raymes
https://codereview.chromium.org/2612993002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java File chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java (right): https://codereview.chromium.org/2612993002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java#newcode363 chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java:363: return disabled; Hmm, the intended logic here is a ...
3 years, 11 months ago (2017-01-09 05:47:27 UTC) #12
benwells
Now with some tests https://codereview.chromium.org/2612993002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java File chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java (right): https://codereview.chromium.org/2612993002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java#newcode363 chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java:363: return disabled; On 2017/01/09 05:47:26, ...
3 years, 11 months ago (2017-01-09 21:02:22 UTC) #21
raymes
lgtm https://codereview.chromium.org/2612993002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java File chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java (right): https://codereview.chromium.org/2612993002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java#newcode510 chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java:510: mSite.getAddress().getOrigin(), false); On 2017/01/09 21:02:21, benwells wrote: > ...
3 years, 11 months ago (2017-01-10 03:19:33 UTC) #22
raymes
lgtm
3 years, 11 months ago (2017-01-10 03:19:37 UTC) #23
benwells
https://codereview.chromium.org/2612993002/diff/60001/chrome/browser/android/search_geolocation/search_geolocation_service.cc File chrome/browser/android/search_geolocation/search_geolocation_service.cc (right): https://codereview.chromium.org/2612993002/diff/60001/chrome/browser/android/search_geolocation/search_geolocation_service.cc#newcode72 chrome/browser/android/search_geolocation/search_geolocation_service.cc:72: On 2017/01/10 03:19:32, raymes (a bit slow) wrote: > ...
3 years, 11 months ago (2017-01-11 05:35:32 UTC) #32
benwells
+msramek for advice on the failing HostContentSettingsMap test. The test is GuestProfileMigration. This test relies ...
3 years, 11 months ago (2017-01-11 05:37:27 UTC) #34
benwells
+dfalcantara for Java stuff +sky for chrome/browser/geolocation and chrome/browser/profiles Note chrome/browser/geolocation changes are permissions related ...
3 years, 11 months ago (2017-01-11 05:37:53 UTC) #36
raymes
https://codereview.chromium.org/2612993002/diff/200001/chrome/browser/android/search_geolocation/search_geolocation_service.cc File chrome/browser/android/search_geolocation/search_geolocation_service.cc (right): https://codereview.chromium.org/2612993002/diff/200001/chrome/browser/android/search_geolocation/search_geolocation_service.cc#newcode118 chrome/browser/android/search_geolocation/search_geolocation_service.cc:118: GetCurrentContentSetting() == CONTENT_SETTING_ASK) { I'm not sure if the ...
3 years, 11 months ago (2017-01-11 08:30:12 UTC) #37
benwells
https://codereview.chromium.org/2612993002/diff/200001/chrome/browser/android/search_geolocation/search_geolocation_service.cc File chrome/browser/android/search_geolocation/search_geolocation_service.cc (right): https://codereview.chromium.org/2612993002/diff/200001/chrome/browser/android/search_geolocation/search_geolocation_service.cc#newcode118 chrome/browser/android/search_geolocation/search_geolocation_service.cc:118: GetCurrentContentSetting() == CONTENT_SETTING_ASK) { On 2017/01/11 08:30:12, raymes (a ...
3 years, 11 months ago (2017-01-11 09:26:11 UTC) #38
msramek
https://codereview.chromium.org/2612993002/diff/200001/chrome/browser/content_settings/host_content_settings_map_unittest.cc File chrome/browser/content_settings/host_content_settings_map_unittest.cc (right): https://codereview.chromium.org/2612993002/diff/200001/chrome/browser/content_settings/host_content_settings_map_unittest.cc#newcode1258 chrome/browser/content_settings/host_content_settings_map_unittest.cc:1258: TEST_F(HostContentSettingsMapTest, GuestProfile) { The guest profile is Desktop only ...
3 years, 11 months ago (2017-01-11 09:51:10 UTC) #39
sky
LGTM https://codereview.chromium.org/2612993002/diff/200001/chrome/browser/geolocation/geolocation_permission_context_android.h File chrome/browser/geolocation/geolocation_permission_context_android.h (right): https://codereview.chromium.org/2612993002/diff/200001/chrome/browser/geolocation/geolocation_permission_context_android.h#newcode48 chrome/browser/geolocation/geolocation_permission_context_android.h:48: ContentSetting GetPermissionStatusInternal( Add description with where this override ...
3 years, 11 months ago (2017-01-11 15:36:45 UTC) #40
gone
https://codereview.chromium.org/2612993002/diff/200001/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java File chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java (right): https://codereview.chromium.org/2612993002/diff/200001/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java#newcode505 chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java:505: * Returns true if the DSE geolocation setting should ...
3 years, 11 months ago (2017-01-11 18:39:35 UTC) #41
benwells
https://codereview.chromium.org/2612993002/diff/200001/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java File chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java (right): https://codereview.chromium.org/2612993002/diff/200001/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java#newcode505 chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java:505: * Returns true if the DSE geolocation setting should ...
3 years, 11 months ago (2017-01-11 22:29:26 UTC) #42
gone
lgtm for the java stuff
3 years, 11 months ago (2017-01-11 22:31:53 UTC) #43
benwells
https://codereview.chromium.org/2612993002/diff/200001/chrome/browser/content_settings/host_content_settings_map_unittest.cc File chrome/browser/content_settings/host_content_settings_map_unittest.cc (right): https://codereview.chromium.org/2612993002/diff/200001/chrome/browser/content_settings/host_content_settings_map_unittest.cc#newcode1523 chrome/browser/content_settings/host_content_settings_map_unittest.cc:1523: // platform it is created lazily. Note, migration should ...
3 years, 11 months ago (2017-01-12 03:10:43 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2612993002/270001
3 years, 11 months ago (2017-01-12 05:22:01 UTC) #59
commit-bot: I haz the power
3 years, 11 months ago (2017-01-12 05:27:48 UTC) #62
Message was sent while issue was closed.
Committed patchset #15 (id:270001) as
https://chromium.googlesource.com/chromium/src/+/fd39adcc3b11e8ebe81754de74fc...

Powered by Google App Engine
This is Rietveld 408576698