Chromium Code Reviews| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 // Calls PermissionDecided if permission can be decided non-interactively, | 122 // Calls PermissionDecided if permission can be decided non-interactively, |
| 123 // or NotifyPermissionSet if permission decided by presenting an infobar. | 123 // or NotifyPermissionSet if permission decided by presenting an infobar. |
| 124 virtual void DecidePermission(content::WebContents* web_contents, | 124 virtual void DecidePermission(content::WebContents* web_contents, |
| 125 const PermissionRequestID& id, | 125 const PermissionRequestID& id, |
| 126 const GURL& requesting_origin, | 126 const GURL& requesting_origin, |
| 127 const GURL& embedding_origin, | 127 const GURL& embedding_origin, |
| 128 bool user_gesture, | 128 bool user_gesture, |
| 129 const BrowserPermissionCallback& callback); | 129 const BrowserPermissionCallback& callback); |
| 130 | 130 |
| 131 // Called when permission is granted without interactively asking the user. | 131 // Called when permission is granted without interactively asking the user. |
| 132 void PermissionDecided(const PermissionRequestID& id, | 132 virtual void PermissionDecided(const PermissionRequestID& id, |
| 133 const GURL& requesting_origin, | 133 const GURL& requesting_origin, |
| 134 const GURL& embedding_origin, | 134 const GURL& embedding_origin, |
| 135 bool user_gesture, | 135 bool user_gesture, |
| 136 const BrowserPermissionCallback& callback, | 136 const BrowserPermissionCallback& callback, |
| 137 bool persist, | 137 bool persist, |
| 138 ContentSetting content_setting); | 138 ContentSetting content_setting); |
|
raymes
2017/03/15 04:28:25
Thinking more about why this doesn't feel great to
benwells
2017/03/15 23:10:49
Done.
| |
| 139 | 139 |
| 140 virtual void NotifyPermissionSet(const PermissionRequestID& id, | 140 virtual void NotifyPermissionSet(const PermissionRequestID& id, |
| 141 const GURL& requesting_origin, | 141 const GURL& requesting_origin, |
| 142 const GURL& embedding_origin, | 142 const GURL& embedding_origin, |
| 143 const BrowserPermissionCallback& callback, | 143 const BrowserPermissionCallback& callback, |
| 144 bool persist, | 144 bool persist, |
| 145 ContentSetting content_setting); | 145 ContentSetting content_setting); |
| 146 | 146 |
| 147 // Implementors can override this method to update the icons on the | 147 // Implementors can override this method to update the icons on the |
| 148 // url bar with the result of the new permission. | 148 // url bar with the result of the new permission. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 201 #endif | 201 #endif |
| 202 std::unordered_map<std::string, std::unique_ptr<PermissionRequest>> | 202 std::unordered_map<std::string, std::unique_ptr<PermissionRequest>> |
| 203 pending_requests_; | 203 pending_requests_; |
| 204 | 204 |
| 205 // Must be the last member, to ensure that it will be | 205 // Must be the last member, to ensure that it will be |
| 206 // destroyed first, which will invalidate weak pointers | 206 // destroyed first, which will invalidate weak pointers |
| 207 base::WeakPtrFactory<PermissionContextBase> weak_factory_; | 207 base::WeakPtrFactory<PermissionContextBase> weak_factory_; |
| 208 }; | 208 }; |
| 209 | 209 |
| 210 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ | 210 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ |
| OLD | NEW |