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

Unified Diff: chrome/browser/ui/webui/options2/browser_options_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/browser_options_handler2.cc
diff --git a/chrome/browser/ui/webui/options2/browser_options_handler2.cc b/chrome/browser/ui/webui/options2/browser_options_handler2.cc
index 7756a54a9829790901497ce3e79ce1cd720ce593..4c888df533726d470c7bc38807c16501774049cc 100644
--- a/chrome/browser/ui/webui/options2/browser_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/browser_options_handler2.cc
@@ -542,17 +542,20 @@ void BrowserOptionsHandler::OnStateChanged() {
void BrowserOptionsHandler::InitializeHandler() {
Profile* profile = Profile::FromWebUI(web_ui());
+
+ // Create our favicon data source.
+ profile->GetChromeURLDataManager()->AddDataSource(
+ new FaviconSource(profile, FaviconSource::FAVICON));
+}
+
+void BrowserOptionsHandler::InitializePage() {
+ Profile* profile = Profile::FromWebUI(web_ui());
PrefService* prefs = profile->GetPrefs();
ProfileSyncService* sync_service(
ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile));
if (sync_service)
sync_service->AddObserver(this);
- OnStateChanged();
-
- // Create our favicon data source.
- profile->GetChromeURLDataManager()->AddDataSource(
- new FaviconSource(profile, FaviconSource::FAVICON));
default_browser_policy_.Init(prefs::kDefaultBrowserSettingEnabled,
g_browser_process->local_state(),
@@ -607,9 +610,8 @@ void BrowserOptionsHandler::InitializeHandler() {
proxy_prefs_.reset(
PrefSetObserver::CreateProxyPrefSetObserver(prefs, this));
#endif // !defined(OS_CHROMEOS)
-}
-void BrowserOptionsHandler::InitializePage() {
+ OnStateChanged();
OnTemplateURLServiceChanged();
ObserveThemeChanged();

Powered by Google App Engine
This is Rietveld 408576698