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

Unified Diff: chrome/browser/ui/webui/options/password_manager_handler.cc

Issue 7342026: WebUI: work around a crash triggered by a specific navigation in tabbed options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/password_manager_handler.cc
===================================================================
--- chrome/browser/ui/webui/options/password_manager_handler.cc (revision 92042)
+++ chrome/browser/ui/webui/options/password_manager_handler.cc (working copy)
@@ -76,6 +76,13 @@
}
void PasswordManagerHandler::Initialize() {
+ // Due to the way that handlers are (re)initialized under certain types of
+ // navigation, we may already be initialized. (See bugs 88986 and 86448.)
+ // If this is the case, return immediately. This is a hack.
+ // TODO(mdm): remove this hack once it is no longer necessary.
+ if (!show_passwords_.GetPrefName().empty())
+ return;
+
show_passwords_.Init(prefs::kPasswordManagerAllowShowPasswords,
web_ui_->GetProfile()->GetPrefs(), this);
// We should not cache web_ui_->GetProfile(). See crosbug.com/6304.
@@ -175,6 +182,13 @@
}
void PasswordManagerHandler::SetPasswordList() {
+ // Due to the way that handlers are (re)initialized under certain types of
+ // navigation, we may not be initialized yet. (See bugs 88986 and 86448.)
+ // If this is the case, initialize on demand. This is a hack.
+ // TODO(mdm): remove this hack once it is no longer necessary.
+ if (show_passwords_.GetPrefName().empty())
+ Initialize();
+
ListValue entries;
bool show_passwords = *show_passwords_;
string16 empty;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698