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

Unified Diff: chrome/browser/ui/webui/chromeos/proxy_settings_ui.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/chromeos/proxy_settings_ui.cc
diff --git a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
index 3c740748020b5c82b847ba34e84fe3a3e4adb2fa..44fc81cc8e143ceb471485affa0b076addf3ddea 100644
--- a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
@@ -79,14 +79,23 @@ ProxySettingsUI::ProxySettingsUI(content::WebUI* web_ui)
core_handler_->set_handlers_host(this);
core_handler_->GetLocalizedValues(localized_strings);
web_ui->AddMessageHandler(core_handler_);
+ core_handler_->InitializeHandler();
proxy_handler_->GetLocalizedValues(localized_strings);
web_ui->AddMessageHandler(proxy_handler_);
+ proxy_handler_->InitializeHandler();
ProxySettingsHTMLSource* source =
new ProxySettingsHTMLSource(localized_strings);
Profile* profile = Profile::FromWebUI(web_ui);
profile->GetChromeURLDataManager()->AddDataSource(source);
+
+ PrefProxyConfigTracker* proxy_tracker = profile->GetProxyConfigTracker();
+ proxy_tracker->UIMakeActiveNetworkCurrent();
+
+ std::string network_name;
+ proxy_tracker->UIGetCurrentNetworkName(&network_name);
+ proxy_handler_->SetNetworkName(network_name);
}
ProxySettingsUI::~ProxySettingsUI() {
@@ -96,17 +105,9 @@ ProxySettingsUI::~ProxySettingsUI() {
proxy_handler_->Uninitialize();
}
-void ProxySettingsUI::InitializeHandlers() {
- core_handler_->InitializeHandler();
- proxy_handler_->InitializeHandler();
+void ProxySettingsUI::InitializePages() {
core_handler_->InitializePage();
proxy_handler_->InitializePage();
- Profile* profile = Profile::FromWebUI(web_ui());
- PrefProxyConfigTracker* proxy_tracker = profile->GetProxyConfigTracker();
- proxy_tracker->UIMakeActiveNetworkCurrent();
- std::string network_name;
- proxy_tracker->UIGetCurrentNetworkName(&network_name);
- proxy_handler_->SetNetworkName(network_name);
}
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698