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

Unified Diff: chrome/browser/guest_view/web_view/chrome_web_view_permission_helper_delegate.cc

Issue 459953002: Migrate geolocation permissions to the new common permission class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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/guest_view/web_view/chrome_web_view_permission_helper_delegate.cc
diff --git a/chrome/browser/guest_view/web_view/chrome_web_view_permission_helper_delegate.cc b/chrome/browser/guest_view/web_view/chrome_web_view_permission_helper_delegate.cc
index f33f9dbb7a4e405bd671a0ed150238156160c639..71c33fa6dcb2f9524f5c19a5fe88fc9c27266d29 100644
--- a/chrome/browser/guest_view/web_view/chrome_web_view_permission_helper_delegate.cc
+++ b/chrome/browser/guest_view/web_view/chrome_web_view_permission_helper_delegate.cc
@@ -10,6 +10,9 @@
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/render_messages.h"
+#include "components/content_settings/core/common/permission_request_id.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/render_view_host.h"
#include "content/public/browser/user_metrics.h"
#include "extensions/browser/guest_view/web_view/web_view_constants.h"
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
@@ -216,20 +219,31 @@ void ChromeWebViewPermissionHelperDelegate::OnGeolocationPermissionResponse(
return;
}
+ content::WebContents* web_contents =
+ web_view_guest()->embedder_web_contents();
+ int render_process_id = web_contents->GetRenderProcessHost()->GetID();
+ int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID();
+
+ const PermissionRequestID request_id(
+ render_process_id,
+ render_view_id,
+ // The geolocation permission request here is not initiated
+ // through WebGeolocationPermissionRequest. We are only interested
+ // in the fact whether the embedder/app has geolocation
+ // permission. Therefore we use an invalid |bridge_id|.
+ -1,
+ GURL());
+
Profile* profile = Profile::FromBrowserContext(
web_view_guest()->browser_context());
GeolocationPermissionContextFactory::GetForProfile(profile)->
- RequestGeolocationPermission(
- web_view_guest()->embedder_web_contents(),
- // The geolocation permission request here is not initiated
- // through WebGeolocationPermissionRequest. We are only interested
- // in the fact whether the embedder/app has geolocation
- // permission. Therefore we use an invalid |bridge_id|.
- -1,
- web_view_guest()->embedder_web_contents()->GetLastCommittedURL(),
+ RequestPermission(
+ web_contents,
+ request_id,
+ web_view_guest()->embedder_web_contents()
+ ->GetLastCommittedURL().GetOrigin(),
user_gesture,
- callback,
- NULL);
+ callback);
}
void ChromeWebViewPermissionHelperDelegate::CancelGeolocationPermissionRequest(

Powered by Google App Engine
This is Rietveld 408576698