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

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

Issue 9693032: [uber page] Split up initialization of handlers from initialization of webui pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright bumps Created 8 years, 9 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/options_ui2.cc
diff --git a/chrome/browser/ui/webui/options2/options_ui2.cc b/chrome/browser/ui/webui/options2/options_ui2.cc
index fe559e6f1248692d3a8531270d1bbed51d08ef22..e17a80066e2b81f8dab5d516d41b0eb6e77c31b8 100644
--- a/chrome/browser/ui/webui/options2/options_ui2.cc
+++ b/chrome/browser/ui/webui/options2/options_ui2.cc
@@ -311,12 +311,16 @@ void OptionsUI::InitializeHandlers() {
// delivered after a new web page DOM has been brought up in an existing
// renderer (due to IPC delays), causing this method to be called twice. If
// that happens, ignore the second call.
- if (initialized_handlers_)
- return;
- initialized_handlers_ = true;
+ if (!initialized_handlers_) {
+ for (size_t i = 0; i < handlers_.size(); ++i)
+ handlers_[i]->InitializeHandler();
+ initialized_handlers_ = true;
+ }
+ // Always initialize the page as when handlers are left over we still need to
+ // do various things like show/hide sections and send data to the Javascript.
for (size_t i = 0; i < handlers_.size(); ++i)
- handlers_[i]->Initialize();
+ handlers_[i]->InitializePage();
}
void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings,

Powered by Google App Engine
This is Rietveld 408576698