| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 std::string* error); | 60 std::string* error); |
| 61 | 61 |
| 62 // Returns true if the given extension object is valid and consistent. | 62 // Returns true if the given extension object is valid and consistent. |
| 63 // May also append a series of warning messages to |warnings|, but they | 63 // May also append a series of warning messages to |warnings|, but they |
| 64 // should not prevent the extension from running. | 64 // should not prevent the extension from running. |
| 65 // | 65 // |
| 66 // Otherwise, returns false, and a description of the error is | 66 // Otherwise, returns false, and a description of the error is |
| 67 // returned in |error|. | 67 // returned in |error|. |
| 68 bool ValidateExtension(const extensions::Extension* extension, | 68 bool ValidateExtension(const extensions::Extension* extension, |
| 69 std::string* error, | 69 std::string* error, |
| 70 std::vector<std::string>* warnings); | 70 extensions::Extension::InstallWarningVector* warnings); |
| 71 | 71 |
| 72 // Returns a list of files that contain private keys inside |extension_dir|. | 72 // Returns a list of files that contain private keys inside |extension_dir|. |
| 73 std::vector<FilePath> FindPrivateKeyFiles(const FilePath& extension_dir); | 73 std::vector<FilePath> FindPrivateKeyFiles(const FilePath& extension_dir); |
| 74 | 74 |
| 75 // Cleans up the extension install directory. It can end up with garbage in it | 75 // Cleans up the extension install directory. It can end up with garbage in it |
| 76 // if extensions can't initially be removed when they are uninstalled (eg if a | 76 // if extensions can't initially be removed when they are uninstalled (eg if a |
| 77 // file is in use). | 77 // file is in use). |
| 78 // | 78 // |
| 79 // |extensions_dir| is the install directory to look in. |extension_paths| is a | 79 // |extensions_dir| is the install directory to look in. |extension_paths| is a |
| 80 // map from extension id to full installation path. | 80 // map from extension id to full installation path. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 FilePath GetUserDataTempDir(); | 121 FilePath GetUserDataTempDir(); |
| 122 | 122 |
| 123 // Helper function to delete files. This is used to avoid ugly casts which | 123 // Helper function to delete files. This is used to avoid ugly casts which |
| 124 // would be necessary with PostMessage since file_util::Delete is overloaded. | 124 // would be necessary with PostMessage since file_util::Delete is overloaded. |
| 125 // TODO(skerner): Make a version of Delete that is not overloaded in file_util. | 125 // TODO(skerner): Make a version of Delete that is not overloaded in file_util. |
| 126 void DeleteFile(const FilePath& path, bool recursive); | 126 void DeleteFile(const FilePath& path, bool recursive); |
| 127 | 127 |
| 128 } // namespace extension_file_util | 128 } // namespace extension_file_util |
| 129 | 129 |
| 130 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ | 130 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ |
| OLD | NEW |