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

Unified Diff: chrome/browser/extensions/external_pref_extension_loader.h

Issue 6293006: Allow relative paths to external extension files for some providers, error out for others. (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: Rebase for commit. Created 9 years, 11 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/browser/extensions/external_pref_extension_loader.h
diff --git a/chrome/browser/extensions/external_pref_extension_loader.h b/chrome/browser/extensions/external_pref_extension_loader.h
index 9224b3b1b0432627f095693fd99d2456c8549d68..c6852d3f3909b46b7a8c17f6b88d9d2fcbee1660 100644
--- a/chrome/browser/extensions/external_pref_extension_loader.h
+++ b/chrome/browser/extensions/external_pref_extension_loader.h
@@ -19,7 +19,12 @@
// thread and they are expecting public method calls from the UI thread.
class ExternalPrefExtensionLoader : public ExternalExtensionLoader {
public:
- ExternalPrefExtensionLoader();
+ // |base_path_key| is the directory containing the external_extensions.json
+ // file. Relative file paths to extension files are resolved relative
+ // to this path.
+ explicit ExternalPrefExtensionLoader(int base_path_key);
+
+ virtual const FilePath GetBaseCrxFilePath();
protected:
virtual void StartLoading();
@@ -31,6 +36,9 @@ class ExternalPrefExtensionLoader : public ExternalExtensionLoader {
void LoadOnFileThread();
+ int base_path_key_;
+ FilePath base_path_;
+
DISALLOW_COPY_AND_ASSIGN(ExternalPrefExtensionLoader);
};
@@ -38,7 +46,11 @@ class ExternalPrefExtensionLoader : public ExternalExtensionLoader {
// from json data specified in a string.
class ExternalTestingExtensionLoader : public ExternalExtensionLoader {
public:
- explicit ExternalTestingExtensionLoader(const std::string& json_data);
+ ExternalTestingExtensionLoader(
+ const std::string& json_data,
+ const FilePath& fake_base_path);
+
+ virtual const FilePath GetBaseCrxFilePath();
protected:
virtual void StartLoading();
@@ -48,6 +60,7 @@ class ExternalTestingExtensionLoader : public ExternalExtensionLoader {
virtual ~ExternalTestingExtensionLoader() {}
+ FilePath fake_base_path_;
scoped_ptr<DictionaryValue> testing_prefs_;
DISALLOW_COPY_AND_ASSIGN(ExternalTestingExtensionLoader);

Powered by Google App Engine
This is Rietveld 408576698