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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 int tab_id, | 53 int tab_id, |
54 int process_id, | 54 int process_id, |
55 std::string* error) = 0; | 55 std::string* error) = 0; |
56 }; | 56 }; |
57 | 57 |
58 static void SetPolicyDelegate(PolicyDelegate* delegate); | 58 static void SetPolicyDelegate(PolicyDelegate* delegate); |
59 | 59 |
60 PermissionsData(const Extension* extension); | 60 PermissionsData(const Extension* extension); |
61 virtual ~PermissionsData(); | 61 virtual ~PermissionsData(); |
62 | 62 |
| 63 // Returns true if the extension id is on the whitelist of extensions |
| 64 // that can script all pages. |
| 65 static bool IsExtensionIdWhitelisted(const std::string& extension_id); |
| 66 |
63 // Returns true if the extension is a COMPONENT extension or is on the | 67 // Returns true if the extension is a COMPONENT extension or is on the |
64 // whitelist of extensions that can script all pages. | 68 // whitelist of extensions that can script all pages. |
65 static bool CanExecuteScriptEverywhere(const Extension* extension); | 69 static bool CanExecuteScriptEverywhere(const Extension* extension); |
66 | 70 |
67 // Returns true if the --scripts-require-action flag would possibly affect | 71 // Returns true if the --scripts-require-action flag would possibly affect |
68 // the given |extension| and |permissions|. We pass in the |permissions| | 72 // the given |extension| and |permissions|. We pass in the |permissions| |
69 // explicitly, as we may need to check with permissions other than the ones | 73 // explicitly, as we may need to check with permissions other than the ones |
70 // that are currently on the extension's PermissionsData. | 74 // that are currently on the extension's PermissionsData. |
71 static bool ScriptsMayRequireActionForExtension( | 75 static bool ScriptsMayRequireActionForExtension( |
72 const Extension* extension, | 76 const Extension* extension, |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 mutable scoped_refptr<const PermissionSet> withheld_permissions_unsafe_; | 275 mutable scoped_refptr<const PermissionSet> withheld_permissions_unsafe_; |
272 | 276 |
273 mutable TabPermissionsMap tab_specific_permissions_; | 277 mutable TabPermissionsMap tab_specific_permissions_; |
274 | 278 |
275 DISALLOW_COPY_AND_ASSIGN(PermissionsData); | 279 DISALLOW_COPY_AND_ASSIGN(PermissionsData); |
276 }; | 280 }; |
277 | 281 |
278 } // namespace extensions | 282 } // namespace extensions |
279 | 283 |
280 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ | 284 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ |
OLD | NEW |