OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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> |
11 | 11 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // We need to reserve the namespace of entries that start with "_" for future | 69 // We need to reserve the namespace of entries that start with "_" for future |
70 // use by Chrome. | 70 // use by Chrome. |
71 // If any files or directories are found using "_" prefix and are not on | 71 // If any files or directories are found using "_" prefix and are not on |
72 // reserved list we return false, and set error message. | 72 // reserved list we return false, and set error message. |
73 bool CheckForIllegalFilenames(const FilePath& extension_path, | 73 bool CheckForIllegalFilenames(const FilePath& extension_path, |
74 std::string* error); | 74 std::string* error); |
75 | 75 |
76 // Get a relative file path from a chrome-extension:// URL. | 76 // Get a relative file path from a chrome-extension:// URL. |
77 FilePath ExtensionURLToRelativeFilePath(const GURL& url); | 77 FilePath ExtensionURLToRelativeFilePath(const GURL& url); |
78 | 78 |
| 79 // Get a path to a temp directory for unpacking an extension. |
| 80 // This is essentially PathService::Get(chrome::DIR_USER_DATA_TEMP, ...), |
| 81 // with a histogram that allows us to understand why it is failing. |
| 82 // Return an empty file path on failure. |
| 83 FilePath GetUserDataTempDir(); |
| 84 |
79 } // namespace extension_file_util | 85 } // namespace extension_file_util |
80 | 86 |
81 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ | 87 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ |
OLD | NEW |