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

Side by Side Diff: base/prefs/public/pref_change_registrar.h

Issue 11293249: Remove PrefObserver usage, batch 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to LKGR Created 8 years, 1 month 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
« no previous file with comments | « no previous file | base/prefs/public/pref_change_registrar.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_PUBLIC_PREF_CHANGE_REGISTRAR_H_ 5 #ifndef BASE_PREFS_PUBLIC_PREF_CHANGE_REGISTRAR_H_
6 #define BASE_PREFS_PUBLIC_PREF_CHANGE_REGISTRAR_H_ 6 #define BASE_PREFS_PUBLIC_PREF_CHANGE_REGISTRAR_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 // Returns true if no pref observers are registered. 55 // Returns true if no pref observers are registered.
56 bool IsEmpty() const; 56 bool IsEmpty() const;
57 57
58 // Check whether |pref| is in the set of preferences being observed. 58 // Check whether |pref| is in the set of preferences being observed.
59 bool IsObserved(const std::string& pref); 59 bool IsObserved(const std::string& pref);
60 60
61 // Check whether any of the observed preferences has the managed bit set. 61 // Check whether any of the observed preferences has the managed bit set.
62 bool IsManaged(); 62 bool IsManaged();
63 63
64 // Return the PrefServiceBase for this registrar.
65 PrefServiceBase* prefs();
66
64 private: 67 private:
65 // PrefObserver: 68 // PrefObserver:
66 virtual void OnPreferenceChanged(PrefServiceBase* service, 69 virtual void OnPreferenceChanged(PrefServiceBase* service,
67 const std::string& pref_name) OVERRIDE; 70 const std::string& pref_name) OVERRIDE;
68 71
69 static void InvokeUnnamedCallback(const base::Closure& callback, 72 static void InvokeUnnamedCallback(const base::Closure& callback,
70 const std::string& pref_name); 73 const std::string& pref_name);
71 74
72 typedef std::map<std::string, NamedChangeCallback> ObserverMap; 75 typedef std::map<std::string, NamedChangeCallback> ObserverMap;
73 76
74 ObserverMap observers_; 77 ObserverMap observers_;
75 PrefServiceBase* service_; 78 PrefServiceBase* service_;
76 79
77 DISALLOW_COPY_AND_ASSIGN(PrefChangeRegistrar); 80 DISALLOW_COPY_AND_ASSIGN(PrefChangeRegistrar);
78 }; 81 };
79 82
80 #endif // BASE_PREFS_PUBLIC_PREF_CHANGE_REGISTRAR_H_ 83 #endif // BASE_PREFS_PUBLIC_PREF_CHANGE_REGISTRAR_H_
OLDNEW
« no previous file with comments | « no previous file | base/prefs/public/pref_change_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698