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

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

Issue 140018: Make ExtensionPrefs paths relative, re-enable 2 ExtensionsService unit_tests (Closed)
Patch Set: final changes Created 11 years, 6 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
« no previous file with comments | « chrome/browser/extensions/extension_browsertest.cc ('k') | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_prefs.h
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h
index be769a27a230a92dc1dc2c0c83ead95c9feb959d..277b9c34554a2e6e27ad162b2e54765ec79db5f1 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_;
« no previous file with comments | « chrome/browser/extensions/extension_browsertest.cc ('k') | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698