Chromium Code Reviews| 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 18 matching lines...) Expand all Loading... | |
| 29 // CancelPermissionRequest). This can be kNoPendingRequestOrSubscription if | 29 // CancelPermissionRequest). This can be kNoPendingRequestOrSubscription if |
| 30 // there is no further need to cancel the permission in which case |callback| | 30 // there is no further need to cancel the permission in which case |callback| |
| 31 // was invoked. | 31 // was invoked. |
| 32 virtual int RequestPermission( | 32 virtual int RequestPermission( |
| 33 PermissionType permission, | 33 PermissionType permission, |
| 34 RenderFrameHost* render_frame_host, | 34 RenderFrameHost* render_frame_host, |
| 35 const GURL& requesting_origin, | 35 const GURL& requesting_origin, |
| 36 bool user_gesture, | 36 bool user_gesture, |
| 37 const base::Callback<void(PermissionStatus)>& callback) = 0; | 37 const base::Callback<void(PermissionStatus)>& callback) = 0; |
| 38 | 38 |
| 39 // Requests multiple permissions on behalf of a frame identified by | |
| 40 // render_frame_host. | |
| 41 // When the permission request is handled, whether it failed, timed out or | |
| 42 // succeeded, the |callback| will be run. The order of statuses in the | |
| 43 // returned vector will correspond to the order of requested permission | |
| 44 // types. | |
| 45 // Returns a request id which can be used to cancel the request (see | |
| 46 // CancelPermissionRequest). This can be kNoPendingRequestOrSubscription if | |
| 47 // there is no further need to cancel the permission in which case |callback| | |
| 48 // was invoked. | |
| 49 virtual int RequestPermissions( | |
| 50 const std::vector<PermissionType>& permission, | |
| 51 RenderFrameHost* render_frame_host, | |
| 52 const GURL& requesting_origin, | |
| 53 bool user_gesture, | |
| 54 const base::Callback<void( | |
| 55 const std::vector<PermissionStatus>&)>& callback) = 0; | |
|
michaelbai
2015/09/23 17:51:52
Are you going to combine RequestPermission into Re
Lalit Maganti
2015/09/23 17:57:25
Yes you're right but no we are not going to do thi
| |
| 56 | |
| 39 // Cancels a previous permission request specified by |request_id|. Cancelling | 57 // Cancels a previous permission request specified by |request_id|. Cancelling |
| 40 // an already cancelled request or providing the |request_id| | 58 // an already cancelled request or providing the |request_id| |
| 41 // kNoPendingRequestOrSubscription is a no-op. | 59 // kNoPendingRequestOrSubscription is a no-op. |
| 42 virtual void CancelPermissionRequest(int request_id) = 0; | 60 virtual void CancelPermissionRequest(int request_id) = 0; |
| 43 | 61 |
| 44 // Returns the permission status of a given requesting_origin/embedding_origin | 62 // Returns the permission status of a given requesting_origin/embedding_origin |
| 45 // tuple. This is not taking a RenderFrameHost because the call might happen | 63 // tuple. This is not taking a RenderFrameHost because the call might happen |
| 46 // outside of a frame context. | 64 // outside of a frame context. |
| 47 virtual PermissionStatus GetPermissionStatus( | 65 virtual PermissionStatus GetPermissionStatus( |
| 48 PermissionType permission, | 66 PermissionType permission, |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 79 virtual void UnsubscribePermissionStatusChange(int subscription_id) = 0; | 97 virtual void UnsubscribePermissionStatusChange(int subscription_id) = 0; |
| 80 | 98 |
| 81 // Constant retured when registering and subscribing if | 99 // Constant retured when registering and subscribing if |
| 82 // cancelling/unsubscribing at a later stage would have no effect. | 100 // cancelling/unsubscribing at a later stage would have no effect. |
| 83 static const int kNoPendingRequestOrSubscription = -1; | 101 static const int kNoPendingRequestOrSubscription = -1; |
| 84 }; | 102 }; |
| 85 | 103 |
| 86 } // namespace content | 104 } // namespace content |
| 87 | 105 |
| 88 #endif // CONTENT_PUBLIC_BROWSER_PERMISSION_MANAGER_H_ | 106 #endif // CONTENT_PUBLIC_BROWSER_PERMISSION_MANAGER_H_ |
| OLD | NEW |