| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
| 12 #include "base/prefs/public/pref_observer.h" |
| 12 #include "chrome/browser/api/prefs/pref_member.h" | 13 #include "chrome/browser/api/prefs/pref_member.h" |
| 13 #include "chrome/browser/password_manager/password_store.h" | 14 #include "chrome/browser/password_manager/password_store.h" |
| 14 #include "chrome/browser/password_manager/password_store_consumer.h" | 15 #include "chrome/browser/password_manager/password_store_consumer.h" |
| 15 #include "chrome/browser/ui/webui/options/options_ui.h" | 16 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| 18 struct PasswordForm; | 19 struct PasswordForm; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace options { | 22 namespace options { |
| 22 | 23 |
| 23 class PasswordManagerHandler : public OptionsPageUIHandler, | 24 class PasswordManagerHandler |
| 24 public PasswordStore::Observer { | 25 : public OptionsPageUIHandler, |
| 26 public PasswordStore::Observer, |
| 27 public PrefObserver { |
| 25 public: | 28 public: |
| 26 PasswordManagerHandler(); | 29 PasswordManagerHandler(); |
| 27 virtual ~PasswordManagerHandler(); | 30 virtual ~PasswordManagerHandler(); |
| 28 | 31 |
| 29 // OptionsPageUIHandler implementation. | 32 // OptionsPageUIHandler implementation. |
| 30 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; | 33 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; |
| 31 virtual void InitializeHandler() OVERRIDE; | 34 virtual void InitializeHandler() OVERRIDE; |
| 32 virtual void RegisterMessages() OVERRIDE; | 35 virtual void RegisterMessages() OVERRIDE; |
| 33 | 36 |
| 34 // PasswordStore::Observer implementation. | 37 // PasswordStore::Observer implementation. |
| 35 virtual void OnLoginsChanged() OVERRIDE; | 38 virtual void OnLoginsChanged() OVERRIDE; |
| 36 | 39 |
| 37 // content::NotificationObserver implementation. | 40 // PrefObserver implementation. |
| 38 virtual void Observe(int type, | 41 virtual void OnPreferenceChanged(PrefServiceBase* service, |
| 39 const content::NotificationSource& source, | 42 const std::string& pref_name) OVERRIDE; |
| 40 const content::NotificationDetails& details) OVERRIDE; | |
| 41 | 43 |
| 42 private: | 44 private: |
| 43 // The password store associated with the currently active profile. | 45 // The password store associated with the currently active profile. |
| 44 PasswordStore* GetPasswordStore(); | 46 PasswordStore* GetPasswordStore(); |
| 45 | 47 |
| 46 // Called when the JS PasswordManager object is initialized. | 48 // Called when the JS PasswordManager object is initialized. |
| 47 void UpdatePasswordLists(const ListValue* args); | 49 void UpdatePasswordLists(const ListValue* args); |
| 48 | 50 |
| 49 // Remove an entry. | 51 // Remove an entry. |
| 50 // @param value the entry index to be removed. | 52 // @param value the entry index to be removed. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 130 |
| 129 // Whether to show stored passwords or not. | 131 // Whether to show stored passwords or not. |
| 130 BooleanPrefMember show_passwords_; | 132 BooleanPrefMember show_passwords_; |
| 131 | 133 |
| 132 DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); | 134 DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); |
| 133 }; | 135 }; |
| 134 | 136 |
| 135 } // namespace options | 137 } // namespace options |
| 136 | 138 |
| 137 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ | 139 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ |
| OLD | NEW |