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 | |
296 // See Type definition above. | 290 // See Type definition above. |
297 Type GetType() const; | 291 Type GetType() const; |
298 | 292 |
299 // Returns an absolute url to a resource inside of an extension. The | 293 // Returns an absolute url to a resource inside of an extension. The |
300 // |extension_url| argument should be the url() from an Extension object. The | 294 // |extension_url| argument should be the url() from an Extension object. The |
301 // |relative_path| can be untrusted user input. The returned URL will either | 295 // |relative_path| can be untrusted user input. The returned URL will either |
302 // be invalid() or a child of |extension_url|. | 296 // be invalid() or a child of |extension_url|. |
303 // NOTE: Static so that it can be used from multiple threads. | 297 // NOTE: Static so that it can be used from multiple threads. |
304 static GURL GetResourceURL(const GURL& extension_url, | 298 static GURL GetResourceURL(const GURL& extension_url, |
305 const std::string& relative_path); | 299 const std::string& relative_path); |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 // only contain the removed permissions. | 926 // only contain the removed permissions. |
933 const ExtensionPermissionSet* permissions; | 927 const ExtensionPermissionSet* permissions; |
934 | 928 |
935 UpdatedExtensionPermissionsInfo( | 929 UpdatedExtensionPermissionsInfo( |
936 const Extension* extension, | 930 const Extension* extension, |
937 const ExtensionPermissionSet* permissions, | 931 const ExtensionPermissionSet* permissions, |
938 Reason reason); | 932 Reason reason); |
939 }; | 933 }; |
940 | 934 |
941 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 935 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |