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

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

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/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 e354f7b700e33da8ca06c6c1fafdba0363b2f31b..fbd2e6e8118c502b75422f3d77328edea24333b7 100644
--- a/content/shell/browser/layout_test/layout_test_permission_manager.cc
+++ b/content/shell/browser/layout_test/layout_test_permission_manager.cc
@@ -76,11 +76,28 @@ int LayoutTestPermissionManager::RequestPermission(
return kNoPendingOperation;
}
-void LayoutTestPermissionManager::CancelPermissionRequest(
- PermissionType permission,
- RenderFrameHost* render_frame_host,
- int request_id,
- const GURL& requesting_origin) {
+int LayoutTestPermissionManager::RequestPermissions(
+ const std::vector<PermissionType>& permissions,
+ content::RenderFrameHost* render_frame_host,
+ const GURL& requesting_origin,
+ bool user_gesture,
+ const base::Callback<void(
+ const std::vector<PermissionStatus>&)>& callback) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ const GURL& embedding_origin =
+ WebContents::FromRenderFrameHost(render_frame_host)
+ ->GetLastCommittedURL().GetOrigin();
+ std::vector<PermissionStatus> result;
+ for (const auto& permission : permissions) {
+ result.push_back(GetPermissionStatus(
+ permission, requesting_origin, embedding_origin));
+ }
+ callback.Run(result);
+ return kNoPendingOperation;
+}
+
+void LayoutTestPermissionManager::CancelPermissionRequest(int request_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
« no previous file with comments | « content/shell/browser/layout_test/layout_test_permission_manager.h ('k') | content/shell/browser/shell_permission_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698