| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 const UserScript* script, | 50 const UserScript* script, |
| 51 int process_id, | 51 int process_id, |
| 52 std::string* error) = 0; | 52 std::string* error) = 0; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 static void SetPolicyDelegate(PolicyDelegate* delegate); | 55 static void SetPolicyDelegate(PolicyDelegate* delegate); |
| 56 | 56 |
| 57 PermissionsData(const Extension* extension); | 57 PermissionsData(const Extension* extension); |
| 58 virtual ~PermissionsData(); | 58 virtual ~PermissionsData(); |
| 59 | 59 |
| 60 // Return the PermissionsData associated with the given |extension|. | |
| 61 static const PermissionsData* ForExtension(const Extension* extension); | |
| 62 | |
| 63 // Returns true if the |extension| can silently increase its permission level. | 60 // Returns true if the |extension| can silently increase its permission level. |
| 64 // Users must approve permissions for unpacked and packed extensions in the | 61 // Users must approve permissions for unpacked and packed extensions in the |
| 65 // following situations: | 62 // following situations: |
| 66 // - when installing or upgrading packed extensions | 63 // - when installing or upgrading packed extensions |
| 67 // - when installing unpacked extensions that have NPAPI plugins | 64 // - when installing unpacked extensions that have NPAPI plugins |
| 68 // - when either type of extension requests optional permissions | 65 // - when either type of extension requests optional permissions |
| 69 static bool CanSilentlyIncreasePermissions(const Extension* extension); | 66 static bool CanSilentlyIncreasePermissions(const Extension* extension); |
| 70 | 67 |
| 71 // Returns true if the extension is a COMPONENT extension or is on the | 68 // Returns true if the extension is a COMPONENT extension or is on the |
| 72 // whitelist of extensions that can script all pages. | 69 // whitelist of extensions that can script all pages. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 mutable scoped_refptr<const PermissionSet> active_permissions_unsafe_; | 197 mutable scoped_refptr<const PermissionSet> active_permissions_unsafe_; |
| 201 | 198 |
| 202 mutable TabPermissionsMap tab_specific_permissions_; | 199 mutable TabPermissionsMap tab_specific_permissions_; |
| 203 | 200 |
| 204 DISALLOW_COPY_AND_ASSIGN(PermissionsData); | 201 DISALLOW_COPY_AND_ASSIGN(PermissionsData); |
| 205 }; | 202 }; |
| 206 | 203 |
| 207 } // namespace extensions | 204 } // namespace extensions |
| 208 | 205 |
| 209 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ | 206 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ |
| OLD | NEW |