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

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

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

Powered by Google App Engine
This is Rietveld 408576698