| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 // The same as LoadExtension except use the provided |extension_id|. | 53 // The same as LoadExtension except use the provided |extension_id|. |
| 54 scoped_refptr<Extension> LoadExtension(const base::FilePath& extension_root, | 54 scoped_refptr<Extension> LoadExtension(const base::FilePath& extension_root, |
| 55 const std::string& extension_id, | 55 const std::string& extension_id, |
| 56 Manifest::Location location, | 56 Manifest::Location location, |
| 57 int flags, | 57 int flags, |
| 58 std::string* error); | 58 std::string* error); |
| 59 | 59 |
| 60 // Loads an extension manifest from the specified directory. Returns NULL | 60 // Loads an extension manifest from the specified directory. Returns NULL |
| 61 // on failure, with a description of the error in |error|. | 61 // on failure, with a description of the error in |error|. |
| 62 base::DictionaryValue* LoadManifest(const base::FilePath& extension_root, | 62 scoped_ptr<base::DictionaryValue> LoadManifest( |
| 63 std::string* error); | 63 const base::FilePath& extension_root, |
| 64 std::string* error); |
| 64 | 65 |
| 65 // Convenience overload for specifying a manifest filename. | 66 // Convenience overload for specifying a manifest filename. |
| 66 base::DictionaryValue* LoadManifest( | 67 scoped_ptr<base::DictionaryValue> LoadManifest( |
| 67 const base::FilePath& extension_root, | 68 const base::FilePath& extension_root, |
| 68 const base::FilePath::CharType* manifest_filename, | 69 const base::FilePath::CharType* manifest_filename, |
| 69 std::string* error); | 70 std::string* error); |
| 70 | 71 |
| 71 // Returns true if the given extension object is valid and consistent. | 72 // Returns true if the given extension object is valid and consistent. |
| 72 // May also append a series of warning messages to |warnings|, but they | 73 // May also append a series of warning messages to |warnings|, but they |
| 73 // should not prevent the extension from running. | 74 // should not prevent the extension from running. |
| 74 // | 75 // |
| 75 // Otherwise, returns false, and a description of the error is | 76 // Otherwise, returns false, and a description of the error is |
| 76 // returned in |error|. | 77 // returned in |error|. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 const ExtensionSet& extension_set); | 145 const ExtensionSet& extension_set); |
| 145 | 146 |
| 146 // Helper functions for getting paths for files used in content verification. | 147 // Helper functions for getting paths for files used in content verification. |
| 147 base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path); | 148 base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path); |
| 148 base::FilePath GetComputedHashesPath(const base::FilePath& extension_path); | 149 base::FilePath GetComputedHashesPath(const base::FilePath& extension_path); |
| 149 | 150 |
| 150 } // namespace file_util | 151 } // namespace file_util |
| 151 } // namespace extensions | 152 } // namespace extensions |
| 152 | 153 |
| 153 #endif // EXTENSIONS_COMMON_FILE_UTIL_H_ | 154 #endif // EXTENSIONS_COMMON_FILE_UTIL_H_ |
| OLD | NEW |