OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BROWSER_PERMISSIONS_PERMISSION_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_IMPL_H_ |
6 #define CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_IMPL_H_ | 6 #define CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_IMPL_H_ |
7 | 7 |
8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 void CancelPendingOperations(); | 33 void CancelPendingOperations(); |
34 | 34 |
35 protected: | 35 protected: |
36 friend PermissionServiceContext; | 36 friend PermissionServiceContext; |
37 | 37 |
38 PermissionServiceImpl(PermissionServiceContext* context, | 38 PermissionServiceImpl(PermissionServiceContext* context, |
39 mojo::InterfaceRequest<PermissionService> request); | 39 mojo::InterfaceRequest<PermissionService> request); |
40 | 40 |
41 private: | 41 private: |
42 using PermissionStatusCallback = mojo::Callback<void(PermissionStatus)>; | 42 using PermissionStatusCallback = mojo::Callback<void(PermissionStatus)>; |
| 43 using PermissionsStatusCallback = |
| 44 mojo::Callback<void(mojo::Array<PermissionStatus>)>; |
43 | 45 |
44 struct PendingRequest { | 46 struct PendingRequest { |
45 PendingRequest(PermissionType permission, const GURL& origin, | 47 PendingRequest(PermissionType permission, const GURL& origin, |
46 const PermissionStatusCallback& callback); | 48 const PermissionStatusCallback& callback); |
47 ~PendingRequest(); | 49 ~PendingRequest(); |
48 | 50 |
49 PermissionType permission; | 51 PermissionType permission; |
50 GURL origin; | 52 GURL origin; |
51 PermissionStatusCallback callback; | 53 PermissionStatusCallback callback; |
52 }; | 54 }; |
(...skipping 13 matching lines...) Expand all Loading... |
66 using SubscriptionsMap = IDMap<PendingSubscription, IDMapOwnPointer>; | 68 using SubscriptionsMap = IDMap<PendingSubscription, IDMapOwnPointer>; |
67 | 69 |
68 // PermissionService. | 70 // PermissionService. |
69 void HasPermission(PermissionName permission, | 71 void HasPermission(PermissionName permission, |
70 const mojo::String& origin, | 72 const mojo::String& origin, |
71 const PermissionStatusCallback& callback) override; | 73 const PermissionStatusCallback& callback) override; |
72 void RequestPermission(PermissionName permission, | 74 void RequestPermission(PermissionName permission, |
73 const mojo::String& origin, | 75 const mojo::String& origin, |
74 bool user_gesture, | 76 bool user_gesture, |
75 const PermissionStatusCallback& callback) override; | 77 const PermissionStatusCallback& callback) override; |
| 78 void RequestPermissions(mojo::Array<PermissionName> permissions, |
| 79 const mojo::String& origin, |
| 80 bool user_gesture, |
| 81 const PermissionsStatusCallback& callback) override; |
76 void RevokePermission(PermissionName permission, | 82 void RevokePermission(PermissionName permission, |
77 const mojo::String& origin, | 83 const mojo::String& origin, |
78 const PermissionStatusCallback& callback) override; | 84 const PermissionStatusCallback& callback) override; |
79 void GetNextPermissionChange( | 85 void GetNextPermissionChange( |
80 PermissionName permission, | 86 PermissionName permission, |
81 const mojo::String& origin, | 87 const mojo::String& origin, |
82 PermissionStatus last_known_status, | 88 PermissionStatus last_known_status, |
83 const PermissionStatusCallback& callback) override; | 89 const PermissionStatusCallback& callback) override; |
84 | 90 |
85 void OnConnectionError(); | 91 void OnConnectionError(); |
(...skipping 15 matching lines...) Expand all Loading... |
101 PermissionServiceContext* context_; | 107 PermissionServiceContext* context_; |
102 mojo::Binding<PermissionService> binding_; | 108 mojo::Binding<PermissionService> binding_; |
103 base::WeakPtrFactory<PermissionServiceImpl> weak_factory_; | 109 base::WeakPtrFactory<PermissionServiceImpl> weak_factory_; |
104 | 110 |
105 DISALLOW_COPY_AND_ASSIGN(PermissionServiceImpl); | 111 DISALLOW_COPY_AND_ASSIGN(PermissionServiceImpl); |
106 }; | 112 }; |
107 | 113 |
108 } // namespace content | 114 } // namespace content |
109 | 115 |
110 #endif // CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_IMPL_H_ | 116 #endif // CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_IMPL_H_ |
OLD | NEW |