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

Unified Diff: content/public/browser/permission_manager.h

Issue 1316863010: browser: implement multiple permission requesting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@request-multiple-content
Patch Set: Rebase on master Created 5 years, 2 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/public/browser/permission_manager.h
diff --git a/content/public/browser/permission_manager.h b/content/public/browser/permission_manager.h
index 84571ed4d41829cd010081ff0ac0673c1d6e972d..32c8f7fa5109a6c9133a2b95ef2080eac5317fdc 100644
--- a/content/public/browser/permission_manager.h
+++ b/content/public/browser/permission_manager.h
@@ -40,12 +40,28 @@ class CONTENT_EXPORT PermissionManager {
bool user_gesture,
const base::Callback<void(PermissionStatus)>& callback) = 0;
- // Cancels a previously requested permission. The given parameter must match
- // the ones passed to the RequestPermission call.
- virtual void CancelPermissionRequest(PermissionType permission,
- RenderFrameHost* render_frame_host,
- int request_id,
- const GURL& requesting_origin) = 0;
+ // Requests multiple permissions on behalf of a frame identified by
+ // render_frame_host.
+ // When the permission request is handled, whether it failed, timed out or
+ // succeeded, the |callback| will be run. The order of statuses in the
+ // returned vector will correspond to the order of requested permission
+ // types.
+ // Returns a request id which can be used to cancel the request (see
+ // CancelPermissionRequest). This can be kNoPendingOperation if
+ // there is no further need to cancel the permission in which case |callback|
+ // was invoked.
+ virtual int RequestPermissions(
+ const std::vector<PermissionType>& permission,
+ RenderFrameHost* render_frame_host,
+ const GURL& requesting_origin,
+ bool user_gesture,
+ const base::Callback<void(
+ const std::vector<PermissionStatus>&)>& callback) = 0;
+
+ // Cancels a previous permission request specified by |request_id|. Cancelling
+ // an already cancelled request or providing the |request_id|
+ // kNoPendingOperation is a no-op.
+ virtual void CancelPermissionRequest(int request_id) = 0;
// Returns the permission status of a given requesting_origin/embedding_origin
// tuple. This is not taking a RenderFrameHost because the call might happen

Powered by Google App Engine
This is Rietveld 408576698