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

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

Issue 11421029: Remove PrefObserver usages, batch 13. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/options/password_manager_handler.cc
diff --git a/chrome/browser/ui/webui/options/password_manager_handler.cc b/chrome/browser/ui/webui/options/password_manager_handler.cc
index 1aefb9b08ef78392f8d2daf34f169edcad569daf..a137a409fa7f778ed0eb1bfe3f2ec69dac851e5a 100644
--- a/chrome/browser/ui/webui/options/password_manager_handler.cc
+++ b/chrome/browser/ui/webui/options/password_manager_handler.cc
@@ -74,7 +74,10 @@ void PasswordManagerHandler::InitializeHandler() {
return;
show_passwords_.Init(prefs::kPasswordManagerAllowShowPasswords,
- Profile::FromWebUI(web_ui())->GetPrefs(), this);
+ Profile::FromWebUI(web_ui())->GetPrefs(),
+ base::Bind(&PasswordManagerHandler::UpdatePasswordLists,
+ base::Unretained(this),
+ static_cast<base::ListValue*>(NULL)));
// We should not cache web_ui()->GetProfile(). See crosbug.com/6304.
PasswordStore* store = GetPasswordStore();
if (store)
@@ -104,15 +107,8 @@ void PasswordManagerHandler::OnLoginsChanged() {
}
PasswordStore* PasswordManagerHandler::GetPasswordStore() {
- return PasswordStoreFactory::GetForProfile(
- Profile::FromWebUI(web_ui()),
- Profile::EXPLICIT_ACCESS);
-}
-
-void PasswordManagerHandler::OnPreferenceChanged(PrefServiceBase* service,
- const std::string& pref_name) {
- DCHECK_EQ(std::string(prefs::kPasswordManagerAllowShowPasswords), pref_name);
- UpdatePasswordLists(NULL);
+ return PasswordStoreFactory::GetForProfile(Profile::FromWebUI(web_ui()),
+ Profile::EXPLICIT_ACCESS);
}
void PasswordManagerHandler::UpdatePasswordLists(const ListValue* args) {

Powered by Google App Engine
This is Rietveld 408576698