| 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 CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ |
| 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 override; | 68 override; |
| 69 void UnsubscribePermissionStatusChange(int subscription_id) override; | 69 void UnsubscribePermissionStatusChange(int subscription_id) override; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 friend class GeolocationPermissionContextTests; | 72 friend class GeolocationPermissionContextTests; |
| 73 // TODO(raymes): Refactor MediaPermission to not call GetPermissionContext. | 73 // TODO(raymes): Refactor MediaPermission to not call GetPermissionContext. |
| 74 // See crbug.com/596786. | 74 // See crbug.com/596786. |
| 75 friend class MediaPermission; | 75 friend class MediaPermission; |
| 76 | 76 |
| 77 class PendingRequest; | 77 class PendingRequest; |
| 78 using PendingRequestsMap = IDMap<PendingRequest, IDMapOwnPointer>; | 78 using PendingRequestsMap = IDMap<std::unique_ptr<PendingRequest>>; |
| 79 | 79 |
| 80 struct Subscription; | 80 struct Subscription; |
| 81 using SubscriptionsMap = IDMap<Subscription, IDMapOwnPointer>; | 81 using SubscriptionsMap = IDMap<std::unique_ptr<Subscription>>; |
| 82 | 82 |
| 83 PermissionContextBase* GetPermissionContext(content::PermissionType type); | 83 PermissionContextBase* GetPermissionContext(content::PermissionType type); |
| 84 | 84 |
| 85 // Called when a permission was decided for a given PendingRequest. The | 85 // Called when a permission was decided for a given PendingRequest. The |
| 86 // PendingRequest is identified by its |request_id| and the permission is | 86 // PendingRequest is identified by its |request_id| and the permission is |
| 87 // identified by its |permission_id|. If the PendingRequest contains more than | 87 // identified by its |permission_id|. If the PendingRequest contains more than |
| 88 // one permission, it will wait for the remaining permissions to be resolved. | 88 // one permission, it will wait for the remaining permissions to be resolved. |
| 89 // When all the permissions have been resolved, the PendingRequest's callback | 89 // When all the permissions have been resolved, the PendingRequest's callback |
| 90 // is run. | 90 // is run. |
| 91 void OnPermissionsRequestResponseStatus( | 91 void OnPermissionsRequestResponseStatus( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 107 std::unique_ptr<PermissionContextBase>, | 107 std::unique_ptr<PermissionContextBase>, |
| 108 PermissionTypeHash> | 108 PermissionTypeHash> |
| 109 permission_contexts_; | 109 permission_contexts_; |
| 110 | 110 |
| 111 base::WeakPtrFactory<PermissionManager> weak_ptr_factory_; | 111 base::WeakPtrFactory<PermissionManager> weak_ptr_factory_; |
| 112 | 112 |
| 113 DISALLOW_COPY_AND_ASSIGN(PermissionManager); | 113 DISALLOW_COPY_AND_ASSIGN(PermissionManager); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ | 116 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ |
| OLD | NEW |