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.
5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_PERMISSION_MANAGER_H_
6 #define ANDROID_WEBVIEW_BROWSER_AW_PERMISSION_MANAGER_H_
8 #include "base/callback_forward.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "content/public/browser/permission_manager.h"
13 namespace android_webview
{
15 class LastRequestResultCache
;
17 class AwPermissionManager
: public content::PermissionManager
{
19 AwPermissionManager();
20 ~AwPermissionManager() override
;
22 // PermissionManager implementation.
23 void RequestPermission(
24 content::PermissionType permission
,
25 content::RenderFrameHost
* render_frame_host
,
27 const GURL
& requesting_origin
,
29 const base::Callback
<void(content::PermissionStatus
)>& callback
) override
;
30 void CancelPermissionRequest(content::PermissionType permission
,
31 content::RenderFrameHost
* render_frame_host
,
33 const GURL
& requesting_origin
) override
;
34 void ResetPermission(content::PermissionType permission
,
35 const GURL
& requesting_origin
,
36 const GURL
& embedding_origin
) override
;
37 content::PermissionStatus
GetPermissionStatus(
38 content::PermissionType permission
,
39 const GURL
& requesting_origin
,
40 const GURL
& embedding_origin
) override
;
41 void RegisterPermissionUsage(content::PermissionType permission
,
42 const GURL
& requesting_origin
,
43 const GURL
& embedding_origin
) override
;
44 int SubscribePermissionStatusChange(
45 content::PermissionType permission
,
46 const GURL
& requesting_origin
,
47 const GURL
& embedding_origin
,
48 const base::Callback
<void(content::PermissionStatus
)>& callback
) override
;
49 void UnsubscribePermissionStatusChange(int subscription_id
) override
;
52 scoped_ptr
<LastRequestResultCache
> result_cache_
;
54 DISALLOW_COPY_AND_ASSIGN(AwPermissionManager
);
57 } // namespace android_webview
59 #endif // ANDROID_WEBVIEW_BROWSER_AW_PERMISSION_MANAGER_H_