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

Unified Diff: android_webview/browser/aw_permission_manager.cc

Issue 1158813002: Use RenderFrameHost for ::RequestPermission() and ::CancelPermission(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fixes Created 5 years, 7 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 | « android_webview/browser/aw_permission_manager.h ('k') | android_webview/native/aw_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/aw_permission_manager.cc
diff --git a/android_webview/browser/aw_permission_manager.cc b/android_webview/browser/aw_permission_manager.cc
index f57f0b193c7ad2d8ffa40735e27a9f4e0676801c..d99bf2fb2e596c548a9a3da833d85519b71ca2ff 100644
--- a/android_webview/browser/aw_permission_manager.cc
+++ b/android_webview/browser/aw_permission_manager.cc
@@ -12,8 +12,8 @@
#include "base/logging.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/permission_type.h"
+#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
-#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
using content::PermissionStatus;
@@ -168,16 +168,16 @@ AwPermissionManager::~AwPermissionManager() {
void AwPermissionManager::RequestPermission(
PermissionType permission,
- content::WebContents* web_contents,
+ content::RenderFrameHost* render_frame_host,
int request_id,
const GURL& origin,
bool user_gesture,
const base::Callback<void(PermissionStatus)>& callback) {
- int render_process_id = web_contents->GetRenderProcessHost()->GetID();
- int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID();
+ int render_process_id = render_frame_host->GetProcess()->GetID();
+ int render_frame_id = render_frame_host->GetRoutingID();
AwBrowserPermissionRequestDelegate* delegate =
AwBrowserPermissionRequestDelegate::FromID(render_process_id,
- render_view_id);
+ render_frame_id);
if (!delegate) {
DVLOG(0) << "Dropping permission request for "
<< static_cast<int>(permission);
@@ -186,7 +186,8 @@ void AwPermissionManager::RequestPermission(
}
const GURL& embedding_origin =
- web_contents->GetLastCommittedURL().GetOrigin();
+ content::WebContents::FromRenderFrameHost(render_frame_host)
+ ->GetLastCommittedURL().GetOrigin();
switch (permission) {
case PermissionType::GEOLOCATION:
@@ -217,21 +218,22 @@ void AwPermissionManager::RequestPermission(
void AwPermissionManager::CancelPermissionRequest(
PermissionType permission,
- content::WebContents* web_contents,
+ content::RenderFrameHost* render_frame_host,
int request_id,
const GURL& origin) {
// The caller is canceling (presumably) the most recent request. Assuming the
// request did not complete, the user did not respond to the requset.
// Thus, assume we do not know the result.
const GURL& embedding_origin =
- web_contents->GetLastCommittedURL().GetOrigin();
+ content::WebContents::FromRenderFrameHost(render_frame_host)
+ ->GetLastCommittedURL().GetOrigin();
result_cache_->ClearResult(permission, origin, embedding_origin);
- int render_process_id = web_contents->GetRenderProcessHost()->GetID();
- int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID();
+ int render_process_id = render_frame_host->GetProcess()->GetID();
+ int render_frame_id = render_frame_host->GetRoutingID();
AwBrowserPermissionRequestDelegate* delegate =
AwBrowserPermissionRequestDelegate::FromID(render_process_id,
- render_view_id);
+ render_frame_id);
if (!delegate)
return;
« no previous file with comments | « android_webview/browser/aw_permission_manager.h ('k') | android_webview/native/aw_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698