| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/prefs/pref_member.h" | 11 #include "base/prefs/pref_member.h" |
| 12 #include "chrome/browser/ui/passwords/password_manager_presenter.h" | 12 #include "chrome/browser/ui/passwords/password_manager_presenter.h" |
| 13 #include "chrome/browser/ui/passwords/password_ui_view.h" | 13 #include "chrome/browser/ui/passwords/password_ui_view.h" |
| 14 #include "chrome/browser/ui/webui/options/options_ui.h" | 14 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 15 | 15 |
| 16 namespace options { | 16 namespace options { |
| 17 | 17 |
| 18 // The WebUI based PasswordUIView. Displays passwords in the web ui. | 18 // The WebUI based PasswordUIView. Displays passwords in the web ui. |
| 19 class PasswordManagerHandler : public OptionsPageUIHandler, | 19 class PasswordManagerHandler : public OptionsPageUIHandler, |
| 20 public PasswordUIView { | 20 public PasswordUIView { |
| 21 public: | 21 public: |
| 22 PasswordManagerHandler(); | 22 PasswordManagerHandler(); |
| 23 virtual ~PasswordManagerHandler(); | 23 ~PasswordManagerHandler() override; |
| 24 | 24 |
| 25 // OptionsPageUIHandler implementation. | 25 // OptionsPageUIHandler implementation. |
| 26 virtual void GetLocalizedValues( | 26 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; |
| 27 base::DictionaryValue* localized_strings) override; | 27 void InitializeHandler() override; |
| 28 virtual void InitializeHandler() override; | 28 void RegisterMessages() override; |
| 29 virtual void RegisterMessages() override; | |
| 30 | 29 |
| 31 // PasswordUIView implementation. | 30 // PasswordUIView implementation. |
| 32 virtual Profile* GetProfile() override; | 31 Profile* GetProfile() override; |
| 33 virtual void ShowPassword(size_t index, const base::string16& password_value) | 32 void ShowPassword(size_t index, |
| 34 override; | 33 const base::string16& password_value) override; |
| 35 virtual void SetPasswordList( | 34 void SetPasswordList( |
| 36 const ScopedVector<autofill::PasswordForm>& password_list, | 35 const ScopedVector<autofill::PasswordForm>& password_list, |
| 37 bool show_passwords) override; | 36 bool show_passwords) override; |
| 38 virtual void SetPasswordExceptionList( | 37 void SetPasswordExceptionList(const ScopedVector<autofill::PasswordForm>& |
| 39 const ScopedVector<autofill::PasswordForm>& password_exception_list) | 38 password_exception_list) override; |
| 40 override; | |
| 41 #if !defined(OS_ANDROID) | 39 #if !defined(OS_ANDROID) |
| 42 virtual gfx::NativeWindow GetNativeWindow() override; | 40 gfx::NativeWindow GetNativeWindow() override; |
| 43 #endif | 41 #endif |
| 44 private: | 42 private: |
| 45 // Clears and then populates the list of passwords and password exceptions. | 43 // Clears and then populates the list of passwords and password exceptions. |
| 46 // Called when the JS PasswordManager object is initialized. | 44 // Called when the JS PasswordManager object is initialized. |
| 47 void HandleUpdatePasswordLists(const base::ListValue* args); | 45 void HandleUpdatePasswordLists(const base::ListValue* args); |
| 48 | 46 |
| 49 // Removes a saved password entry. | 47 // Removes a saved password entry. |
| 50 // |value| the entry index to be removed. | 48 // |value| the entry index to be removed. |
| 51 void HandleRemoveSavedPassword(const base::ListValue* args); | 49 void HandleRemoveSavedPassword(const base::ListValue* args); |
| 52 | 50 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 63 | 61 |
| 64 // The PasswordManagerPresenter object owned by the this view. | 62 // The PasswordManagerPresenter object owned by the this view. |
| 65 PasswordManagerPresenter password_manager_presenter_; | 63 PasswordManagerPresenter password_manager_presenter_; |
| 66 | 64 |
| 67 DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); | 65 DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); |
| 68 }; | 66 }; |
| 69 | 67 |
| 70 } // namespace options | 68 } // namespace options |
| 71 | 69 |
| 72 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ | 70 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ |
| OLD | NEW |