OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_BROWSER_PERMISSION_MANAGER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_PERMISSION_MANAGER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_PERMISSION_MANAGER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_PERMISSION_MANAGER_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "content/public/common/permission_status.mojom.h" | 9 #include "content/public/common/permission_status.mojom.h" |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 const GURL& requesting_origin, | 36 const GURL& requesting_origin, |
37 const GURL& embedding_origin) = 0; | 37 const GURL& embedding_origin) = 0; |
38 | 38 |
39 virtual void ResetPermission(PermissionType permission, | 39 virtual void ResetPermission(PermissionType permission, |
40 const GURL& requesting_origin, | 40 const GURL& requesting_origin, |
41 const GURL& embedding_origin) = 0; | 41 const GURL& embedding_origin) = 0; |
42 | 42 |
43 virtual void RegisterPermissionUsage(PermissionType permission, | 43 virtual void RegisterPermissionUsage(PermissionType permission, |
44 const GURL& requesting_origin, | 44 const GURL& requesting_origin, |
45 const GURL& embedding_origin) = 0; | 45 const GURL& embedding_origin) = 0; |
| 46 |
| 47 // Runs the given |callback| whenever the |permission| associated with the |
| 48 // pair { requesting_origin, embedding_origin } changes. |
| 49 // Returns the subscription_id to be used to unsubscribe. |
| 50 virtual int SubscribePermissionStatusChange( |
| 51 PermissionType permission, |
| 52 const GURL& requesting_origin, |
| 53 const GURL& embedding_origin, |
| 54 const base::Callback<void(PermissionStatus)>& callback) = 0; |
| 55 |
| 56 virtual void UnsubscribePermissionStatusChange(int subscription_id) = 0; |
46 }; | 57 }; |
47 | 58 |
48 } // namespace content | 59 } // namespace content |
49 | 60 |
50 #endif // CONTENT_PUBLIC_BROWSER_PERMISSION_MANAGER_H_ | 61 #endif // CONTENT_PUBLIC_BROWSER_PERMISSION_MANAGER_H_ |
OLD | NEW |