summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_prefs.h
diff options
context:
space:
mode:
authorrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 21:03:23 +0000
committerrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 21:03:23 +0000
commita9b00acc0c03fff42673e3eb0d953768640a5fb1 (patch)
tree06b8d431e7760a10fcab5ee2a2493b8b22118fca /chrome/browser/extensions/extension_prefs.h
parent6501bc016d78c6d419b89bf991314148e6e4494b (diff)
downloadchromium_src-a9b00acc0c03fff42673e3eb0d953768640a5fb1.zip
chromium_src-a9b00acc0c03fff42673e3eb0d953768640a5fb1.tar.gz
chromium_src-a9b00acc0c03fff42673e3eb0d953768640a5fb1.tar.bz2
Refactored ExtensionsPrefs to store paths relative to the extensions install directory. Fix & reenabled two extensions_service unit_tests.
R=erikkay BUG=14714 Review URL: http://codereview.chromium.org/140018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19285 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_prefs.h')
-rw-r--r--chrome/browser/extensions/extension_prefs.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h
index be769a2..277b9c3 100644
--- a/chrome/browser/extensions/extension_prefs.h
+++ b/chrome/browser/extensions/extension_prefs.h
@@ -19,7 +19,7 @@
// from there.
class ExtensionPrefs {
public:
- explicit ExtensionPrefs(PrefService* prefs);
+ explicit ExtensionPrefs(PrefService* prefs, const FilePath& root_dir_);
// Returns a copy of the Extensions prefs.
// TODO(erikkay) Remove this so that external consumers don't need to be
@@ -43,7 +43,19 @@ class ExtensionPrefs {
void OnExtensionUninstalled(const Extension* extension,
bool external_uninstall);
+ // Returns base extensions install directory.
+ const FilePath& install_directory() const { return install_directory_; }
+
private:
+
+ // Converts absolute paths in the pref to paths relative to the
+ // install_directory_.
+ void MakePathsRelative();
+
+ // Converts internal relative paths to be absolute. Used for export to
+ // consumers who expect full paths.
+ void MakePathsAbsolute(DictionaryValue* dict);
+
// Sets the pref |key| for extension |id| to |value|.
bool UpdateExtensionPref(const std::string& id,
const std::wstring& key,
@@ -58,6 +70,9 @@ class ExtensionPrefs {
// The pref service specific to this set of extension prefs.
PrefService* prefs_;
+ // Base extensions install directory.
+ FilePath install_directory_;
+
// The URLs of all of the toolstrips.
URLList shelf_order_;