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_RESOURCE_H_ | 5 #ifndef EXTENSIONS_COMMON_EXTENSION_RESOURCE_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_RESOURCE_H_ | 6 #define EXTENSIONS_COMMON_EXTENSION_RESOURCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 | 11 |
| 12 namespace extensions { |
| 13 |
12 // Represents a resource inside an extension. For example, an image, or a | 14 // Represents a resource inside an extension. For example, an image, or a |
13 // JavaScript file. This is more complicated than just a simple FilePath | 15 // JavaScript file. This is more complicated than just a simple FilePath |
14 // because extension resources can come from multiple physical file locations | 16 // because extension resources can come from multiple physical file locations |
15 // depending on locale. | 17 // depending on locale. |
16 class ExtensionResource { | 18 class ExtensionResource { |
17 public: | 19 public: |
18 // SymlinkPolicy decides whether we'll allow resources to be a symlink to | 20 // SymlinkPolicy decides whether we'll allow resources to be a symlink to |
19 // anywhere, or whether they must end up within the extension root. | 21 // anywhere, or whether they must end up within the extension root. |
20 enum SymlinkPolicy { | 22 enum SymlinkPolicy { |
21 SYMLINKS_MUST_RESOLVE_WITHIN_ROOT, | 23 SYMLINKS_MUST_RESOLVE_WITHIN_ROOT, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 base::FilePath relative_path_; | 77 base::FilePath relative_path_; |
76 | 78 |
77 // If |follow_symlinks_anywhere_| is true then the resource itself must be | 79 // If |follow_symlinks_anywhere_| is true then the resource itself must be |
78 // within |extension_root|, but it can be a symlink to a file that is not. | 80 // within |extension_root|, but it can be a symlink to a file that is not. |
79 bool follow_symlinks_anywhere_; | 81 bool follow_symlinks_anywhere_; |
80 | 82 |
81 // Full path to extension resource. Starts empty. | 83 // Full path to extension resource. Starts empty. |
82 mutable base::FilePath full_resource_path_; | 84 mutable base::FilePath full_resource_path_; |
83 }; | 85 }; |
84 | 86 |
85 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_RESOURCE_H_ | 87 } // namespace extensions |
| 88 |
| 89 #endif // EXTENSIONS_COMMON_EXTENSION_RESOURCE_H_ |
OLD | NEW |