OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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|. |
81 bool ValidateExtension(const extensions::Extension* extension, | 81 bool ValidateExtension(const extensions::Extension* extension, |
82 std::string* error, | 82 std::string* error, |
83 std::vector<extensions::InstallWarning>* warnings); | 83 std::vector<extensions::InstallWarning>* warnings); |
84 | 84 |
| 85 // Returns a list of paths (relative to the extension dir) for images that |
| 86 // the browser might load (like themes and page action icons) for the given |
| 87 // extension. |
| 88 std::set<base::FilePath> GetBrowserImagePaths( |
| 89 const extensions::Extension* extension); |
| 90 |
| 91 |
85 // Returns a list of files that contain private keys inside |extension_dir|. | 92 // Returns a list of files that contain private keys inside |extension_dir|. |
86 std::vector<base::FilePath> FindPrivateKeyFiles(const base::FilePath& extension_
dir); | 93 std::vector<base::FilePath> FindPrivateKeyFiles( |
| 94 const base::FilePath& extension_dir); |
87 | 95 |
88 // Cleans up the extension install directory. It can end up with garbage in it | 96 // Cleans up the extension install directory. It can end up with garbage in it |
89 // if extensions can't initially be removed when they are uninstalled (eg if a | 97 // if extensions can't initially be removed when they are uninstalled (eg if a |
90 // file is in use). | 98 // file is in use). |
91 // | 99 // |
92 // |extensions_dir| is the install directory to look in. |extension_paths| is a | 100 // |extensions_dir| is the install directory to look in. |extension_paths| is a |
93 // map from extension id to full installation path. | 101 // map from extension id to full installation path. |
94 // | 102 // |
95 // Obsolete version directories are removed, as are directories that aren't | 103 // Obsolete version directories are removed, as are directories that aren't |
96 // found in |extension_paths|. | 104 // found in |extension_paths|. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 base::FilePath GetInstallTempDir(const base::FilePath& extensions_dir); | 143 base::FilePath GetInstallTempDir(const base::FilePath& extensions_dir); |
136 | 144 |
137 // Helper function to delete files. This is used to avoid ugly casts which | 145 // Helper function to delete files. This is used to avoid ugly casts which |
138 // would be necessary with PostMessage since file_util::Delete is overloaded. | 146 // would be necessary with PostMessage since file_util::Delete is overloaded. |
139 // TODO(skerner): Make a version of Delete that is not overloaded in file_util. | 147 // TODO(skerner): Make a version of Delete that is not overloaded in file_util. |
140 void DeleteFile(const base::FilePath& path, bool recursive); | 148 void DeleteFile(const base::FilePath& path, bool recursive); |
141 | 149 |
142 } // namespace extension_file_util | 150 } // namespace extension_file_util |
143 | 151 |
144 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ | 152 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ |
OLD | NEW |