Chromium Code Reviews| Index: content/public/browser/permission_manager.h |
| diff --git a/content/public/browser/permission_manager.h b/content/public/browser/permission_manager.h |
| index 5a2e078718dab32004594a0166f442b26335da50..e0eb4a53ecd7f430cc02f7ffaa23ae9d8f6fbd26 100644 |
| --- a/content/public/browser/permission_manager.h |
| +++ b/content/public/browser/permission_manager.h |
| @@ -20,6 +20,9 @@ class RenderFrameHost; |
| class CONTENT_EXPORT PermissionManager { |
| public: |
| virtual ~PermissionManager() = default; |
| + using RequestCallback = base::Callback<void(PermissionStatus)>; |
| + using BatchRequestCallback = |
|
mlamouri (slow - plz ping)
2015/08/21 10:24:41
nit: I'm not sure which one I prefer between Batch
Lalit Maganti
2015/08/21 12:56:00
I really don't like either of them. I'd rather try
|
| + base::Callback<void(const std::vector<PermissionStatus>&)>; |
| // Requests a permission on behalf of a frame identified by render_frame_host. |
| // The |request_id| is an identifier that can later be used if the request is |
| @@ -32,14 +35,26 @@ class CONTENT_EXPORT PermissionManager { |
| int request_id, |
| const GURL& requesting_origin, |
| bool user_gesture, |
| - const base::Callback<void(PermissionStatus)>& callback) = 0; |
| + const RequestCallback& callback) = 0; |
| + |
| + // Requests multiple permissions on behalf of a frame identified by |
| + // render_frame_host. |
| + // The |request_id| is an identifier that can later be used if the request is |
| + // cancelled (see CancelPermissionRequest). |
| + // When the permission request is handled, whether it failed, timed out or |
| + // succeeded, the |callback| will be run. |
| + virtual void RequestPermission( |
| + const std::vector<PermissionType>& permission, |
| + RenderFrameHost* render_frame_host, |
| + int request_id, |
| + const GURL& requesting_origin, |
| + bool user_gesture, |
| + const BatchRequestCallback& 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; |
| + // the ones passed to a RequestPermission call. |
| + virtual void CancelPermissionRequest(RenderFrameHost* render_frame_host, |
| + 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 |