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

Unified Diff: chrome/browser/ui/webui/options2/core_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/core_options_handler2.cc
diff --git a/chrome/browser/ui/webui/options2/core_options_handler2.cc b/chrome/browser/ui/webui/options2/core_options_handler2.cc
index 226756b116d71471e2b5a503b0fe5d84c40db1de..3d2b58de4d4d8f445d0379384868c8c338faa64d 100644
--- a/chrome/browser/ui/webui/options2/core_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/core_options_handler2.cc
@@ -39,13 +39,10 @@ CoreOptionsHandler::CoreOptionsHandler()
CoreOptionsHandler::~CoreOptionsHandler() {}
-void CoreOptionsHandler::InitializeHandler() {
+void CoreOptionsHandler::InitializePage() {
clear_plugin_lso_data_enabled_.Init(prefs::kClearPluginLSODataEnabled,
Profile::FromWebUI(web_ui()),
this);
-}
-
-void CoreOptionsHandler::InitializePage() {
UpdateClearPluginLSOData();
}
@@ -134,8 +131,8 @@ void CoreOptionsHandler::Observe(int type,
void CoreOptionsHandler::RegisterMessages() {
registrar_.Init(Profile::FromWebUI(web_ui())->GetPrefs());
- web_ui()->RegisterMessageCallback("coreOptionsInitialize",
- base::Bind(&CoreOptionsHandler::HandleInitialize,
+ web_ui()->RegisterMessageCallback("coreOptionsInitializePages",
+ base::Bind(&CoreOptionsHandler::HandleInitializePages,
base::Unretained(this)));
web_ui()->RegisterMessageCallback("fetchPrefs",
base::Bind(&CoreOptionsHandler::HandleFetchPrefs,
@@ -169,9 +166,9 @@ void CoreOptionsHandler::RegisterMessages() {
base::Unretained(this)));
}
-void CoreOptionsHandler::HandleInitialize(const ListValue* args) {
+void CoreOptionsHandler::HandleInitializePages(const ListValue* args) {
DCHECK(handlers_host_);
- handlers_host_->InitializeHandlers();
+ handlers_host_->InitializePages();
}
base::Value* CoreOptionsHandler::FetchPref(const std::string& pref_name) {

Powered by Google App Engine
This is Rietveld 408576698