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

Unified Diff: chrome/browser/views/options/general_page_view.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/views/options/general_page_view.h ('k') | chrome/test/testing_profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/options/general_page_view.cc
diff --git a/chrome/browser/views/options/general_page_view.cc b/chrome/browser/views/options/general_page_view.cc
index 830dac14601d51ad9542ff2721672648863daf6d..d618770cb6466d3585aa5898f4ea57912a0066da 100644
--- a/chrome/browser/views/options/general_page_view.cc
+++ b/chrome/browser/views/options/general_page_view.cc
@@ -217,9 +217,6 @@ GeneralPageView::GeneralPageView(Profile* profile)
}
GeneralPageView::~GeneralPageView() {
- profile()->GetPrefs()->RemovePrefObserver(prefs::kRestoreOnStartup, this);
- profile()->GetPrefs()->RemovePrefObserver(
- prefs::kURLsToRestoreOnStartup, this);
if (startup_custom_pages_table_)
startup_custom_pages_table_->SetModel(NULL);
default_browser_worker_->ObserverDestroyed();
@@ -356,8 +353,9 @@ void GeneralPageView::InitControlLayout() {
#endif
// Register pref observers that update the controls when a pref changes.
- profile()->GetPrefs()->AddPrefObserver(prefs::kRestoreOnStartup, this);
- profile()->GetPrefs()->AddPrefObserver(prefs::kURLsToRestoreOnStartup, this);
+ registrar_.Init(profile()->GetPrefs());
+ registrar_.Add(prefs::kRestoreOnStartup, this);
+ registrar_.Add(prefs::kURLsToRestoreOnStartup, this);
new_tab_page_is_home_page_.Init(prefs::kHomePageIsNewTabPage,
profile()->GetPrefs(), this);
« no previous file with comments | « chrome/browser/views/options/general_page_view.h ('k') | chrome/test/testing_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698