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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // was already cancelled by some other means. | 108 // was already cancelled by some other means. |
109 virtual void CancelPermissionRequest(content::WebContents* web_contents, | 109 virtual void CancelPermissionRequest(content::WebContents* web_contents, |
110 const PermissionRequestID& id); | 110 const PermissionRequestID& id); |
111 | 111 |
112 // Whether the kill switch has been enabled for this permission. | 112 // Whether the kill switch has been enabled for this permission. |
113 // public for permissions that do not use RequestPermission, like | 113 // public for permissions that do not use RequestPermission, like |
114 // camera and microphone, and for testing. | 114 // camera and microphone, and for testing. |
115 bool IsPermissionKillSwitchOn() const; | 115 bool IsPermissionKillSwitchOn() const; |
116 | 116 |
117 protected: | 117 protected: |
118 virtual ContentSetting GetPermissionStatusInternal( | 118 virtual PermissionResult GetPermissionStatusInternal( |
119 content::RenderFrameHost* render_frame_host, | 119 content::RenderFrameHost* render_frame_host, |
120 const GURL& requesting_origin, | 120 const GURL& requesting_origin, |
121 const GURL& embedding_origin) const; | 121 const GURL& embedding_origin) const; |
122 | 122 |
123 // Decide whether the permission should be granted. | 123 // Decide whether the permission should be granted. |
124 // Calls PermissionDecided if permission can be decided non-interactively, | 124 // Calls PermissionDecided if permission can be decided non-interactively, |
125 // or NotifyPermissionSet if permission decided by presenting an infobar. | 125 // or NotifyPermissionSet if permission decided by presenting an infobar. |
126 virtual void DecidePermission(content::WebContents* web_contents, | 126 virtual void DecidePermission(content::WebContents* web_contents, |
127 const PermissionRequestID& id, | 127 const PermissionRequestID& id, |
128 const GURL& requesting_origin, | 128 const GURL& requesting_origin, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 #endif | 214 #endif |
215 std::unordered_map<std::string, std::unique_ptr<PermissionRequest>> | 215 std::unordered_map<std::string, std::unique_ptr<PermissionRequest>> |
216 pending_requests_; | 216 pending_requests_; |
217 | 217 |
218 // Must be the last member, to ensure that it will be | 218 // Must be the last member, to ensure that it will be |
219 // destroyed first, which will invalidate weak pointers | 219 // destroyed first, which will invalidate weak pointers |
220 base::WeakPtrFactory<PermissionContextBase> weak_factory_; | 220 base::WeakPtrFactory<PermissionContextBase> weak_factory_; |
221 }; | 221 }; |
222 | 222 |
223 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ | 223 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ |
OLD | NEW |