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

Side by Side Diff: chrome/browser/prefs/pref_service_syncable.cc

Issue 12330008: Get rid of the ability to unregister preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser_tests that tested migration in PrefsTabHelper. Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/prefs/pref_service_syncable.h" 5 #include "chrome/browser/prefs/pref_service_syncable.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/prefs/default_pref_store.h" 9 #include "base/prefs/default_pref_store.h"
10 #include "base/prefs/overlay_user_pref_store.h" 10 #include "base/prefs/overlay_user_pref_store.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // copies will be out of sync. 125 // copies will be out of sync.
126 DCHECK(!pref_service_forked_); 126 DCHECK(!pref_service_forked_);
127 PrefService::UpdateCommandLinePrefStore(cmd_line_store); 127 PrefService::UpdateCommandLinePrefStore(cmd_line_store);
128 } 128 }
129 129
130 void PrefServiceSyncable::AddRegisteredSyncablePreference(const char* path) { 130 void PrefServiceSyncable::AddRegisteredSyncablePreference(const char* path) {
131 DCHECK(FindPreference(path)); 131 DCHECK(FindPreference(path));
132 pref_sync_associator_.RegisterPref(path); 132 pref_sync_associator_.RegisterPref(path);
133 } 133 }
134 134
135 void PrefServiceSyncable::RemoveRegisteredPreference(const char* path) {
136 PrefService::RemoveRegisteredPreference(path);
137
138 if (pref_sync_associator_.IsPrefRegistered(path))
139 pref_sync_associator_.UnregisterPref(path);
140 }
141
142 void PrefServiceSyncable::OnIsSyncingChanged() { 135 void PrefServiceSyncable::OnIsSyncingChanged() {
143 FOR_EACH_OBSERVER(PrefServiceSyncableObserver, observer_list_, 136 FOR_EACH_OBSERVER(PrefServiceSyncableObserver, observer_list_,
144 OnIsSyncingChanged()); 137 OnIsSyncingChanged());
145 } 138 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698