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

Unified Diff: chrome/browser/geolocation/geolocation_permission_context_extensions.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_extensions.cc
diff --git a/chrome/browser/geolocation/geolocation_permission_context_extensions.cc b/chrome/browser/geolocation/geolocation_permission_context_extensions.cc
index 12710968680035d4a3980d12a1f86388a48f58cc..253d7cb2d3e2995e08e762527fdfa182ec1757d9 100644
--- a/chrome/browser/geolocation/geolocation_permission_context_extensions.cc
+++ b/chrome/browser/geolocation/geolocation_permission_context_extensions.cc
@@ -15,6 +15,7 @@
#include "extensions/browser/suggest_permission_util.h"
#include "extensions/browser/view_type_utils.h"
#include "extensions/common/extension.h"
+#include "url/origin.h"
using extensions::APIPermission;
using extensions::ExtensionRegistry;
@@ -45,18 +46,18 @@ bool GeolocationPermissionContextExtensions::DecidePermission(
content::WebContents* web_contents,
const PermissionRequestID& request_id,
int bridge_id,
- const GURL& requesting_frame,
+ const url::Origin& requesting_frame,
const base::Callback<void(ContentSetting)>& callback,
bool* permission_set,
bool* new_permission) {
#if defined(ENABLE_EXTENSIONS)
- GURL requesting_frame_origin = requesting_frame.GetOrigin();
+ const GURL requesting_frame_url(requesting_frame.Serialize());
extensions::WebViewPermissionHelper* web_view_permission_helper =
extensions::WebViewPermissionHelper::FromWebContents(web_contents);
if (web_view_permission_helper) {
web_view_permission_helper->RequestGeolocationPermission(
- bridge_id, requesting_frame,
+ bridge_id, requesting_frame_url,
base::Bind(&CallbackContentSettingWrapper, callback));
*permission_set = false;
*new_permission = false;
@@ -67,7 +68,7 @@ bool GeolocationPermissionContextExtensions::DecidePermission(
if (extension_registry) {
const extensions::Extension* extension =
extension_registry->enabled_extensions().GetExtensionOrAppByURL(
- requesting_frame_origin);
+ requesting_frame_url);
if (IsExtensionWithPermissionOrSuggestInConsole(
APIPermission::kGeolocation, extension,
web_contents->GetMainFrame())) {

Powered by Google App Engine
This is Rietveld 408576698