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 CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ |
6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 // Resets the permission to its default value. | 101 // Resets the permission to its default value. |
102 virtual void ResetPermission(const GURL& requesting_origin, | 102 virtual void ResetPermission(const GURL& requesting_origin, |
103 const GURL& embedding_origin); | 103 const GURL& embedding_origin); |
104 | 104 |
105 // Withdraw an existing permission request, no op if the permission request | 105 // Withdraw an existing permission request, no op if the permission request |
106 // was already cancelled by some other means. | 106 // was already cancelled by some other means. |
107 virtual void CancelPermissionRequest(content::WebContents* web_contents, | 107 virtual void CancelPermissionRequest(content::WebContents* web_contents, |
108 const PermissionRequestID& id); | 108 const PermissionRequestID& id); |
109 | 109 |
| 110 // Returns true if the feature is allowed to be used in workers. Most features |
| 111 // are not allowed to be used in workers. |
| 112 virtual bool IsAllowedInWorkers() const; |
| 113 |
110 // Whether the kill switch has been enabled for this permission. | 114 // Whether the kill switch has been enabled for this permission. |
111 // public for permissions that do not use RequestPermission, like | 115 // public for permissions that do not use RequestPermission, like |
112 // camera and microphone, and for testing. | 116 // camera and microphone, and for testing. |
113 bool IsPermissionKillSwitchOn() const; | 117 bool IsPermissionKillSwitchOn() const; |
114 | 118 |
115 protected: | 119 protected: |
116 virtual ContentSetting GetPermissionStatusInternal( | 120 virtual ContentSetting GetPermissionStatusInternal( |
117 content::RenderFrameHost* render_frame_host, | 121 content::RenderFrameHost* render_frame_host, |
118 const GURL& requesting_origin, | 122 const GURL& requesting_origin, |
119 const GURL& embedding_origin) const; | 123 const GURL& embedding_origin) const; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 #endif | 213 #endif |
210 std::unordered_map<std::string, std::unique_ptr<PermissionRequest>> | 214 std::unordered_map<std::string, std::unique_ptr<PermissionRequest>> |
211 pending_requests_; | 215 pending_requests_; |
212 | 216 |
213 // Must be the last member, to ensure that it will be | 217 // Must be the last member, to ensure that it will be |
214 // destroyed first, which will invalidate weak pointers | 218 // destroyed first, which will invalidate weak pointers |
215 base::WeakPtrFactory<PermissionContextBase> weak_factory_; | 219 base::WeakPtrFactory<PermissionContextBase> weak_factory_; |
216 }; | 220 }; |
217 | 221 |
218 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ | 222 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ |
OLD | NEW |