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 28 matching lines...) Expand all Loading... |
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|. |
47 const autofill::PasswordForm* GetPasswordException(size_t index); | 47 const autofill::PasswordForm* GetPasswordException(size_t index); |
48 | 48 |
| 49 // Checks if |origin| is valid for adding a new password entry. |
| 50 static bool CheckOriginValidityForAdding(const GURL& origin); |
| 51 |
| 52 // Adds a new password entry with |origin|, |username_value|, and |
| 53 // |password_value|. |origin| should have been validated by |
| 54 // CheckOriginValidityForAdding, and |password_value| should be non-empty. |
| 55 void AddPassword(const GURL& origin, |
| 56 const base::string16& username_value, |
| 57 const base::string16& password_value); |
| 58 |
| 59 // Updates the entry at |index| with |password_value|. |password_value| |
| 60 // should be non-empty. |
| 61 void UpdatePassword(size_t index, const base::string16& password_value); |
| 62 |
49 // Removes the saved password entry at |index|. | 63 // Removes the saved password entry at |index|. |
50 // |index| the entry index to be removed. | 64 // |index| the entry index to be removed. |
51 void RemoveSavedPassword(size_t index); | 65 void RemoveSavedPassword(size_t index); |
52 | 66 |
53 // Removes the saved password exception entry at |index|. | 67 // Removes the saved password exception entry at |index|. |
54 // |index| the entry index to be removed. | 68 // |index| the entry index to be removed. |
55 void RemovePasswordException(size_t index); | 69 void RemovePasswordException(size_t index); |
56 | 70 |
57 // Requests the plain text password for entry at |index| to be revealed. | 71 // Requests the plain text password for entry at |index| to be revealed. |
58 // |index| The index of the entry. | 72 // |index| The index of the entry. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Used to determine whether or not to reveal plaintext passwords. | 143 // Used to determine whether or not to reveal plaintext passwords. |
130 base::TimeTicks last_authentication_time_; | 144 base::TimeTicks last_authentication_time_; |
131 | 145 |
132 // UI view that owns this presenter. | 146 // UI view that owns this presenter. |
133 PasswordUIView* password_view_; | 147 PasswordUIView* password_view_; |
134 | 148 |
135 DISALLOW_COPY_AND_ASSIGN(PasswordManagerPresenter); | 149 DISALLOW_COPY_AND_ASSIGN(PasswordManagerPresenter); |
136 }; | 150 }; |
137 | 151 |
138 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ | 152 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_MANAGER_PRESENTER_H_ |
OLD | NEW |