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

Unified Diff: chrome/browser/dom_ui/shown_sections_handler.cc

Issue 3304015: Use PrefChangeRegistrar everywhere (Closed)
Patch Set: final version for commit Created 10 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/dom_ui/shown_sections_handler.h ('k') | chrome/browser/extensions/extension_toolbar_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/shown_sections_handler.cc
diff --git a/chrome/browser/dom_ui/shown_sections_handler.cc b/chrome/browser/dom_ui/shown_sections_handler.cc
index 78ff716bc882877ca02966022eee52cd0ccb35d2..e32511d171438d761f10f8114286be6fd6a02bd7 100644
--- a/chrome/browser/dom_ui/shown_sections_handler.cc
+++ b/chrome/browser/dom_ui/shown_sections_handler.cc
@@ -48,11 +48,8 @@ int ShownSectionsHandler::GetShownSections(PrefService* prefs) {
ShownSectionsHandler::ShownSectionsHandler(PrefService* pref_service)
: pref_service_(pref_service) {
- pref_service_->AddPrefObserver(prefs::kNTPShownSections, this);
-}
-
-ShownSectionsHandler::~ShownSectionsHandler() {
- pref_service_->RemovePrefObserver(prefs::kNTPShownSections, this);
+ registrar_.Init(pref_service);
+ registrar_.Add(prefs::kNTPShownSections, this);
}
void ShownSectionsHandler::RegisterMessages() {
« no previous file with comments | « chrome/browser/dom_ui/shown_sections_handler.h ('k') | chrome/browser/extensions/extension_toolbar_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698