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

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 LKGR. Created 8 years, 2 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/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..e529aca8d8213144c2d2f374a6b2baecec3cdb1b 100644
--- a/chrome/browser/ui/webui/options/password_manager_handler.cc
+++ b/chrome/browser/ui/webui/options/password_manager_handler.cc
@@ -109,18 +109,12 @@ 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);
- }
- }
+void PasswordManagerHandler::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ DCHECK_EQ(std::string(prefs::kPasswordManagerAllowShowPasswords), pref_name);
+ UpdatePasswordLists(NULL);
- OptionsPageUIHandler::Observe(type, source, details);
+ // No need to forward to base class as it is not a PrefObserver.
Mattias Nissler (ping if slow) 2012/10/31 13:29:36 See my other comment, let's remove this.
Jói 2012/10/31 14:56:26 Done.
}
void PasswordManagerHandler::UpdatePasswordLists(const ListValue* args) {

Powered by Google App Engine
This is Rietveld 408576698