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

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

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit 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 73d6cb32def07b91ee0949d3e57a1e53f274001f..1aefb9b08ef78392f8d2daf34f169edcad569daf 100644
--- a/chrome/browser/ui/webui/options/password_manager_handler.cc
+++ b/chrome/browser/ui/webui/options/password_manager_handler.cc
@@ -109,18 +109,10 @@ PasswordStore* PasswordManagerHandler::GetPasswordStore() {
Profile::EXPLICIT_ACCESS);
}
-void PasswordManagerHandler::Observe(
- int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- if (type == chrome::NOTIFICATION_PREF_CHANGED) {
- std::string* pref_name = content::Details<std::string>(details).ptr();
- if (*pref_name == prefs::kPasswordManagerAllowShowPasswords) {
- UpdatePasswordLists(NULL);
- }
- }
-
- OptionsPageUIHandler::Observe(type, source, details);
+void PasswordManagerHandler::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ DCHECK_EQ(std::string(prefs::kPasswordManagerAllowShowPasswords), pref_name);
+ UpdatePasswordLists(NULL);
}
void PasswordManagerHandler::UpdatePasswordLists(const ListValue* args) {
« no previous file with comments | « chrome/browser/ui/webui/options/password_manager_handler.h ('k') | chrome/browser/ui/webui/options/preferences_browsertest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698