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

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

Issue 10154004: re-use WebUIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WeakPtr solution 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
« no previous file with comments | « chrome/browser/ui/webui/options2/options_ui2.h ('k') | chrome/browser/ui/webui/tracing_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9bf6fc64d6bbd1dc576cdf1cdbf9b959e1020c90..c83db60999828f780912515b55c896adb766248a 100644
--- a/chrome/browser/ui/webui/options2/options_ui2.cc
+++ b/chrome/browser/ui/webui/options2/options_ui2.cc
@@ -340,16 +340,6 @@ void OptionsUI::RenderViewReused(RenderViewHost* render_view_host) {
SetCommandLineString(render_view_host);
}
-void OptionsUI::DidBecomeActiveForReusedRenderView() {
- // When the renderer is re-used (e.g., for back/forward navigation within
- // options), the handlers are torn down and rebuilt, so are no longer
- // initialized, but the web page's DOM may remain intact, in which case onload
- // won't fire to initilize the handlers. To make sure initialization always
- // happens, call reinitializeCore (which is a no-op unless the DOM was already
- // initialized).
- web_ui()->CallJavascriptFunction("OptionsPage.reinitializeCore");
-}
-
// static
void OptionsUI::ProcessAutocompleteSuggestions(
const AutocompleteResult& autocompleteResult,
@@ -381,24 +371,22 @@ void OptionsUI::InitializeHandlers() {
Profile* profile = Profile::FromWebUI(web_ui());
DCHECK(!profile->IsOffTheRecord() || Profile::IsGuestSession());
- // The reinitialize call from DidBecomeActiveForReusedRenderView end up being
- // 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.
+ // A new web page DOM has been brought up in an existing renderer, causing
+ // this method to be called twice. If that happens, ignore the second call.
if (!initialized_handlers_) {
for (size_t i = 0; i < handlers_.size(); ++i)
handlers_[i]->InitializeHandler();
initialized_handlers_ = true;
+
+#if defined(OS_CHROMEOS)
+ pointer_device_observer_->Init();
+#endif
}
// 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]->InitializePage();
-
-#if defined(OS_CHROMEOS)
- pointer_device_observer_->Init();
-#endif
}
void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings,
« no previous file with comments | « chrome/browser/ui/webui/options2/options_ui2.h ('k') | chrome/browser/ui/webui/tracing_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698