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

Unified Diff: chrome/common/pref_service.h

Issue 27354: Add FilePath setter/getter to pref service.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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/common/chrome_paths.cc ('k') | chrome/common/pref_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/pref_service.h
===================================================================
--- chrome/common/pref_service.h (revision 10837)
+++ chrome/common/pref_service.h (working copy)
@@ -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 @@
};
// |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 @@
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 @@
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 @@
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 @@
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 @@
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_;
« no previous file with comments | « chrome/common/chrome_paths.cc ('k') | chrome/common/pref_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698