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

Unified Diff: content/shell/browser/layout_test/layout_test_permission_manager.cc

Issue 1260193009: renderer: implement multiple permission requesting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permissions-request-multiple
Patch Set: Rebase on top of other change 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/shell/browser/layout_test/layout_test_permission_manager.cc
diff --git a/content/shell/browser/layout_test/layout_test_permission_manager.cc b/content/shell/browser/layout_test/layout_test_permission_manager.cc
index 21300f30e3c44f13d11f453dbe925c573692426e..398f62b0a62b02c70882046a34f295d975765c95 100644
--- a/content/shell/browser/layout_test/layout_test_permission_manager.cc
+++ b/content/shell/browser/layout_test/layout_test_permission_manager.cc
@@ -67,7 +67,7 @@ void LayoutTestPermissionManager::RequestPermission(
int request_id,
const GURL& requesting_origin,
bool user_gesture,
- const base::Callback<void(PermissionStatus)>& callback) {
+ const RequestCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
callback.Run(GetPermissionStatus(
@@ -76,11 +76,29 @@ void LayoutTestPermissionManager::RequestPermission(
->GetLastCommittedURL().GetOrigin()));
}
+void LayoutTestPermissionManager::RequestPermission(
+ const std::vector<PermissionType>& permissions,
+ content::RenderFrameHost* render_frame_host,
+ int request_id,
+ const GURL& requesting_origin,
+ bool user_gesture,
+ const BatchRequestCallback& callback) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ std::vector<PermissionStatus> statuses(permissions.size(),
+ PERMISSION_STATUS_DENIED);
mlamouri (slow - plz ping) 2015/08/21 10:24:41 nit: I would move the two arguments on this second
Lalit Maganti 2015/08/25 16:58:27 Done.
+ for (size_t i = 0; i < permissions.size(); i++) {
+ statuses[i] = GetPermissionStatus(
+ permissions[i], requesting_origin,
+ WebContents::FromRenderFrameHost(render_frame_host)
+ ->GetLastCommittedURL().GetOrigin());
+ }
+ callback.Run(statuses);
+}
+
void LayoutTestPermissionManager::CancelPermissionRequest(
- PermissionType permission,
RenderFrameHost* render_frame_host,
- int request_id,
- const GURL& requesting_origin) {
+ int request_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
}

Powered by Google App Engine
This is Rietveld 408576698