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

Unified Diff: chrome/browser/ui/webui/options2/startup_pages_handler2.cc

Issue 9994005: Separate handler initialization from page initialization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move anything that indirectly calls JS to InitializePage Created 8 years, 8 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
Index: chrome/browser/ui/webui/options2/startup_pages_handler2.cc
diff --git a/chrome/browser/ui/webui/options2/startup_pages_handler2.cc b/chrome/browser/ui/webui/options2/startup_pages_handler2.cc
index e3d6fd4cbf6f407b2a42bfbdbac66c491533f042..fe5175b7582607451cf2c337cdab671240c7e70d 100644
--- a/chrome/browser/ui/webui/options2/startup_pages_handler2.cc
+++ b/chrome/browser/ui/webui/options2/startup_pages_handler2.cc
@@ -86,15 +86,15 @@ void StartupPagesHandler::InitializeHandler() {
startup_custom_pages_table_model_.reset(
new CustomHomePagesTableModel(profile));
- startup_custom_pages_table_model_->SetObserver(this);
-
pref_change_registrar_.Init(profile->GetPrefs());
- pref_change_registrar_.Add(prefs::kURLsToRestoreOnStartup, this);
-
- autocomplete_controller_.reset(new AutocompleteController(profile, this));
}
void StartupPagesHandler::InitializePage() {
+ Profile* profile = Profile::FromWebUI(web_ui());
+
+ startup_custom_pages_table_model_->SetObserver(this);
+ pref_change_registrar_.Add(prefs::kURLsToRestoreOnStartup, this);
+ autocomplete_controller_.reset(new AutocompleteController(profile, this));
UpdateStartupPages();
}

Powered by Google App Engine
This is Rietveld 408576698