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

Side by Side Diff: base/prefs/pref_registry.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_notifier_impl_unittest.cc ('k') | base/prefs/pref_registry.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_H_ 5 #ifndef BASE_PREFS_PREF_REGISTRY_H_
6 #define BASE_PREFS_PREF_REGISTRY_H_ 6 #define BASE_PREFS_PREF_REGISTRY_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/prefs/base_prefs_export.h" 9 #include "base/prefs/base_prefs_export.h"
10 #include "base/prefs/pref_value_map.h" 10 #include "base/prefs/pref_value_map.h"
(...skipping 23 matching lines...) Expand all
34 // Gets the registered defaults. 34 // Gets the registered defaults.
35 scoped_refptr<PrefStore> defaults(); 35 scoped_refptr<PrefStore> defaults();
36 36
37 // Allows iteration over defaults. 37 // Allows iteration over defaults.
38 const_iterator begin() const; 38 const_iterator begin() const;
39 const_iterator end() const; 39 const_iterator end() const;
40 40
41 // Changes the default value for a preference. Takes ownership of |value|. 41 // Changes the default value for a preference. Takes ownership of |value|.
42 // 42 //
43 // |pref_name| must be a previously registered preference. 43 // |pref_name| must be a previously registered preference.
44 void SetDefaultPrefValue(const char* pref_name, base::Value* value); 44 void SetDefaultPrefValue(const std::string& pref_name, base::Value* value);
45 45
46 protected: 46 protected:
47 friend class base::RefCounted<PrefRegistry>; 47 friend class base::RefCounted<PrefRegistry>;
48 virtual ~PrefRegistry(); 48 virtual ~PrefRegistry();
49 49
50 // Used by subclasses to register a default value for a preference. 50 // Used by subclasses to register a default value for a preference.
51 void RegisterPreference(const char* path, base::Value* default_value); 51 void RegisterPreference(const std::string& path, base::Value* default_value);
52 52
53 scoped_refptr<DefaultPrefStore> defaults_; 53 scoped_refptr<DefaultPrefStore> defaults_;
54 54
55 private: 55 private:
56 DISALLOW_COPY_AND_ASSIGN(PrefRegistry); 56 DISALLOW_COPY_AND_ASSIGN(PrefRegistry);
57 }; 57 };
58 58
59 #endif // BASE_PREFS_PREF_REGISTRY_H_ 59 #endif // BASE_PREFS_PREF_REGISTRY_H_
OLDNEW
« no previous file with comments | « base/prefs/pref_notifier_impl_unittest.cc ('k') | base/prefs/pref_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698