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

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: 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/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..42c82c98e1e785e576bc8a49befeac8c75bbf36f 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) {
mlamouri (slow - plz ping) 2015/09/02 11:36:42 nit: keep the plain callback type.
Lalit Maganti 2015/09/02 14:24:51 Done.
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(
mlamouri (slow - plz ping) 2015/09/02 11:36:42 nit: if you want, you can rename statuses to resul
Lalit Maganti 2015/09/02 14:24:51 Done.
+ permissions.size(), PERMISSION_STATUS_DENIED);
+ for (size_t i = 0; i < permissions.size(); i++) {
mlamouri (slow - plz ping) 2015/09/02 11:36:42 nit: you can probably do something among those lin
+ 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