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

Unified Diff: chrome/common/extensions/user_script.h

Issue 267051: Minimize dependency of user scripts.... (Closed) Base URL: svn://svn.chromium.org/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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/user_script.h
===================================================================
--- chrome/common/extensions/user_script.h (revision 29458)
+++ chrome/common/extensions/user_script.h (working copy)
@@ -35,16 +35,16 @@
// Holds actual script file info.
class File {
public:
- File(const ExtensionResource& resource, const GURL& url):
- resource_(resource),
- url_(url) {
+ File(const FilePath& extension_root, const FilePath& relative_path,
+ const GURL& url):
+ extension_root_(extension_root),
+ relative_path_(relative_path),
+ url_(url) {
}
File() {}
- const ExtensionResource& resource() const { return resource_; }
- void set_resource(const ExtensionResource& resource) {
- resource_ = resource;
- }
+ const FilePath& extension_root() const { return extension_root_; }
+ const FilePath& relative_path() const { return relative_path_; }
const GURL& url() const { return url_; }
void set_url(const GURL& url) { url_ = url; }
@@ -64,14 +64,16 @@
content_.assign(content.begin(), content.end());
}
- // Serialization support. The content and resource_ member will not be
+ // Serialization support. The content and FilePath members will not be
// serialized!
void Pickle(::Pickle* pickle) const;
void Unpickle(const ::Pickle& pickle, void** iter);
private:
- // Where the script file lives on the disk.
- ExtensionResource resource_;
+ // Where the script file lives on the disk. We keep the path split so that
+ // it can be localized at will.
+ FilePath extension_root_;
+ FilePath relative_path_;
// The url to this scipt file.
GURL url_;

Powered by Google App Engine
This is Rietveld 408576698