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 <string> |
| 9 |
| 10 class ExtensionIconSet; |
8 class GURL; | 11 class GURL; |
9 | 12 |
10 namespace base { | 13 namespace base { |
11 class FilePath; | 14 class FilePath; |
12 } | 15 } |
13 | 16 |
14 namespace extensions { | 17 namespace extensions { |
| 18 class Extension; |
| 19 |
15 namespace file_util { | 20 namespace file_util { |
16 | 21 |
17 // Get a relative file path from a chrome-extension:// URL. | 22 // Get a relative file path from a chrome-extension:// URL. |
18 base::FilePath ExtensionURLToRelativeFilePath(const GURL& url); | 23 base::FilePath ExtensionURLToRelativeFilePath(const GURL& url); |
19 | 24 |
20 // Get a full file path from a chrome-extension-resource:// URL, If the URL | 25 // Get a full file path from a chrome-extension-resource:// URL, If the URL |
21 // points a file outside of root, this function will return empty FilePath. | 26 // points a file outside of root, this function will return empty FilePath. |
22 base::FilePath ExtensionResourceURLToFilePath(const GURL& url, | 27 base::FilePath ExtensionResourceURLToFilePath(const GURL& url, |
23 const base::FilePath& root); | 28 const base::FilePath& root); |
24 | 29 |
| 30 // Returns true if the icons in the icon set exist. Oherwise, populates |
| 31 // |error| with the |error_message_id| for an invalid file. |
| 32 bool ValidateExtensionIconSet(const ExtensionIconSet& icon_set, |
| 33 const Extension* extension, |
| 34 int error_message_id, |
| 35 std::string* error); |
| 36 |
25 } // namespace file_util | 37 } // namespace file_util |
26 } // namespace extensions | 38 } // namespace extensions |
27 | 39 |
28 #endif // EXTENSIONS_COMMON_FILE_UTIL_H_ | 40 #endif // EXTENSIONS_COMMON_FILE_UTIL_H_ |
OLD | NEW |