Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: chrome/common/extensions/extension_resource.h

Issue 256022: Loads local resources from current locale subtree if available, if not it fal... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/extension_resource.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_RESOURCE_H_
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_RESOURCE_H_
7
8 #include "base/file_path.h"
9
10 // Represents a resource inside an extension. For example, an image, or a
11 // JavaScript file. This is more complicated than just a simple FilePath
12 // because extension resources can come from multiple physical file locations
13 // depending on locale.
14 class ExtensionResource {
15 public:
16 ExtensionResource();
17
18 ExtensionResource(const FilePath& extension_root,
19 const FilePath& relative_path);
20
21 // Returns actual path to the resource (default or locale specific).
22 // *** MIGHT HIT FILESYSTEM. Do not call on UI thread! ***
23 const FilePath& GetFilePath() const;
24
25 // Getters
26 const FilePath& extension_root() const { return extension_root_; }
27 const FilePath& relative_path() const { return relative_path_; }
28
29 // Unittest helpers.
30 FilePath::StringType NormalizeSeperators(FilePath::StringType path) const;
31 bool ComparePathWithDefault(const FilePath& path) const;
32
33 private:
34 // Returns normalized full path to the resource.
35 // Resource doesn't have to exist.
36 FilePath CombinePathsSafely(const FilePath& extension_root,
37 const FilePath& relative_path) const;
38
39 // Extension root.
40 FilePath extension_root_;
41
42 // Relative path to resource.
43 FilePath relative_path_;
44
45 // Full path to extension resource. Starts empty.
46 mutable FilePath full_resource_path_;
47 };
48
49 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_RESOURCE_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/extension_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698