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

Unified Diff: content/browser/permissions/permission_pending_request.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/browser/permissions/permission_pending_request.cc
diff --git a/content/browser/permissions/permission_pending_request.cc b/content/browser/permissions/permission_pending_request.cc
new file mode 100644
index 0000000000000000000000000000000000000000..329b7d84a5e88756cd5dac955c020c390761faee
--- /dev/null
+++ b/content/browser/permissions/permission_pending_request.cc
@@ -0,0 +1,30 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/permissions/permission_pending_request.h"
+
+#include "base/callback.h"
+#include "content/public/browser/permission_manager.h"
+#include "content/public/browser/permission_type.h"
+
+namespace content {
+
+PermissionPendingRequest::PermissionPendingRequest(
+ PermissionRequestCallback callback,
+ int request_count) :
mlamouri (slow - plz ping) 2015/09/02 11:36:41 style: I think ':' should be on the next line
Lalit Maganti 2015/09/02 14:24:50 Done.
+ callback_(callback),
+ request_count_(request_count) {
+}
+
+PermissionPendingRequest::~PermissionPendingRequest() {
+ if (!callback_.is_null()) {
+ mojo::Array<PermissionStatus> statuses =
+ mojo::Array<PermissionStatus>::New(request_count_);
+ for (int i = 0; i < request_count_; ++i)
+ statuses[i] = PERMISSION_STATUS_DENIED;
+ callback_.Run(statuses.Pass());
+ }
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698