| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ | 5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ |
| 6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ | 6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // there is a content script that matches all hosts, if there is a host | 158 // there is a content script that matches all hosts, if there is a host |
| 159 // permission grants access to all hosts (like <all_urls>) or an api | 159 // permission grants access to all hosts (like <all_urls>) or an api |
| 160 // permission that effectively grants access to all hosts (e.g. proxy, | 160 // permission that effectively grants access to all hosts (e.g. proxy, |
| 161 // network, etc.) | 161 // network, etc.) |
| 162 bool HasEffectiveAccessToAllHosts() const; | 162 bool HasEffectiveAccessToAllHosts() const; |
| 163 | 163 |
| 164 // Returns the full list of permission details for messages that should | 164 // Returns the full list of permission details for messages that should |
| 165 // display at install time, in a nested format ready for display. | 165 // display at install time, in a nested format ready for display. |
| 166 PermissionMessages GetPermissionMessages() const; | 166 PermissionMessages GetPermissionMessages() const; |
| 167 | 167 |
| 168 // Returns the list of permission details for permissions that are included in |
| 169 // active_permissions(), but not present in |granted_permissions|. These are |
| 170 // returned in a nested format, ready for display. |
| 171 PermissionMessages GetNewPermissionMessages( |
| 172 const PermissionSet& granted_permissions) const; |
| 173 |
| 168 // Returns true if the extension has requested all-hosts permissions (or | 174 // Returns true if the extension has requested all-hosts permissions (or |
| 169 // something close to it), but has had it withheld. | 175 // something close to it), but has had it withheld. |
| 170 bool HasWithheldImpliedAllHosts() const; | 176 bool HasWithheldImpliedAllHosts() const; |
| 171 | 177 |
| 172 // Returns true if the |extension| has permission to access and interact with | 178 // Returns true if the |extension| has permission to access and interact with |
| 173 // the specified page, in order to do things like inject scripts or modify | 179 // the specified page, in order to do things like inject scripts or modify |
| 174 // the content. | 180 // the content. |
| 175 // If this returns false and |error| is non-NULL, |error| will be popualted | 181 // If this returns false and |error| is non-NULL, |error| will be popualted |
| 176 // with the reason the extension cannot access the page. | 182 // with the reason the extension cannot access the page. |
| 177 bool CanAccessPage(const Extension* extension, | 183 bool CanAccessPage(const Extension* extension, |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 mutable TabPermissionsMap tab_specific_permissions_; | 345 mutable TabPermissionsMap tab_specific_permissions_; |
| 340 | 346 |
| 341 mutable std::unique_ptr<base::ThreadChecker> thread_checker_; | 347 mutable std::unique_ptr<base::ThreadChecker> thread_checker_; |
| 342 | 348 |
| 343 DISALLOW_COPY_AND_ASSIGN(PermissionsData); | 349 DISALLOW_COPY_AND_ASSIGN(PermissionsData); |
| 344 }; | 350 }; |
| 345 | 351 |
| 346 } // namespace extensions | 352 } // namespace extensions |
| 347 | 353 |
| 348 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ | 354 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ |
| OLD | NEW |