OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/permissions/permission_pending_multiple_request.h" |
| 6 |
| 7 #include "base/callback.h" |
| 8 #include "content/public/browser/permission_manager.h" |
| 9 #include "content/public/browser/permission_type.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 PermissionPendingMultipleRequest::PermissionPendingMultipleRequest( |
| 14 PermissionsStatusCallback callback, |
| 15 int request_count) : |
| 16 callback(callback), |
| 17 request_count(request_count) { |
| 18 } |
| 19 |
| 20 PermissionPendingMultipleRequest::~PermissionPendingMultipleRequest() { |
| 21 if (!callback.is_null()) { |
| 22 mojo::Array<PermissionStatus> status = |
| 23 mojo::Array<PermissionStatus>::New(request_count); |
| 24 for (int i = 0; i < request_count; i++) { |
| 25 status[i] = PERMISSION_STATUS_ASK; |
| 26 } |
| 27 callback.Run(status.Pass()); |
| 28 } |
| 29 } |
| 30 |
| 31 void PermissionPendingMultipleRequest::Cancel( |
| 32 PermissionManager* permission_manager, |
| 33 RenderFrameHost* context, |
| 34 int request_id) { |
| 35 permission_manager->CancelPermissionsRequest(context, request_id); |
| 36 } |
| 37 |
| 38 } // namespace content |
OLD | NEW |