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

Unified Diff: chrome/browser/geolocation/geolocation_permission_context.cc

Issue 1726323002: Have Permission{Manager,Service} use Origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 9 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/geolocation/geolocation_permission_context.cc
diff --git a/chrome/browser/geolocation/geolocation_permission_context.cc b/chrome/browser/geolocation/geolocation_permission_context.cc
index 10ca37e0f1d046bda4c38e61048a9273e7d7d7f1..d06a2ac1e0d329de4117e6498a072ce1fde3b51d 100644
--- a/chrome/browser/geolocation/geolocation_permission_context.cc
+++ b/chrome/browser/geolocation/geolocation_permission_context.cc
@@ -26,8 +26,8 @@ GeolocationPermissionContext::~GeolocationPermissionContext() {
void GeolocationPermissionContext::DecidePermission(
content::WebContents* web_contents,
const PermissionRequestID& id,
- const GURL& requesting_origin,
- const GURL& embedding_origin,
+ const url::Origin& requesting_origin,
+ const url::Origin& embedding_origin,
const BrowserPermissionCallback& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -39,12 +39,9 @@ void GeolocationPermissionContext::DecidePermission(
if (permission_set) {
ContentSetting content_setting =
new_permission ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK;
- NotifyPermissionSet(id,
- requesting_origin,
- web_contents->GetLastCommittedURL().GetOrigin(),
- callback,
- false /* persist */,
- content_setting);
+ NotifyPermissionSet(id, requesting_origin,
+ url::Origin(web_contents->GetLastCommittedURL()),
+ callback, false /* persist */, content_setting);
}
return;
}
@@ -68,7 +65,7 @@ void GeolocationPermissionContext::CancelPermissionRequest(
void GeolocationPermissionContext::UpdateTabContext(
const PermissionRequestID& id,
- const GURL& requesting_frame,
+ const url::Origin& requesting_frame,
bool allowed) {
TabSpecificContentSettings* content_settings =
TabSpecificContentSettings::GetForFrame(id.render_process_id(),
@@ -76,9 +73,12 @@ void GeolocationPermissionContext::UpdateTabContext(
// WebContents might not exist (extensions) or no longer exist. In which case,
// TabSpecificContentSettings will be null.
+ //
+ // TODO(mkwst): Update TabSpecificContentSettings::OnGeolocationPermissionSet
+ // to use url::Origin. crbug.com/591799
if (content_settings)
content_settings->OnGeolocationPermissionSet(
- requesting_frame.GetOrigin(), allowed);
+ GURL(requesting_frame.Serialize()), allowed);
if (allowed) {
content::GeolocationProvider::GetInstance()

Powered by Google App Engine
This is Rietveld 408576698