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

Side by Side Diff: base/prefs/pref_registry_simple.h

Issue 753603002: Change preference APIs to take std::string instead of const char*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed all calls to c_str() in prefs. Created 6 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
« no previous file with comments | « base/prefs/pref_registry.cc ('k') | base/prefs/pref_registry_simple.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 #ifndef BASE_PREFS_PREF_REGISTRY_SIMPLE_H_ 5 #ifndef BASE_PREFS_PREF_REGISTRY_SIMPLE_H_
6 #define BASE_PREFS_PREF_REGISTRY_SIMPLE_H_ 6 #define BASE_PREFS_PREF_REGISTRY_SIMPLE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/prefs/base_prefs_export.h" 10 #include "base/prefs/base_prefs_export.h"
11 #include "base/prefs/pref_registry.h" 11 #include "base/prefs/pref_registry.h"
12 12
13 namespace base { 13 namespace base {
14 class DictionaryValue; 14 class DictionaryValue;
15 class FilePath; 15 class FilePath;
16 class ListValue; 16 class ListValue;
17 } 17 }
18 18
19 // A simple implementation of PrefRegistry. 19 // A simple implementation of PrefRegistry.
20 class BASE_PREFS_EXPORT PrefRegistrySimple : public PrefRegistry { 20 class BASE_PREFS_EXPORT PrefRegistrySimple : public PrefRegistry {
21 public: 21 public:
22 PrefRegistrySimple(); 22 PrefRegistrySimple();
23 23
24 void RegisterBooleanPref(const char* path, bool default_value); 24 void RegisterBooleanPref(const std::string& path, bool default_value);
25 void RegisterIntegerPref(const char* path, int default_value); 25 void RegisterIntegerPref(const std::string& path, int default_value);
26 void RegisterDoublePref(const char* path, double default_value); 26 void RegisterDoublePref(const std::string& path, double default_value);
27 void RegisterStringPref(const char* path, const std::string& default_value); 27 void RegisterStringPref(const std::string& path,
28 void RegisterFilePathPref(const char* path, 28 const std::string& default_value);
29 void RegisterFilePathPref(const std::string& path,
29 const base::FilePath& default_value); 30 const base::FilePath& default_value);
30 void RegisterListPref(const char* path); 31 void RegisterListPref(const std::string& path);
31 void RegisterDictionaryPref(const char* path); 32 void RegisterDictionaryPref(const std::string& path);
32 void RegisterListPref(const char* path, base::ListValue* default_value); 33 void RegisterListPref(const std::string& path,
33 void RegisterDictionaryPref(const char* path, 34 base::ListValue* default_value);
35 void RegisterDictionaryPref(const std::string& path,
34 base::DictionaryValue* default_value); 36 base::DictionaryValue* default_value);
35 void RegisterInt64Pref(const char* path, 37 void RegisterInt64Pref(const std::string& path, int64 default_value);
36 int64 default_value);
37 38
38 private: 39 private:
39 ~PrefRegistrySimple() override; 40 ~PrefRegistrySimple() override;
40 41
41 DISALLOW_COPY_AND_ASSIGN(PrefRegistrySimple); 42 DISALLOW_COPY_AND_ASSIGN(PrefRegistrySimple);
42 }; 43 };
43 44
44 #endif // BASE_PREFS_PREF_REGISTRY_SIMPLE_H_ 45 #endif // BASE_PREFS_PREF_REGISTRY_SIMPLE_H_
OLDNEW
« no previous file with comments | « base/prefs/pref_registry.cc ('k') | base/prefs/pref_registry_simple.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698