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 "third_party/WebKit/public/platform/modules/permissions/permission_stat
us.mojom.h" | 9 #include "third_party/WebKit/public/platform/modules/permissions/permission_stat
us.mojom.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 // When the permission request is handled, whether it failed, timed out or | 30 // When the permission request is handled, whether it failed, timed out or |
31 // succeeded, the |callback| will be run. | 31 // succeeded, the |callback| will be run. |
32 // Returns a request id which can be used to cancel the permission (see | 32 // Returns a request id which can be used to cancel the permission (see |
33 // CancelPermissionRequest). This can be kNoPendingOperation if | 33 // CancelPermissionRequest). This can be kNoPendingOperation if |
34 // there is no further need to cancel the permission in which case |callback| | 34 // there is no further need to cancel the permission in which case |callback| |
35 // was invoked. | 35 // was invoked. |
36 virtual int RequestPermission( | 36 virtual int RequestPermission( |
37 PermissionType permission, | 37 PermissionType permission, |
38 RenderFrameHost* render_frame_host, | 38 RenderFrameHost* render_frame_host, |
39 const GURL& requesting_origin, | 39 const GURL& requesting_origin, |
| 40 bool user_gesture, |
40 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) = 0; | 41 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) = 0; |
41 | 42 |
42 // Requests multiple permissions on behalf of a frame identified by | 43 // Requests multiple permissions on behalf of a frame identified by |
43 // render_frame_host. | 44 // render_frame_host. |
44 // When the permission request is handled, whether it failed, timed out or | 45 // When the permission request is handled, whether it failed, timed out or |
45 // succeeded, the |callback| will be run. The order of statuses in the | 46 // succeeded, the |callback| will be run. The order of statuses in the |
46 // returned vector will correspond to the order of requested permission | 47 // returned vector will correspond to the order of requested permission |
47 // types. | 48 // types. |
48 // Returns a request id which can be used to cancel the request (see | 49 // Returns a request id which can be used to cancel the request (see |
49 // CancelPermissionRequest). This can be kNoPendingOperation if | 50 // CancelPermissionRequest). This can be kNoPendingOperation if |
50 // there is no further need to cancel the permission in which case |callback| | 51 // there is no further need to cancel the permission in which case |callback| |
51 // was invoked. | 52 // was invoked. |
52 virtual int RequestPermissions( | 53 virtual int RequestPermissions( |
53 const std::vector<PermissionType>& permission, | 54 const std::vector<PermissionType>& permission, |
54 RenderFrameHost* render_frame_host, | 55 RenderFrameHost* render_frame_host, |
55 const GURL& requesting_origin, | 56 const GURL& requesting_origin, |
| 57 bool user_gesture, |
56 const base::Callback<void( | 58 const base::Callback<void( |
57 const std::vector<blink::mojom::PermissionStatus>&)>& callback) = 0; | 59 const std::vector<blink::mojom::PermissionStatus>&)>& callback) = 0; |
58 | 60 |
59 // Cancels a previous permission request specified by |request_id|. Cancelling | 61 // Cancels a previous permission request specified by |request_id|. Cancelling |
60 // an already cancelled request or providing the |request_id| | 62 // an already cancelled request or providing the |request_id| |
61 // kNoPendingOperation is a no-op. | 63 // kNoPendingOperation is a no-op. |
62 virtual void CancelPermissionRequest(int request_id) = 0; | 64 virtual void CancelPermissionRequest(int request_id) = 0; |
63 | 65 |
64 // Returns the permission status of a given requesting_origin/embedding_origin | 66 // Returns the permission status of a given requesting_origin/embedding_origin |
65 // tuple. This is not taking a RenderFrameHost because the call might happen | 67 // tuple. This is not taking a RenderFrameHost because the call might happen |
(...skipping 29 matching lines...) Expand all Loading... |
95 // The |subscription_id| must match the value returned by the | 97 // The |subscription_id| must match the value returned by the |
96 // SubscribePermissionStatusChange call. Unsubscribing | 98 // SubscribePermissionStatusChange call. Unsubscribing |
97 // an already unsubscribed |subscription_id| or providing the | 99 // an already unsubscribed |subscription_id| or providing the |
98 // |subscription_id| kNoPendingOperation is a no-op. | 100 // |subscription_id| kNoPendingOperation is a no-op. |
99 virtual void UnsubscribePermissionStatusChange(int subscription_id) = 0; | 101 virtual void UnsubscribePermissionStatusChange(int subscription_id) = 0; |
100 }; | 102 }; |
101 | 103 |
102 } // namespace content | 104 } // namespace content |
103 | 105 |
104 #endif // CONTENT_PUBLIC_BROWSER_PERMISSION_MANAGER_H_ | 106 #endif // CONTENT_PUBLIC_BROWSER_PERMISSION_MANAGER_H_ |
OLD | NEW |