| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_FILE_UTIL_H_ | 5 #ifndef EXTENSIONS_COMMON_FILE_UTIL_H_ |
| 6 #define EXTENSIONS_COMMON_FILE_UTIL_H_ | 6 #define EXTENSIONS_COMMON_FILE_UTIL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 const std::string& extension_id, | 54 const std::string& extension_id, |
| 55 Manifest::Location location, | 55 Manifest::Location location, |
| 56 int flags, | 56 int flags, |
| 57 std::string* error); | 57 std::string* error); |
| 58 | 58 |
| 59 // Loads an extension manifest from the specified directory. Returns NULL | 59 // Loads an extension manifest from the specified directory. Returns NULL |
| 60 // on failure, with a description of the error in |error|. | 60 // on failure, with a description of the error in |error|. |
| 61 base::DictionaryValue* LoadManifest(const base::FilePath& extension_root, | 61 base::DictionaryValue* LoadManifest(const base::FilePath& extension_root, |
| 62 std::string* error); | 62 std::string* error); |
| 63 | 63 |
| 64 // Convenience overload for specifying a manifest filename. |
| 65 base::DictionaryValue* LoadManifest( |
| 66 const base::FilePath& extension_root, |
| 67 const base::FilePath::CharType* manifest_filename, |
| 68 std::string* error); |
| 69 |
| 64 // Returns true if the given extension object is valid and consistent. | 70 // Returns true if the given extension object is valid and consistent. |
| 65 // May also append a series of warning messages to |warnings|, but they | 71 // May also append a series of warning messages to |warnings|, but they |
| 66 // should not prevent the extension from running. | 72 // should not prevent the extension from running. |
| 67 // | 73 // |
| 68 // Otherwise, returns false, and a description of the error is | 74 // Otherwise, returns false, and a description of the error is |
| 69 // returned in |error|. | 75 // returned in |error|. |
| 70 bool ValidateExtension(const Extension* extension, | 76 bool ValidateExtension(const Extension* extension, |
| 71 std::string* error, | 77 std::string* error, |
| 72 std::vector<InstallWarning>* warnings); | 78 std::vector<InstallWarning>* warnings); |
| 73 | 79 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 const std::string& default_locale); | 129 const std::string& default_locale); |
| 124 | 130 |
| 125 // Helper functions for getting paths for files used in content verification. | 131 // Helper functions for getting paths for files used in content verification. |
| 126 base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path); | 132 base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path); |
| 127 base::FilePath GetComputedHashesPath(const base::FilePath& extension_path); | 133 base::FilePath GetComputedHashesPath(const base::FilePath& extension_path); |
| 128 | 134 |
| 129 } // namespace file_util | 135 } // namespace file_util |
| 130 } // namespace extensions | 136 } // namespace extensions |
| 131 | 137 |
| 132 #endif // EXTENSIONS_COMMON_FILE_UTIL_H_ | 138 #endif // EXTENSIONS_COMMON_FILE_UTIL_H_ |
| OLD | NEW |