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_service.cc

Issue 2941753002: Reset geolocation permission embargo for an origin when it becomes DSE (Closed)
Patch Set: Feedback Created 3 years, 6 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 | chrome/browser/android/search_geolocation/search_geolocation_service_unittest.cc » ('j') | 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 2515690fa51240c8a20c15afaeef7388f90e0b2a..f4b46d321b213fa25f3755fda20dc2ba5e282c48 100644
--- a/chrome/browser/android/search_geolocation/search_geolocation_service.cc
+++ b/chrome/browser/android/search_geolocation/search_geolocation_service.cc
@@ -9,6 +9,7 @@
#include "base/values.h"
#include "chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
+#include "chrome/browser/permissions/permission_decision_auto_blocker.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
@@ -221,6 +222,9 @@ void SearchGeolocationService::OnDSEChanged() {
PrefValue pref = GetDSEGeolocationPref();
ContentSetting content_setting = GetCurrentContentSetting();
+ // Remove any geolocation embargo on the URL.
+ PermissionDecisionAutoBlocker::GetForProfile(profile_)->RemoveEmbargoByUrl(
+ delegate_->GetDSEOrigin().GetURL(), CONTENT_SETTINGS_TYPE_GEOLOCATION);
if (content_setting == CONTENT_SETTING_BLOCK && pref.setting) {
pref.setting = false;
} else if (content_setting == CONTENT_SETTING_ALLOW && !pref.setting) {
« no previous file with comments | « no previous file | chrome/browser/android/search_geolocation/search_geolocation_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698