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 16 matching lines...) Expand all Loading... | |
27 // When the permission request is handled, whether it failed, timed out or | 27 // When the permission request is handled, whether it failed, timed out or |
28 // succeeded, the |callback| will be run. | 28 // succeeded, the |callback| will be run. |
29 virtual void RequestPermission( | 29 virtual void RequestPermission( |
30 PermissionType permission, | 30 PermissionType permission, |
31 RenderFrameHost* render_frame_host, | 31 RenderFrameHost* render_frame_host, |
32 int request_id, | 32 int request_id, |
33 const GURL& requesting_origin, | 33 const GURL& requesting_origin, |
34 bool user_gesture, | 34 bool user_gesture, |
35 const base::Callback<void(PermissionStatus)>& callback) = 0; | 35 const base::Callback<void(PermissionStatus)>& callback) = 0; |
36 | 36 |
37 using StatusVector = std::vector<PermissionStatus>; | |
38 virtual void RequestPermissions( | |
39 const std::vector<PermissionType>& permission, | |
40 RenderFrameHost* render_frame_host, | |
41 int request_id, | |
42 const GURL& requesting_origin, | |
43 bool user_gesture, | |
44 const base::Callback<void(const StatusVector&)>& callback) = 0; | |
45 | |
37 // Cancels a previously requested permission. The given parameter must match | 46 // Cancels a previously requested permission. The given parameter must match |
38 // the ones passed to the RequestPermission call. | 47 // the ones passed to the RequestPermission call. |
39 virtual void CancelPermissionRequest(PermissionType permission, | 48 virtual void CancelPermissionRequest(PermissionType permission, |
40 RenderFrameHost* render_frame_host, | 49 RenderFrameHost* render_frame_host, |
41 int request_id, | 50 int request_id, |
42 const GURL& requesting_origin) = 0; | 51 const GURL& requesting_origin) = 0; |
43 | 52 |
53 // Cancels a previously requested batch permission request. | |
54 // The given parameters must match the ones passed to the | |
55 // RequestPermission call. | |
56 virtual void CancelPermissionsRequest(RenderFrameHost* render_frame_host, | |
57 int request_id) = 0; | |
mlamouri (slow - plz ping)
2015/08/18 13:37:15
Would it make sense to change CancelPermission to
Lalit Maganti
2015/08/20 14:23:30
In CancelPermission, it is used to retrieve the co
| |
58 | |
44 // Returns the permission status of a given requesting_origin/embedding_origin | 59 // Returns the permission status of a given requesting_origin/embedding_origin |
45 // tuple. This is not taking a RenderFrameHost because the call might happen | 60 // tuple. This is not taking a RenderFrameHost because the call might happen |
46 // outside of a frame context. | 61 // outside of a frame context. |
47 virtual PermissionStatus GetPermissionStatus( | 62 virtual PermissionStatus GetPermissionStatus( |
48 PermissionType permission, | 63 PermissionType permission, |
49 const GURL& requesting_origin, | 64 const GURL& requesting_origin, |
50 const GURL& embedding_origin) = 0; | 65 const GURL& embedding_origin) = 0; |
51 | 66 |
52 // Sets the permission back to its default for the requesting_origin/ | 67 // Sets the permission back to its default for the requesting_origin/ |
53 // embedding_origin tuple. | 68 // embedding_origin tuple. |
(...skipping 18 matching lines...) Expand all Loading... | |
72 | 87 |
73 // Unregisters from permission status change notifications. | 88 // Unregisters from permission status change notifications. |
74 // The |subscription_id| must match the value returned by the | 89 // The |subscription_id| must match the value returned by the |
75 // SubscribePermissionStatusChange call. | 90 // SubscribePermissionStatusChange call. |
76 virtual void UnsubscribePermissionStatusChange(int subscription_id) = 0; | 91 virtual void UnsubscribePermissionStatusChange(int subscription_id) = 0; |
77 }; | 92 }; |
78 | 93 |
79 } // namespace content | 94 } // namespace content |
80 | 95 |
81 #endif // CONTENT_PUBLIC_BROWSER_PERMISSION_MANAGER_H_ | 96 #endif // CONTENT_PUBLIC_BROWSER_PERMISSION_MANAGER_H_ |
OLD | NEW |