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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // following situations: | 63 // following situations: |
64 // - when installing or upgrading packed extensions | 64 // - when installing or upgrading packed extensions |
65 // - when installing unpacked extensions that have NPAPI plugins | 65 // - when installing unpacked extensions that have NPAPI plugins |
66 // - when either type of extension requests optional permissions | 66 // - when either type of extension requests optional permissions |
67 static bool CanSilentlyIncreasePermissions(const Extension* extension); | 67 static bool CanSilentlyIncreasePermissions(const Extension* extension); |
68 | 68 |
69 // Returns true if the extension is a COMPONENT extension or is on the | 69 // Returns true if the extension is a COMPONENT extension or is on the |
70 // whitelist of extensions that can script all pages. | 70 // whitelist of extensions that can script all pages. |
71 static bool CanExecuteScriptEverywhere(const Extension* extension); | 71 static bool CanExecuteScriptEverywhere(const Extension* extension); |
72 | 72 |
| 73 // Returns true if the --scripts-require-action flag would possibly affect |
| 74 // the given |extension| and |permissions|. We pass in the |permissions| |
| 75 // explicitly, as we may need to check with permissions other than the ones |
| 76 // that are currently on the extension's PermissionsData. |
| 77 static bool ScriptsMayRequireActionForExtension( |
| 78 const Extension* extension, |
| 79 const PermissionSet* permissions); |
| 80 |
73 // Returns true if we should skip the permisisons warning for the extension | 81 // Returns true if we should skip the permisisons warning for the extension |
74 // with the given |extension_id|. | 82 // with the given |extension_id|. |
75 static bool ShouldSkipPermissionWarnings(const std::string& extension_id); | 83 static bool ShouldSkipPermissionWarnings(const std::string& extension_id); |
76 | 84 |
77 // Returns true if the given |url| is restricted for the given |extension|, | 85 // Returns true if the given |url| is restricted for the given |extension|, |
78 // as is commonly the case for chrome:// urls. | 86 // as is commonly the case for chrome:// urls. |
79 // NOTE: You probably want to use CanAccessPage(). | 87 // NOTE: You probably want to use CanAccessPage(). |
80 static bool IsRestrictedUrl(const GURL& document_url, | 88 static bool IsRestrictedUrl(const GURL& document_url, |
81 const GURL& top_frame_url, | 89 const GURL& top_frame_url, |
82 const Extension* extension, | 90 const Extension* extension, |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 mutable scoped_refptr<const PermissionSet> withheld_permissions_unsafe_; | 277 mutable scoped_refptr<const PermissionSet> withheld_permissions_unsafe_; |
270 | 278 |
271 mutable TabPermissionsMap tab_specific_permissions_; | 279 mutable TabPermissionsMap tab_specific_permissions_; |
272 | 280 |
273 DISALLOW_COPY_AND_ASSIGN(PermissionsData); | 281 DISALLOW_COPY_AND_ASSIGN(PermissionsData); |
274 }; | 282 }; |
275 | 283 |
276 } // namespace extensions | 284 } // namespace extensions |
277 | 285 |
278 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ | 286 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ |
OLD | NEW |