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

Side by Side Diff: base/prefs/default_pref_store.cc

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix double registration in Chrome Frame test. 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
« no previous file with comments | « base/prefs/default_pref_store.h ('k') | base/prefs/public/pref_change_registrar_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/prefs/default_pref_store.h" 5 #include "base/prefs/default_pref_store.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 7
8 using base::Value; 8 using base::Value;
9 9
10 DefaultPrefStore::DefaultPrefStore() {} 10 DefaultPrefStore::DefaultPrefStore() {}
11 11
12 bool DefaultPrefStore::GetValue( 12 bool DefaultPrefStore::GetValue(
13 const std::string& key, 13 const std::string& key,
14 const base::Value** result) const { 14 const base::Value** result) const {
15 return prefs_.GetValue(key, result); 15 return prefs_.GetValue(key, result);
16 } 16 }
17 17
18 void DefaultPrefStore::SetDefaultValue(const std::string& key, Value* value) { 18 void DefaultPrefStore::SetDefaultValue(const std::string& key, Value* value) {
19 DCHECK(!GetValue(key, NULL)); 19 DCHECK(!GetValue(key, NULL));
20 prefs_.SetValue(key, value); 20 prefs_.SetValue(key, value);
21 } 21 }
22 22
23 void DefaultPrefStore::RemoveDefaultValue(const std::string& key) { 23 void DefaultPrefStore::RemoveDefaultValue(const std::string& key) {
24 DCHECK(GetValue(key, NULL)); 24 DCHECK(GetValue(key, NULL));
25 prefs_.RemoveValue(key); 25 prefs_.RemoveValue(key);
26 } 26 }
27 27
28 base::Value::Type DefaultPrefStore::GetType(const std::string& key) const {
29 const Value* value = NULL;
30 return GetValue(key, &value) ? value->GetType() : Value::TYPE_NULL;
31 }
32
33 DefaultPrefStore::const_iterator DefaultPrefStore::begin() const { 28 DefaultPrefStore::const_iterator DefaultPrefStore::begin() const {
34 return prefs_.begin(); 29 return prefs_.begin();
35 } 30 }
36 31
37 DefaultPrefStore::const_iterator DefaultPrefStore::end() const { 32 DefaultPrefStore::const_iterator DefaultPrefStore::end() const {
38 return prefs_.end(); 33 return prefs_.end();
39 } 34 }
40 35
41 DefaultPrefStore::~DefaultPrefStore() {} 36 DefaultPrefStore::~DefaultPrefStore() {}
OLDNEW
« no previous file with comments | « base/prefs/default_pref_store.h ('k') | base/prefs/public/pref_change_registrar_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698