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

Unified Diff: chrome/browser/prefs/pref_service.cc

Issue 8879016: Add more per-tab preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CHECK -> DCHECK Created 9 years 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/prefs/pref_service.h ('k') | chrome/browser/prefs/pref_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/pref_service.cc
diff --git a/chrome/browser/prefs/pref_service.cc b/chrome/browser/prefs/pref_service.cc
index 6ec0802f56cc02639ea306d1fb768b70de0d1cbf..5022bddbdafb1c1c7305e6a22071d9c0facb52c8 100644
--- a/chrome/browser/prefs/pref_service.cc
+++ b/chrome/browser/prefs/pref_service.cc
@@ -745,6 +745,24 @@ void PrefService::RegisterPreference(const char* path,
pref_sync_associator_->RegisterPref(path);
}
+void PrefService::UnregisterPreference(const char* path) {
+ DCHECK(CalledOnValidThread());
+
+ Preference p(this, path, Value::TYPE_NULL);
+ PreferenceSet::const_iterator it = prefs_.find(&p);
+ if (it == prefs_.end()) {
+ NOTREACHED() << "Trying to unregister an unregistered pref: " << path;
+ return;
+ }
+
+ prefs_.erase(it);
+ default_store_->RemoveDefaultValue(path);
+ if (pref_sync_associator_.get() &&
+ pref_sync_associator_->IsPrefRegistered(path)) {
+ pref_sync_associator_->UnregisterPref(path);
+ }
+}
+
void PrefService::ClearPref(const char* path) {
DCHECK(CalledOnValidThread());
« no previous file with comments | « chrome/browser/prefs/pref_service.h ('k') | chrome/browser/prefs/pref_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698