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

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

Issue 1260193009: renderer: implement multiple permission requesting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permissions-request-multiple
Patch Set: Fix review comments 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/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/09/02 11:36:41 Let's drop "Batch" has a name. It's really odd. A
Lalit Maganti 2015/09/02 14:24:51 Done.
+ 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(
mlamouri (slow - plz ping) 2015/09/02 11:36:41 I would tend to say that you can add an 's' here.
Lalit Maganti 2015/09/02 14:24:51 Done.
+ 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

Powered by Google App Engine
This is Rietveld 408576698