| 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> |
| 11 | 11 |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "extensions/common/manifest.h" | 14 #include "extensions/common/manifest.h" |
| 15 #include "extensions/common/message_bundle.h" | 15 #include "extensions/common/message_bundle.h" |
| 16 | 16 |
| 17 class ExtensionIconSet; | 17 class ExtensionIconSet; |
| 18 class GURL; | 18 class GURL; |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class FilePath; | 21 class FilePath; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace extensions { | 24 namespace extensions { |
| 25 class Extension; | 25 class Extension; |
| 26 class ExtensionSet; | |
| 27 struct InstallWarning; | 26 struct InstallWarning; |
| 28 | 27 |
| 29 // Utilities for manipulating the on-disk storage of extensions. | 28 // Utilities for manipulating the on-disk storage of extensions. |
| 30 namespace file_util { | 29 namespace file_util { |
| 31 | 30 |
| 32 extern const base::FilePath::CharType kTempDirectoryName[]; | 31 extern const base::FilePath::CharType kTempDirectoryName[]; |
| 33 | 32 |
| 34 // Sets the flag to enable safe installation (i.e. flush all installed files). | 33 // Sets the flag to enable safe installation (i.e. flush all installed files). |
| 35 void SetUseSafeInstallation(bool use_safe_installation); | 34 void SetUseSafeInstallation(bool use_safe_installation); |
| 36 | 35 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 const std::string& default_locale, | 127 const std::string& default_locale, |
| 129 std::string* error); | 128 std::string* error); |
| 130 | 129 |
| 131 // Loads the extension message bundle substitution map. Contains at least | 130 // Loads the extension message bundle substitution map. Contains at least |
| 132 // the extension_id item. | 131 // the extension_id item. |
| 133 MessageBundle::SubstitutionMap* LoadMessageBundleSubstitutionMap( | 132 MessageBundle::SubstitutionMap* LoadMessageBundleSubstitutionMap( |
| 134 const base::FilePath& extension_path, | 133 const base::FilePath& extension_path, |
| 135 const std::string& extension_id, | 134 const std::string& extension_id, |
| 136 const std::string& default_locale); | 135 const std::string& default_locale); |
| 137 | 136 |
| 138 // Loads the extension message bundle substitution map, including messages from | 137 // Loads the extension message bundle substitution map for a non-localized |
| 139 // Shared Modules that the given extension imports. Contains at least the | 138 // extension. Contains only the extension_id item. |
| 140 // extension_id item. | 139 // This doesn't require hitting disk, so it's safe to call on any thread. |
| 141 MessageBundle::SubstitutionMap* LoadMessageBundleSubstitutionMapWithImports( | 140 MessageBundle::SubstitutionMap* LoadNonLocalizedMessageBundleSubstitutionMap( |
| 141 const std::string& extension_id); |
| 142 |
| 143 // Loads the extension message bundle substitution map from the specified paths. |
| 144 // Contains at least the extension_id item. |
| 145 MessageBundle::SubstitutionMap* LoadMessageBundleSubstitutionMapFromPaths( |
| 146 const std::vector<base::FilePath>& paths, |
| 142 const std::string& extension_id, | 147 const std::string& extension_id, |
| 143 const ExtensionSet& extension_set); | 148 const std::string& default_locale); |
| 144 | 149 |
| 145 // Helper functions for getting paths for files used in content verification. | 150 // Helper functions for getting paths for files used in content verification. |
| 146 base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path); | 151 base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path); |
| 147 base::FilePath GetComputedHashesPath(const base::FilePath& extension_path); | 152 base::FilePath GetComputedHashesPath(const base::FilePath& extension_path); |
| 148 | 153 |
| 149 } // namespace file_util | 154 } // namespace file_util |
| 150 } // namespace extensions | 155 } // namespace extensions |
| 151 | 156 |
| 152 #endif // EXTENSIONS_COMMON_FILE_UTIL_H_ | 157 #endif // EXTENSIONS_COMMON_FILE_UTIL_H_ |
| OLD | NEW |