OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 // error checking. Strict error checks may flag errors older versions | 280 // error checking. Strict error checks may flag errors older versions |
281 // of chrome did not detect. To avoid breaking installed extensions, | 281 // of chrome did not detect. To avoid breaking installed extensions, |
282 // strict checks are disabled unless the location indicates that the | 282 // strict checks are disabled unless the location indicates that the |
283 // developer is loading the extension, or the extension is a component | 283 // developer is loading the extension, or the extension is a component |
284 // of chrome. | 284 // of chrome. |
285 static inline bool ShouldDoStrictErrorChecking(Location location) { | 285 static inline bool ShouldDoStrictErrorChecking(Location location) { |
286 return location == Extension::LOAD || | 286 return location == Extension::LOAD || |
287 location == Extension::COMPONENT; | 287 location == Extension::COMPONENT; |
288 } | 288 } |
289 | 289 |
| 290 // Unpacked extensions start off with file access since they are a developer |
| 291 // feature. |
| 292 static inline bool ShouldAlwaysAllowFileAccess(Location location) { |
| 293 return location == Extension::LOAD; |
| 294 } |
| 295 |
290 // See Type definition above. | 296 // See Type definition above. |
291 Type GetType() const; | 297 Type GetType() const; |
292 | 298 |
293 // Returns an absolute url to a resource inside of an extension. The | 299 // Returns an absolute url to a resource inside of an extension. The |
294 // |extension_url| argument should be the url() from an Extension object. The | 300 // |extension_url| argument should be the url() from an Extension object. The |
295 // |relative_path| can be untrusted user input. The returned URL will either | 301 // |relative_path| can be untrusted user input. The returned URL will either |
296 // be invalid() or a child of |extension_url|. | 302 // be invalid() or a child of |extension_url|. |
297 // NOTE: Static so that it can be used from multiple threads. | 303 // NOTE: Static so that it can be used from multiple threads. |
298 static GURL GetResourceURL(const GURL& extension_url, | 304 static GURL GetResourceURL(const GURL& extension_url, |
299 const std::string& relative_path); | 305 const std::string& relative_path); |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 // only contain the removed permissions. | 932 // only contain the removed permissions. |
927 const ExtensionPermissionSet* permissions; | 933 const ExtensionPermissionSet* permissions; |
928 | 934 |
929 UpdatedExtensionPermissionsInfo( | 935 UpdatedExtensionPermissionsInfo( |
930 const Extension* extension, | 936 const Extension* extension, |
931 const ExtensionPermissionSet* permissions, | 937 const ExtensionPermissionSet* permissions, |
932 Reason reason); | 938 Reason reason); |
933 }; | 939 }; |
934 | 940 |
935 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 941 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |