diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-02 17:02:25 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-02 17:02:25 +0000 |
commit | 5879cef53e60384391c36e6d7e4062e8b763c976 (patch) | |
tree | 4718389bd1adff25f6741d630f2f87bf003e6574 /base/prefs/pref_service.cc | |
parent | 6f75eb5610fe3144a16942c4fd5da8eb59ec2146 (diff) | |
download | chromium_src-5879cef53e60384391c36e6d7e4062e8b763c976.zip chromium_src-5879cef53e60384391c36e6d7e4062e8b763c976.tar.gz chromium_src-5879cef53e60384391c36e6d7e4062e8b763c976.tar.bz2 |
Fix prefs registration in BrowserInstantController.
Registration should happen prior to PrefService construction, so accepting a PrefService parameter to RegisterUserPrefs is a no-no.
To keep the existing semantics, this change adds a PrefService::SetDefaultPrefValue method that allows you to change the default value for a pref.
As BrowserInstantController was the last method called from chrome::RegisterUserPrefs that required a PrefService pointer, this also removes the PrefService parameter from the latter function and updates callers.
TBR=ben@chromium.org
BUG=155525
Review URL: https://chromiumcodereview.appspot.com/12315116
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185712 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/prefs/pref_service.cc')
-rw-r--r-- | base/prefs/pref_service.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/base/prefs/pref_service.cc b/base/prefs/pref_service.cc index 67ab898..b1f4f3f 100644 --- a/base/prefs/pref_service.cc +++ b/base/prefs/pref_service.cc @@ -273,6 +273,12 @@ const base::Value* PrefService::GetUserPrefValue(const char* path) const { return value; } +void PrefService::SetDefaultPrefValue(const char* path, + base::Value* value) { + DCHECK(CalledOnValidThread()); + pref_registry_->SetDefaultPrefValue(path, value); +} + const base::Value* PrefService::GetDefaultPrefValue(const char* path) const { DCHECK(CalledOnValidThread()); // Lookup the preference in the default store. |