| 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" | |
| 13 #include "chrome/browser/api/prefs/pref_member.h" | 12 #include "chrome/browser/api/prefs/pref_member.h" |
| 14 #include "chrome/browser/password_manager/password_store.h" | 13 #include "chrome/browser/password_manager/password_store.h" |
| 15 #include "chrome/browser/password_manager/password_store_consumer.h" | 14 #include "chrome/browser/password_manager/password_store_consumer.h" |
| 16 #include "chrome/browser/ui/webui/options/options_ui.h" | 15 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 17 | 16 |
| 18 namespace content { | 17 namespace content { |
| 19 struct PasswordForm; | 18 struct PasswordForm; |
| 20 } | 19 } |
| 21 | 20 |
| 22 namespace options { | 21 namespace options { |
| 23 | 22 |
| 24 class PasswordManagerHandler : public OptionsPageUIHandler, | 23 class PasswordManagerHandler : public OptionsPageUIHandler, |
| 25 public PasswordStore::Observer, | 24 public PasswordStore::Observer { |
| 26 public PrefObserver { | |
| 27 public: | 25 public: |
| 28 PasswordManagerHandler(); | 26 PasswordManagerHandler(); |
| 29 virtual ~PasswordManagerHandler(); | 27 virtual ~PasswordManagerHandler(); |
| 30 | 28 |
| 31 // OptionsPageUIHandler implementation. | 29 // OptionsPageUIHandler implementation. |
| 32 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; | 30 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; |
| 33 virtual void InitializeHandler() OVERRIDE; | 31 virtual void InitializeHandler() OVERRIDE; |
| 34 virtual void RegisterMessages() OVERRIDE; | 32 virtual void RegisterMessages() OVERRIDE; |
| 35 | 33 |
| 36 // PasswordStore::Observer implementation. | 34 // PasswordStore::Observer implementation. |
| 37 virtual void OnLoginsChanged() OVERRIDE; | 35 virtual void OnLoginsChanged() OVERRIDE; |
| 38 | 36 |
| 39 // PrefObserver implementation. | |
| 40 virtual void OnPreferenceChanged(PrefServiceBase* service, | |
| 41 const std::string& pref_name) OVERRIDE; | |
| 42 | |
| 43 private: | 37 private: |
| 44 // The password store associated with the currently active profile. | 38 // The password store associated with the currently active profile. |
| 45 PasswordStore* GetPasswordStore(); | 39 PasswordStore* GetPasswordStore(); |
| 46 | 40 |
| 47 // Called when the JS PasswordManager object is initialized. | 41 // Called when the JS PasswordManager object is initialized. |
| 48 void UpdatePasswordLists(const ListValue* args); | 42 void UpdatePasswordLists(const ListValue* args); |
| 49 | 43 |
| 50 // Remove an entry. | 44 // Remove an entry. |
| 51 // @param value the entry index to be removed. | 45 // @param value the entry index to be removed. |
| 52 void RemoveSavedPassword(const ListValue* args); | 46 void RemoveSavedPassword(const ListValue* args); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 123 |
| 130 // Whether to show stored passwords or not. | 124 // Whether to show stored passwords or not. |
| 131 BooleanPrefMember show_passwords_; | 125 BooleanPrefMember show_passwords_; |
| 132 | 126 |
| 133 DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); | 127 DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); |
| 134 }; | 128 }; |
| 135 | 129 |
| 136 } // namespace options | 130 } // namespace options |
| 137 | 131 |
| 138 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ | 132 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ |
| OLD | NEW |