| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // Calls PermissionDecided if permission can be decided non-interactively, | 107 // Calls PermissionDecided if permission can be decided non-interactively, |
| 108 // or NotifyPermissionSet if permission decided by presenting an infobar. | 108 // or NotifyPermissionSet if permission decided by presenting an infobar. |
| 109 virtual void DecidePermission(content::WebContents* web_contents, | 109 virtual void DecidePermission(content::WebContents* web_contents, |
| 110 const PermissionRequestID& id, | 110 const PermissionRequestID& id, |
| 111 const GURL& requesting_origin, | 111 const GURL& requesting_origin, |
| 112 const GURL& embedding_origin, | 112 const GURL& embedding_origin, |
| 113 bool user_gesture, | 113 bool user_gesture, |
| 114 const BrowserPermissionCallback& callback); | 114 const BrowserPermissionCallback& callback); |
| 115 | 115 |
| 116 // Called when permission is granted without interactively asking the user. | 116 // Called when permission is granted without interactively asking the user. |
| 117 void PermissionDecided(const PermissionRequestID& id, | 117 void PermissionDecided(content::WebContents* web_contents, |
| 118 const PermissionRequestID& id, |
| 118 const GURL& requesting_origin, | 119 const GURL& requesting_origin, |
| 119 const GURL& embedding_origin, | 120 const GURL& embedding_origin, |
| 120 bool user_gesture, | 121 bool user_gesture, |
| 121 const BrowserPermissionCallback& callback, | 122 const BrowserPermissionCallback& callback, |
| 122 bool persist, | 123 bool persist, |
| 123 ContentSetting content_setting); | 124 ContentSetting content_setting); |
| 124 | 125 |
| 125 virtual void NotifyPermissionSet(const PermissionRequestID& id, | 126 virtual void NotifyPermissionSet(content::WebContents* web_contents, |
| 127 const PermissionRequestID& id, |
| 126 const GURL& requesting_origin, | 128 const GURL& requesting_origin, |
| 127 const GURL& embedding_origin, | 129 const GURL& embedding_origin, |
| 128 const BrowserPermissionCallback& callback, | 130 const BrowserPermissionCallback& callback, |
| 129 bool persist, | 131 bool persist, |
| 130 ContentSetting content_setting); | 132 ContentSetting content_setting); |
| 131 | 133 |
| 132 // Implementors can override this method to update the icons on the | 134 // Implementors can override this method to update the icons on the |
| 133 // url bar with the result of the new permission. | 135 // url bar with the result of the new permission. |
| 134 virtual void UpdateTabContext(const PermissionRequestID& id, | 136 virtual void UpdateTabContext(const PermissionRequestID& id, |
| 135 const GURL& requesting_origin, | 137 const GURL& requesting_origin, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 #endif | 174 #endif |
| 173 std::unordered_map<std::string, std::unique_ptr<PermissionRequest>> | 175 std::unordered_map<std::string, std::unique_ptr<PermissionRequest>> |
| 174 pending_requests_; | 176 pending_requests_; |
| 175 | 177 |
| 176 // Must be the last member, to ensure that it will be | 178 // Must be the last member, to ensure that it will be |
| 177 // destroyed first, which will invalidate weak pointers | 179 // destroyed first, which will invalidate weak pointers |
| 178 base::WeakPtrFactory<PermissionContextBase> weak_factory_; | 180 base::WeakPtrFactory<PermissionContextBase> weak_factory_; |
| 179 }; | 181 }; |
| 180 | 182 |
| 181 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ | 183 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ |
| OLD | NEW |