diff options
Diffstat (limited to 'chrome/common/pref_service.h')
-rw-r--r-- | chrome/common/pref_service.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/common/pref_service.h b/chrome/common/pref_service.h index 8cc375f..0a7690c 100644 --- a/chrome/common/pref_service.h +++ b/chrome/common/pref_service.h @@ -17,6 +17,7 @@ #include <set> +#include "base/file_path.h" #include "base/hash_tables.h" #include "base/non_thread_safe.h" #include "base/observer_list.h" @@ -76,7 +77,7 @@ class PrefService : public NonThreadSafe { }; // |pref_filename| is the path to the prefs file we will try to load or save to. - explicit PrefService(const std::wstring& pref_filename); + explicit PrefService(const FilePath& pref_filename); ~PrefService(); // Reloads the data from file. This should only be called when the importer @@ -108,6 +109,8 @@ class PrefService : public NonThreadSafe { double default_value); void RegisterStringPref(const wchar_t* path, const std::wstring& default_value); + void RegisterFilePathPref(const wchar_t* path, + const FilePath& default_value); void RegisterListPref(const wchar_t* path); void RegisterDictionaryPref(const wchar_t* path); @@ -131,6 +134,7 @@ class PrefService : public NonThreadSafe { int GetInteger(const wchar_t* path) const; double GetReal(const wchar_t* path) const; std::wstring GetString(const wchar_t* path) const; + FilePath GetFilePath(const wchar_t* path) const; // Returns the branch if it exists. If it's not a branch or the branch does // not exist, returns NULL. This does @@ -150,6 +154,7 @@ class PrefService : public NonThreadSafe { void SetInteger(const wchar_t* path, int value); void SetReal(const wchar_t* path, double value); void SetString(const wchar_t* path, const std::wstring& value); + void SetFilePath(const wchar_t* path, const FilePath& value); // Used to set the value of dictionary or list values in the pref tree. This // will create a dictionary or list if one does not exist in the pref tree. @@ -196,7 +201,7 @@ class PrefService : public NonThreadSafe { PrefService(); // Reads the data from the given file, returning true on success. - bool LoadPersistentPrefs(const std::wstring& file_path); + bool LoadPersistentPrefs(const FilePath& file_path); // Add a preference to the PreferenceMap. If the pref already exists, return // false. This method takes ownership of |pref|. @@ -218,7 +223,7 @@ class PrefService : public NonThreadSafe { scoped_ptr<DictionaryValue> transient_; // The filename that we're loading/saving the prefs to. - std::wstring pref_filename_; + FilePath pref_filename_; // Task used by ScheduleSavePersistentPrefs to avoid lots of little saves. ScopedRunnableMethodFactory<PrefService> save_preferences_factory_; |