1 // Copyright 2014 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.
5 #ifndef ANDROID_WEBVIEW_NATIVE_PERMISSION_SIMPLE_PERMISSION_REQUEST_H
6 #define ANDROID_WEBVIEW_NATIVE_PERMISSION_SIMPLE_PERMISSION_REQUEST_H
8 #include "android_webview/native/permission/aw_permission_request_delegate.h"
9 #include "base/callback.h"
11 namespace android_webview
{
13 // The class is used to handle the simple permission request which just needs
14 // a callback with bool parameter to indicate the permission granted or not.
15 class SimplePermissionRequest
: public AwPermissionRequestDelegate
{
17 SimplePermissionRequest(const GURL
& origin
,
19 const base::Callback
<void(bool)>& callback
);
20 ~SimplePermissionRequest() override
;
22 // AwPermissionRequestDelegate implementation.
23 const GURL
& GetOrigin() override
;
24 int64
GetResources() override
;
25 void NotifyRequestResult(bool allowed
) override
;
30 const base::Callback
<void(bool)> callback_
;
32 DISALLOW_COPY_AND_ASSIGN(SimplePermissionRequest
);
35 } // namespace android_webview
37 #endif // ANDROID_WEBVIEW_NATIVE_PERMISSION_PROTECTED_MEDIA_ID_PERMISSION_REQUEST_H