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 25 matching lines...) Expand all Loading... |
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 all password entries. |
| 47 ScopedVector<autofill::PasswordForm> GetAllPasswords(); |
| 48 |
46 // Gets the password exception entry at |index|. | 49 // Gets the password exception entry at |index|. |
47 const autofill::PasswordForm* GetPasswordException(size_t index); | 50 const autofill::PasswordForm* GetPasswordException(size_t index); |
48 | 51 |
| 52 // Returns the password store associated with the currently active profile. |
| 53 password_manager::PasswordStore* GetPasswordStore(); |
| 54 |
49 // Removes the saved password entry at |index|. | 55 // Removes the saved password entry at |index|. |
50 // |index| the entry index to be removed. | 56 // |index| the entry index to be removed. |
51 void RemoveSavedPassword(size_t index); | 57 void RemoveSavedPassword(size_t index); |
52 | 58 |
53 // Removes the saved password exception entry at |index|. | 59 // Removes the saved password exception entry at |index|. |
54 // |index| the entry index to be removed. | 60 // |index| the entry index to be removed. |
55 void RemovePasswordException(size_t index); | 61 void RemovePasswordException(size_t index); |
56 | 62 |
57 // Requests the plain text password for entry at |index| to be revealed. | 63 // Requests the plain text password for entry at |index| to be revealed. |
58 // |index| The index of the entry. | 64 // |index| The index of the entry. |
59 void RequestShowPassword(size_t index); | 65 void RequestShowPassword(size_t index); |
60 | 66 |
| 67 // Returns true if the user is authenticated. |
| 68 virtual bool IsUserAuthenticated(); |
| 69 |
61 private: | 70 private: |
62 friend class PasswordManagerPresenterTest; | 71 friend class PasswordManagerPresenterTest; |
63 | 72 |
64 // Returns the password store associated with the currently active profile. | |
65 password_manager::PasswordStore* GetPasswordStore(); | |
66 | |
67 // Returns true if the user needs to be authenticated before a plaintext | 73 // Returns true if the user needs to be authenticated before a plaintext |
68 // password is revealed. | 74 // password is revealed or exported. |
69 bool IsAuthenticationRequired(); | 75 bool IsAuthenticationRequired(); |
70 | 76 |
71 // Sets the password and exception list of the UI view. | 77 // Sets the password and exception list of the UI view. |
72 void SetPasswordList(); | 78 void SetPasswordList(); |
73 void SetPasswordExceptionList(); | 79 void SetPasswordExceptionList(); |
74 | 80 |
75 // A short class to mediate requests to the password store. | 81 // A short class to mediate requests to the password store. |
76 class ListPopulater : public password_manager::PasswordStoreConsumer { | 82 class ListPopulater : public password_manager::PasswordStoreConsumer { |
77 public: | 83 public: |
78 explicit ListPopulater(PasswordManagerPresenter* page); | 84 explicit ListPopulater(PasswordManagerPresenter* page); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // UI view that owns this presenter. | 138 // UI view that owns this presenter. |
133 PasswordUIView* password_view_; | 139 PasswordUIView* password_view_; |
134 | 140 |
135 // User pref for storing accept languages. | 141 // User pref for storing accept languages. |
136 std::string languages_; | 142 std::string languages_; |
137 | 143 |
138 DISALLOW_COPY_AND_ASSIGN(PasswordManagerPresenter); | 144 DISALLOW_COPY_AND_ASSIGN(PasswordManagerPresenter); |
139 }; | 145 }; |
140 | 146 |
141 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ | 147 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ |
OLD | NEW |