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 "content/public/browser/permission_manager.h"
12 namespace android_webview
{
14 class AwPermissionManager
: public content::PermissionManager
{
16 AwPermissionManager();
17 ~AwPermissionManager() override
;
19 // PermissionManager implementation.
20 void RequestPermission(
21 content::PermissionType permission
,
22 content::WebContents
* web_contents
,
24 const GURL
& requesting_origin
,
26 const base::Callback
<void(content::PermissionStatus
)>& callback
) override
;
27 void CancelPermissionRequest(content::PermissionType permission
,
28 content::WebContents
* web_contents
,
30 const GURL
& requesting_origin
) override
;
31 void ResetPermission(content::PermissionType permission
,
32 const GURL
& requesting_origin
,
33 const GURL
& embedding_origin
) override
;
34 content::PermissionStatus
GetPermissionStatus(
35 content::PermissionType permission
,
36 const GURL
& requesting_origin
,
37 const GURL
& embedding_origin
) override
;
38 void RegisterPermissionUsage(content::PermissionType permission
,
39 const GURL
& requesting_origin
,
40 const GURL
& embedding_origin
) override
;
41 int SubscribePermissionStatusChange(
42 content::PermissionType permission
,
43 const GURL
& requesting_origin
,
44 const GURL
& embedding_origin
,
45 const base::Callback
<void(content::PermissionStatus
)>& callback
) override
;
46 void UnsubscribePermissionStatusChange(int subscription_id
) override
;
49 DISALLOW_COPY_AND_ASSIGN(AwPermissionManager
);
52 } // namespace android_webview
54 #endif // ANDROID_WEBVIEW_BROWSER_AW_PERMISSION_MANAGER_H_