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

Side by Side Diff: base/prefs/pref_notifier_impl.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_member_unittest.cc ('k') | base/prefs/pref_notifier_impl.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_NOTIFIER_IMPL_H_ 5 #ifndef BASE_PREFS_PREF_NOTIFIER_IMPL_H_
6 #define BASE_PREFS_PREF_NOTIFIER_IMPL_H_ 6 #define BASE_PREFS_PREF_NOTIFIER_IMPL_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 10
(...skipping 11 matching lines...) Expand all
22 // The PrefNotifier implementation used by the PrefService. 22 // The PrefNotifier implementation used by the PrefService.
23 class BASE_PREFS_EXPORT PrefNotifierImpl 23 class BASE_PREFS_EXPORT PrefNotifierImpl
24 : public NON_EXPORTED_BASE(PrefNotifier) { 24 : public NON_EXPORTED_BASE(PrefNotifier) {
25 public: 25 public:
26 PrefNotifierImpl(); 26 PrefNotifierImpl();
27 explicit PrefNotifierImpl(PrefService* pref_service); 27 explicit PrefNotifierImpl(PrefService* pref_service);
28 ~PrefNotifierImpl() override; 28 ~PrefNotifierImpl() override;
29 29
30 // If the pref at the given path changes, we call the observer's 30 // If the pref at the given path changes, we call the observer's
31 // OnPreferenceChanged method. 31 // OnPreferenceChanged method.
32 void AddPrefObserver(const char* path, PrefObserver* observer); 32 void AddPrefObserver(const std::string& path, PrefObserver* observer);
33 void RemovePrefObserver(const char* path, PrefObserver* observer); 33 void RemovePrefObserver(const std::string& path, PrefObserver* observer);
34 34
35 // We run the callback once, when initialization completes. The bool 35 // We run the callback once, when initialization completes. The bool
36 // parameter will be set to true for successful initialization, 36 // parameter will be set to true for successful initialization,
37 // false for unsuccessful. 37 // false for unsuccessful.
38 void AddInitObserver(base::Callback<void(bool)> observer); 38 void AddInitObserver(base::Callback<void(bool)> observer);
39 39
40 void SetPrefService(PrefService* pref_service); 40 void SetPrefService(PrefService* pref_service);
41 41
42 protected: 42 protected:
43 // PrefNotifier overrides. 43 // PrefNotifier overrides.
(...skipping 20 matching lines...) Expand all
64 64
65 PrefObserverMap pref_observers_; 65 PrefObserverMap pref_observers_;
66 PrefInitObserverList init_observers_; 66 PrefInitObserverList init_observers_;
67 67
68 base::ThreadChecker thread_checker_; 68 base::ThreadChecker thread_checker_;
69 69
70 DISALLOW_COPY_AND_ASSIGN(PrefNotifierImpl); 70 DISALLOW_COPY_AND_ASSIGN(PrefNotifierImpl);
71 }; 71 };
72 72
73 #endif // BASE_PREFS_PREF_NOTIFIER_IMPL_H_ 73 #endif // BASE_PREFS_PREF_NOTIFIER_IMPL_H_
OLDNEW
« no previous file with comments | « base/prefs/pref_member_unittest.cc ('k') | base/prefs/pref_notifier_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698