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

Unified Diff: android_webview/browser/aw_permission_manager.h

Issue 2143573002: Implement AwPermissionManager::RequestPermissions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reviw #20 Created 4 years, 5 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: android_webview/browser/aw_permission_manager.h
diff --git a/android_webview/browser/aw_permission_manager.h b/android_webview/browser/aw_permission_manager.h
index cfabc5f5494ca30ca70901dda5e1c3febfbbe5e9..3e89a86b44035ae331bdbe054c2e0bf16e956319 100644
--- a/android_webview/browser/aw_permission_manager.h
+++ b/android_webview/browser/aw_permission_manager.h
@@ -15,6 +15,7 @@
namespace android_webview {
+class AwBrowserPermissionRequestDelegate;
class LastRequestResultCache;
class AwPermissionManager : public content::PermissionManager {
@@ -57,10 +58,23 @@ class AwPermissionManager : public content::PermissionManager {
override;
void UnsubscribePermissionStatusChange(int subscription_id) override;
+ protected:
+ void CancelPermissionRequests();
+
private:
- struct PendingRequest;
+ class PendingRequest;
using PendingRequestsMap = IDMap<PendingRequest, IDMapOwnPointer>;
+ bool RequestPermissionInternal(content::PermissionType permission,
+ int request_id);
+ void MayRequestNextPermission(content::PermissionType permission);
+
+ virtual int GetRenderProcessID(content::RenderFrameHost* render_frame_host);
+ virtual int GetRenderFrameID(content::RenderFrameHost* render_frame_host);
+ virtual GURL LastCommittedOrigin(content::RenderFrameHost* render_frame_host);
+ virtual AwBrowserPermissionRequestDelegate* GetDelegate(int render_process_id,
+ int render_frame_id);
+
// The weak pointer to this is used to clean up any information which is
// stored in the pending request or result cache maps. However, the callback
// should be run regardless of whether the class is still alive so the method
@@ -68,7 +82,7 @@ class AwPermissionManager : public content::PermissionManager {
static void OnRequestResponse(
const base::WeakPtr<AwPermissionManager>& manager,
int request_id,
- const base::Callback<void(blink::mojom::PermissionStatus)>& callback,
+ content::PermissionType permission,
bool allowed);
PendingRequestsMap pending_requests_;

Powered by Google App Engine
This is Rietveld 408576698