OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "chrome/common/extensions/extension.h" | 12 #include "chrome/common/extensions/extension.h" |
13 | 13 |
14 class ExtensionMessageBundle; | 14 class ExtensionMessageBundle; |
15 | 15 |
16 // Utilties for manipulating the on-disk storage of extensions. | 16 // Utilties for manipulating the on-disk storage of extensions. |
17 namespace extension_file_util { | 17 namespace extension_file_util { |
18 | 18 |
19 // The name of the directory inside the profile that we store installed | 19 // The name of the directory inside the profile that we store installed |
20 // extension in. | 20 // extension in. |
21 extern const char kInstallDirectoryName[]; | 21 extern const char kInstallDirectoryName[]; |
22 | 22 |
23 // The name of the file that contains the current version of an installed | 23 // The name of the file that contains the current version of an installed |
24 // extension. | 24 // extension. |
25 extern const char kCurrentVersionFileName[]; | 25 extern const char kCurrentVersionFileName[]; |
26 | 26 |
27 // Move source_dir to dest_dir (it will actually be named dest_dir, not inside | 27 // Move source_dir to dest_dir (it will actually be named dest_dir, not inside |
28 // dest_dir). If the parent path doesn't exixt, create it. If something else is | 28 // dest_dir). If the parent path doesn't exist, create it. If something else is |
29 // already there, remove it. | 29 // already there, remove it. |
30 bool MoveDirSafely(const FilePath& source_dir, const FilePath& dest_dir); | 30 bool MoveDirSafely(const FilePath& source_dir, const FilePath& dest_dir); |
31 | 31 |
32 // Updates the Current Version file inside the installed extension. | 32 // Updates the Current Version file inside the installed extension. |
33 bool SetCurrentVersion(const FilePath& dest_dir, | 33 bool SetCurrentVersion(const FilePath& dest_dir, |
34 const std::string& version, | 34 const std::string& version, |
35 std::string* error); | 35 std::string* error); |
36 | 36 |
37 // Reads the Current Version file. | 37 // Reads the Current Version file. |
38 bool ReadCurrentVersion(const FilePath& dir, std::string* version_string); | 38 bool ReadCurrentVersion(const FilePath& dir, std::string* version_string); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // reserved list we return false, and set error message. | 99 // reserved list we return false, and set error message. |
100 bool CheckForIllegalFilenames(const FilePath& extension_path, | 100 bool CheckForIllegalFilenames(const FilePath& extension_path, |
101 std::string* error); | 101 std::string* error); |
102 | 102 |
103 // Get a relative file path from a chrome-extension:// URL. | 103 // Get a relative file path from a chrome-extension:// URL. |
104 FilePath ExtensionURLToRelativeFilePath(const GURL& url); | 104 FilePath ExtensionURLToRelativeFilePath(const GURL& url); |
105 | 105 |
106 } // extension_file_util | 106 } // extension_file_util |
107 | 107 |
108 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ | 108 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ |
OLD | NEW |