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

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

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to desired interfaces. Created 7 years, 11 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/prefs/pref_registry.h"
6
7 #include "chrome/browser/prefs/pref_service.h"
8
9 PrefRegistry::PrefRegistry()
10 : pref_service_(NULL),
11 default_prefs_(new DefaultPrefStore()) {
12 }
13
14 void PrefRegistry::DeprecatedUnregisterPreference(const char* path) {
15 DCHECK(pref_service_);
16 if (pref_service_)
17 pref_service_->UnregisterPreference(path);
Mattias Nissler (ping if slow) 2013/01/25 14:57:11 I'd rather not call into pref_service and back. Gi
Jói 2013/01/29 16:10:02 This needs to stay here (and be virtual) since Pre
18 }
19
20 void PrefRegistry::RetrieveDefaults(scoped_refptr<DefaultPrefStore>* result) {
21 result->swap(default_prefs_); // This releases the member reference.
Mattias Nissler (ping if slow) 2013/01/25 14:57:11 Why would we want to release the pointer here?
Jói 2013/01/29 16:10:02 This was meant as a belt-and-suspenders approach t
22 }
23
24 void PrefRegistry::RegisterPreference(const char* path,
25 base::Value* default_value) {
26 if (pref_service_) {
27 pref_service_->RegisterPreference(path, default_value, false);
28 } else {
29 default_prefs_->SetDefaultValue(path, default_value);
30 }
Mattias Nissler (ping if slow) 2013/01/25 14:57:11 It seems like instead of sometimes delegating to P
Jói 2013/01/29 16:10:02 Done, but PrefService still gets callbacks to upda
31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698