Index: content/browser/permissions/permission_pending_single_request.cc |
diff --git a/content/browser/permissions/permission_pending_single_request.cc b/content/browser/permissions/permission_pending_single_request.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..db22841aa3eff1a2c854ba3f5614f62906c1279d |
--- /dev/null |
+++ b/content/browser/permissions/permission_pending_single_request.cc |
@@ -0,0 +1,35 @@ |
+// 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_single_request.h" |
+ |
+#include "base/callback.h" |
+#include "content/public/browser/permission_manager.h" |
+#include "content/public/browser/permission_type.h" |
+ |
+namespace content { |
+ |
+PermissionPendingSingleRequest::PermissionPendingSingleRequest( |
+ PermissionType permission, |
+ const GURL& origin, |
+ const PermissionStatusCallback& callback) |
+ : callback(callback), |
+ permission(permission), |
+ origin(origin) { |
+} |
+ |
+PermissionPendingSingleRequest::~PermissionPendingSingleRequest() { |
+ if (!callback.is_null()) |
+ callback.Run(PERMISSION_STATUS_ASK); |
+} |
+ |
+void PermissionPendingSingleRequest::Cancel( |
+ PermissionManager* permission_manager, |
+ RenderFrameHost* context, |
+ int request_id) { |
+ permission_manager->CancelPermissionRequest(permission, context, |
+ request_id, origin); |
+} |
+ |
+} // namespace content |