Chromium Code Reviews| Index: chrome/common/extensions/extension.h |
| diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h |
| index e029c7a02b70112ecc386c12d317b63a38898e0c..2cacae3d536d497679d3a35d06921637981573d7 100644 |
| --- a/chrome/common/extensions/extension.h |
| +++ b/chrome/common/extensions/extension.h |
| @@ -114,21 +114,29 @@ class Extension : public base::RefCountedThreadSafe<Extension> { |
| const int message_id; |
| }; |
| - // |strict_error_checks| enables extra error checking, such as |
| - // checks that URL patterns do not contain ports. This error |
| - // checking may find an error that a previous version of |
| - // chrome did not flag. To avoid errors in installed extensions |
| - // when chrome is upgraded, strict error checking is only enabled |
| - // when loading extensions as a developer would (such as loading |
| - // an unpacked extension), or when loading an extension that is |
| - // tied to a specific version of chrome (such as a component |
| - // extension). Most callers will set |strict_error_checks| to |
| - // Extension::ShouldDoStrictErrorChecking(location). |
| + enum InitFromValueFlags { |
| + NO_FLAGS = 0, |
| + // Usually, the id of an extension is generated by the "key" property of |
|
Aaron Boodman
2011/03/28 23:26:40
Add a blank line between each item?
|
| + // its manifest, but if |REQUIRE_KEY| is not set, a temporary ID will be |
| + // generated based on the path. |
| + REQUIRE_KEY = 1 << 0, |
| + // |STRICT_ERROR_CHECKS| enables extra error checking, such as |
| + // checks that URL patterns do not contain ports. This error |
| + // checking may find an error that a previous version of |
| + // Chrome did not flag. To avoid errors in installed extensions |
| + // when Chrome is upgraded, strict error checking is only enabled |
| + // when loading extensions as a developer would (such as loading |
| + // an unpacked extension), or when loading an extension that is |
| + // tied to a specific version of Chrome (such as a component |
| + // extension). Most callers will set the |STRICT_ERROR_CHECKS| bit when |
| + // Extension::ShouldDoStrictErrorChecking(location) returns true. |
| + STRICT_ERROR_CHECKS = 1 << 1, |
| + }; |
| + |
| static scoped_refptr<Extension> Create(const FilePath& path, |
| Location location, |
| const DictionaryValue& value, |
| - bool require_key, |
| - bool strict_error_checks, |
| + int flags, |
|
Aaron Boodman
2011/03/28 23:26:40
I always forget: Can you define this as InitFromVa
|
| std::string* error); |
| // Return the update url used by gallery/webstore extensions. |
| @@ -539,11 +547,8 @@ class Extension : public base::RefCountedThreadSafe<Extension> { |
| ~Extension(); |
| // Initialize the extension from a parsed manifest. |
| - // Usually, the id of an extension is generated by the "key" property of |
| - // its manifest, but if |require_key| is |false|, a temporary ID will be |
| - // generated based on the path. |
| - bool InitFromValue(const DictionaryValue& value, bool require_key, |
| - bool strict_error_checks, std::string* error); |
| + bool InitFromValue(const DictionaryValue& value, int flags, |
| + std::string* error); |
| // Helper function for implementing HasCachedImage/GetCachedImage. A return |
| // value of NULL means there is no matching image cached (we allow caching an |