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

Unified Diff: content/browser/permissions/permission_service_impl.h

Issue 1260193009: renderer: implement multiple permission requesting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permissions-request-multiple
Patch Set: Merge patches Created 5 years, 4 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: content/browser/permissions/permission_service_impl.h
diff --git a/content/browser/permissions/permission_service_impl.h b/content/browser/permissions/permission_service_impl.h
index a6d120cd8be515c6dad0afbab3c6510ee53d2a51..ece8e48aa67701151ab7aba62cfeb2a434308cdd 100644
--- a/content/browser/permissions/permission_service_impl.h
+++ b/content/browser/permissions/permission_service_impl.h
@@ -14,6 +14,9 @@
namespace content {
+class PermissionPendingRequest;
+class PermissionPendingSingleRequest;
+class PermissionPendingMultipleRequest;
enum class PermissionType;
// Implements the PermissionService Mojo interface.
@@ -40,17 +43,10 @@ class PermissionServiceImpl : public PermissionService {
private:
using PermissionStatusCallback = mojo::Callback<void(PermissionStatus)>;
+ using PermissionsStatusCallback =
+ mojo::Callback<void(mojo::Array<PermissionStatus>)>;
- struct PendingRequest {
- PendingRequest(PermissionType permission, const GURL& origin,
- const PermissionStatusCallback& callback);
- ~PendingRequest();
-
- PermissionType permission;
- GURL origin;
- PermissionStatusCallback callback;
- };
- using RequestsMap = IDMap<PendingRequest, IDMapOwnPointer>;
+ using RequestsMap = IDMap<PermissionPendingRequest, IDMapOwnPointer>;
struct PendingSubscription {
PendingSubscription(PermissionType permission, const GURL& origin,
@@ -73,6 +69,10 @@ class PermissionServiceImpl : public PermissionService {
const mojo::String& origin,
bool user_gesture,
const PermissionStatusCallback& callback) override;
+ void RequestPermissions(mojo::Array<PermissionName> permissions,
+ const mojo::String& origin,
+ bool user_gesture,
+ const PermissionsStatusCallback& callback) override;
void RevokePermission(PermissionName permission,
const mojo::String& origin,
const PermissionStatusCallback& callback) override;
@@ -84,7 +84,14 @@ class PermissionServiceImpl : public PermissionService {
void OnConnectionError();
- void OnRequestPermissionResponse(int request_id, PermissionStatus status);
+ void OnRequestPermissionResponse(int request_id,
+ PermissionPendingSingleRequest* request,
+ PermissionStatus status);
+
+ void OnRequestPermissionsResponse(
+ int request_id,
+ PermissionPendingMultipleRequest* request,
+ const std::vector<PermissionStatus>& status);
PermissionStatus GetPermissionStatusFromName(PermissionName permission,
const GURL& origin);

Powered by Google App Engine
This is Rietveld 408576698