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

Unified Diff: content/shell/browser/shell_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/shell_permission_manager.cc
diff --git a/content/shell/browser/shell_permission_manager.cc b/content/shell/browser/shell_permission_manager.cc
index fffcfa560c3baf9dd26e7e39c876492fc2650b7e..d78630bbf1b733f3bb525a020eeab8a6ff7f3864 100644
--- a/content/shell/browser/shell_permission_manager.cc
+++ b/content/shell/browser/shell_permission_manager.cc
@@ -22,16 +22,30 @@ void ShellPermissionManager::RequestPermission(
int request_id,
const GURL& requesting_origin,
bool user_gesture,
- const base::Callback<void(PermissionStatus)>& callback) {
+ const RequestCallback& callback) {
callback.Run(permission == PermissionType::GEOLOCATION
? PERMISSION_STATUS_GRANTED : PERMISSION_STATUS_DENIED);
}
+void ShellPermissionManager::RequestPermission(
+ const std::vector<PermissionType>& permissions,
+ content::RenderFrameHost* render_frame_host,
+ int request_id,
+ const GURL& requesting_origin,
+ bool user_gesture,
+ const BatchRequestCallback& callback) {
+ std::vector<PermissionStatus> statuses(permissions.size(),
+ PERMISSION_STATUS_DENIED);
+ for (size_t i = 0; i < permissions.size(); i++) {
+ statuses[i] = permissions[i] == PermissionType::GEOLOCATION
mlamouri (slow - plz ping) 2015/09/02 11:36:42 Same as above.
+ ? PERMISSION_STATUS_GRANTED : PERMISSION_STATUS_DENIED;
+ }
+ callback.Run(statuses);
+}
+
void ShellPermissionManager::CancelPermissionRequest(
- PermissionType permission,
RenderFrameHost* render_frame_host,
- int request_id,
- const GURL& requesting_origin) {
+ int request_id) {
}
void ShellPermissionManager::ResetPermission(

Powered by Google App Engine
This is Rietveld 408576698