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_single_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 PermissionPendingSingleRequest::PermissionPendingSingleRequest( |
| 14 PermissionType permission, |
| 15 const GURL& origin, |
| 16 const PermissionStatusCallback& callback) |
| 17 : callback(callback), |
| 18 permission(permission), |
| 19 origin(origin) { |
| 20 } |
| 21 |
| 22 PermissionPendingSingleRequest::~PermissionPendingSingleRequest() { |
| 23 if (!callback.is_null()) |
| 24 callback.Run(PERMISSION_STATUS_ASK); |
| 25 } |
| 26 |
| 27 void PermissionPendingSingleRequest::Cancel( |
| 28 PermissionManager* permission_manager, |
| 29 RenderFrameHost* context, |
| 30 int request_id) { |
| 31 permission_manager->CancelPermissionRequest(permission, context, |
| 32 request_id, origin); |
| 33 } |
| 34 |
| 35 } // namespace content |
OLD | NEW |