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