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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // following situations: | 69 // following situations: |
70 // - when installing or upgrading packed extensions | 70 // - when installing or upgrading packed extensions |
71 // - when installing unpacked extensions that have NPAPI plugins | 71 // - when installing unpacked extensions that have NPAPI plugins |
72 // - when either type of extension requests optional permissions | 72 // - when either type of extension requests optional permissions |
73 static bool CanSilentlyIncreasePermissions(const Extension* extension); | 73 static bool CanSilentlyIncreasePermissions(const Extension* extension); |
74 | 74 |
75 // Returns true if the extension is a COMPONENT extension or is on the | 75 // Returns true if the extension is a COMPONENT extension or is on the |
76 // whitelist of extensions that can script all pages. | 76 // whitelist of extensions that can script all pages. |
77 static bool CanExecuteScriptEverywhere(const Extension* extension); | 77 static bool CanExecuteScriptEverywhere(const Extension* extension); |
78 | 78 |
| 79 // Returns true if we should skip the permisisons warning for the extension |
| 80 // with the given |extension_id|. |
| 81 static bool ShouldSkipPermissionWarnings(const std::string& extension_id); |
| 82 |
79 // Returns true if the given |url| is restricted for the given |extension|, | 83 // Returns true if the given |url| is restricted for the given |extension|, |
80 // as is commonly the case for chrome:// urls. | 84 // as is commonly the case for chrome:// urls. |
81 // NOTE: You probably want to use CanAccessPage(). | 85 // NOTE: You probably want to use CanAccessPage(). |
82 static bool IsRestrictedUrl(const GURL& document_url, | 86 static bool IsRestrictedUrl(const GURL& document_url, |
83 const GURL& top_frame_url, | 87 const GURL& top_frame_url, |
84 const Extension* extension, | 88 const Extension* extension, |
85 std::string* error); | 89 std::string* error); |
86 | 90 |
87 // Sets the runtime permissions of the given |extension| to |active| and | 91 // Sets the runtime permissions of the given |extension| to |active| and |
88 // |withheld|. | 92 // |withheld|. |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 mutable scoped_refptr<const PermissionSet> withheld_permissions_unsafe_; | 267 mutable scoped_refptr<const PermissionSet> withheld_permissions_unsafe_; |
264 | 268 |
265 mutable TabPermissionsMap tab_specific_permissions_; | 269 mutable TabPermissionsMap tab_specific_permissions_; |
266 | 270 |
267 DISALLOW_COPY_AND_ASSIGN(PermissionsData); | 271 DISALLOW_COPY_AND_ASSIGN(PermissionsData); |
268 }; | 272 }; |
269 | 273 |
270 } // namespace extensions | 274 } // namespace extensions |
271 | 275 |
272 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ | 276 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ |
OLD | NEW |