Index: content/browser/permissions/permission_pending_multiple_request.cc |
diff --git a/content/browser/permissions/permission_pending_multiple_request.cc b/content/browser/permissions/permission_pending_multiple_request.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..24f26fd40be605c8b31f13732c4747aa539324f2 |
--- /dev/null |
+++ b/content/browser/permissions/permission_pending_multiple_request.cc |
@@ -0,0 +1,38 @@ |
+// 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_multiple_request.h" |
+ |
+#include "base/callback.h" |
+#include "content/public/browser/permission_manager.h" |
+#include "content/public/browser/permission_type.h" |
+ |
+namespace content { |
+ |
+PermissionPendingMultipleRequest::PermissionPendingMultipleRequest( |
+ PermissionsStatusCallback callback, |
+ int request_count) : |
+ callback(callback), |
+ request_count(request_count) { |
+} |
+ |
+PermissionPendingMultipleRequest::~PermissionPendingMultipleRequest() { |
+ if (!callback.is_null()) { |
+ mojo::Array<PermissionStatus> status = |
+ mojo::Array<PermissionStatus>::New(request_count); |
+ for (int i = 0; i < request_count; i++) { |
+ status[i] = PERMISSION_STATUS_ASK; |
+ } |
+ callback.Run(status.Pass()); |
+ } |
+} |
+ |
+void PermissionPendingMultipleRequest::Cancel( |
+ PermissionManager* permission_manager, |
+ RenderFrameHost* context, |
+ int request_id) { |
+ permission_manager->CancelPermissionsRequest(context, request_id); |
+} |
+ |
+} // namespace content |