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

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

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments. 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
(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_simple.h"
6
7 #include "base/file_path.h"
8 #include "base/string_number_conversions.h"
9 #include "base/values.h"
10
11 PrefRegistrySimple::PrefRegistrySimple() {
12 }
13
14 void PrefRegistrySimple::RegisterBooleanPref(const char* path,
15 bool default_value) {
16 RegisterPreference(path, base::Value::CreateBooleanValue(default_value));
17 }
18
19 void PrefRegistrySimple::RegisterIntegerPref(const char* path,
20 int default_value) {
21 RegisterPreference(path, base::Value::CreateIntegerValue(default_value));
22 }
23
24 void PrefRegistrySimple::RegisterDoublePref(const char* path,
25 double default_value) {
26 RegisterPreference(path, base::Value::CreateDoubleValue(default_value));
27 }
28
29 void PrefRegistrySimple::RegisterStringPref(const char* path,
30 const std::string& default_value) {
31 RegisterPreference(path, base::Value::CreateStringValue(default_value));
32 }
33
34 void PrefRegistrySimple::RegisterFilePathPref(const char* path,
35 const FilePath& default_value) {
36 RegisterPreference(path,
37 base::Value::CreateStringValue(default_value.value()));
38 }
39
40 void PrefRegistrySimple::RegisterListPref(const char* path) {
41 RegisterPreference(path, new base::ListValue());
42 }
43
44 void PrefRegistrySimple::RegisterListPref(const char* path,
45 base::ListValue* default_value) {
46 RegisterPreference(path, default_value);
47 }
48
49 void PrefRegistrySimple::RegisterDictionaryPref(const char* path) {
50 RegisterPreference(path, new base::DictionaryValue());
51 }
52
53 void PrefRegistrySimple::RegisterDictionaryPref(
54 const char* path,
55 base::DictionaryValue* default_value) {
56 RegisterPreference(path, default_value);
57 }
58
59 void PrefRegistrySimple::RegisterInt64Pref(const char* path,
60 int64 default_value) {
61 RegisterPreference(
62 path, base::Value::CreateStringValue(base::Int64ToString(default_value)));
63 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698