| 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_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ |
| 6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // PasswordStore operations and updates the view on PasswordStore changes. | 26 // PasswordStore operations and updates the view on PasswordStore changes. |
| 27 class PasswordManagerPresenter | 27 class PasswordManagerPresenter |
| 28 : public password_manager::PasswordStore::Observer { | 28 : public password_manager::PasswordStore::Observer { |
| 29 public: | 29 public: |
| 30 // |password_view| the UI view that owns this presenter, must not be NULL. | 30 // |password_view| the UI view that owns this presenter, must not be NULL. |
| 31 explicit PasswordManagerPresenter(PasswordUIView* password_view); | 31 explicit PasswordManagerPresenter(PasswordUIView* password_view); |
| 32 virtual ~PasswordManagerPresenter(); | 32 virtual ~PasswordManagerPresenter(); |
| 33 | 33 |
| 34 // PasswordStore::Observer implementation. | 34 // PasswordStore::Observer implementation. |
| 35 virtual void OnLoginsChanged( | 35 virtual void OnLoginsChanged( |
| 36 const password_manager::PasswordStoreChangeList& changes) OVERRIDE; | 36 const password_manager::PasswordStoreChangeList& changes) override; |
| 37 | 37 |
| 38 // Repopulates the password and exception entries. | 38 // Repopulates the password and exception entries. |
| 39 void UpdatePasswordLists(); | 39 void UpdatePasswordLists(); |
| 40 | 40 |
| 41 void Initialize(); | 41 void Initialize(); |
| 42 | 42 |
| 43 // Gets the password entry at |index|. | 43 // Gets the password entry at |index|. |
| 44 const autofill::PasswordForm* GetPassword(size_t index); | 44 const autofill::PasswordForm* GetPassword(size_t index); |
| 45 | 45 |
| 46 // Gets the password exception entry at |index|. | 46 // Gets the password exception entry at |index|. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 protected: | 84 protected: |
| 85 PasswordManagerPresenter* page_; | 85 PasswordManagerPresenter* page_; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 // A short class to mediate requests to the password store for passwordlist. | 88 // A short class to mediate requests to the password store for passwordlist. |
| 89 class PasswordListPopulater : public ListPopulater { | 89 class PasswordListPopulater : public ListPopulater { |
| 90 public: | 90 public: |
| 91 explicit PasswordListPopulater(PasswordManagerPresenter* page); | 91 explicit PasswordListPopulater(PasswordManagerPresenter* page); |
| 92 | 92 |
| 93 // Send a query to the password store to populate a password list. | 93 // Send a query to the password store to populate a password list. |
| 94 virtual void Populate() OVERRIDE; | 94 virtual void Populate() override; |
| 95 | 95 |
| 96 // Send the password store's reply back to the handler. | 96 // Send the password store's reply back to the handler. |
| 97 virtual void OnGetPasswordStoreResults( | 97 virtual void OnGetPasswordStoreResults( |
| 98 const std::vector<autofill::PasswordForm*>& results) OVERRIDE; | 98 const std::vector<autofill::PasswordForm*>& results) override; |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 // A short class to mediate requests to the password store for exceptions. | 101 // A short class to mediate requests to the password store for exceptions. |
| 102 class PasswordExceptionListPopulater : public ListPopulater { | 102 class PasswordExceptionListPopulater : public ListPopulater { |
| 103 public: | 103 public: |
| 104 explicit PasswordExceptionListPopulater(PasswordManagerPresenter* page); | 104 explicit PasswordExceptionListPopulater(PasswordManagerPresenter* page); |
| 105 | 105 |
| 106 // Send a query to the password store to populate a passwordException list. | 106 // Send a query to the password store to populate a passwordException list. |
| 107 virtual void Populate() OVERRIDE; | 107 virtual void Populate() override; |
| 108 | 108 |
| 109 // Send the password store's reply back to the handler. | 109 // Send the password store's reply back to the handler. |
| 110 virtual void OnGetPasswordStoreResults( | 110 virtual void OnGetPasswordStoreResults( |
| 111 const std::vector<autofill::PasswordForm*>& results) OVERRIDE; | 111 const std::vector<autofill::PasswordForm*>& results) override; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 // Password store consumer for populating the password list and exceptions. | 114 // Password store consumer for populating the password list and exceptions. |
| 115 PasswordListPopulater populater_; | 115 PasswordListPopulater populater_; |
| 116 PasswordExceptionListPopulater exception_populater_; | 116 PasswordExceptionListPopulater exception_populater_; |
| 117 | 117 |
| 118 ScopedVector<autofill::PasswordForm> password_list_; | 118 ScopedVector<autofill::PasswordForm> password_list_; |
| 119 ScopedVector<autofill::PasswordForm> password_exception_list_; | 119 ScopedVector<autofill::PasswordForm> password_exception_list_; |
| 120 | 120 |
| 121 // Whether to show stored passwords or not. | 121 // Whether to show stored passwords or not. |
| 122 BooleanPrefMember show_passwords_; | 122 BooleanPrefMember show_passwords_; |
| 123 | 123 |
| 124 // Indicates whether or not the password manager should require the user to | 124 // Indicates whether or not the password manager should require the user to |
| 125 // reauthenticate before revealing plaintext passwords. | 125 // reauthenticate before revealing plaintext passwords. |
| 126 bool require_reauthentication_; | 126 bool require_reauthentication_; |
| 127 | 127 |
| 128 // The last time the user was successfully authenticated. | 128 // The last time the user was successfully authenticated. |
| 129 // Used to determine whether or not to reveal plaintext passwords. | 129 // Used to determine whether or not to reveal plaintext passwords. |
| 130 base::TimeTicks last_authentication_time_; | 130 base::TimeTicks last_authentication_time_; |
| 131 | 131 |
| 132 // UI view that owns this presenter. | 132 // UI view that owns this presenter. |
| 133 PasswordUIView* password_view_; | 133 PasswordUIView* password_view_; |
| 134 | 134 |
| 135 DISALLOW_COPY_AND_ASSIGN(PasswordManagerPresenter); | 135 DISALLOW_COPY_AND_ASSIGN(PasswordManagerPresenter); |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ | 138 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ |
| OLD | NEW |