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 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 // Request the plain text password for an entry to be revealed. | 58 // Request the plain text password for an entry to be revealed. |
59 // @param index The index of the entry. | 59 // @param index The index of the entry. |
60 void RequestShowPassword(const ListValue* args); | 60 void RequestShowPassword(const ListValue* args); |
61 | 61 |
62 // Sets the password and exception list contents to the given data. | 62 // Sets the password and exception list contents to the given data. |
63 // We take ownership of the PasswordForms in the vector. | 63 // We take ownership of the PasswordForms in the vector. |
64 void SetPasswordList(); | 64 void SetPasswordList(); |
65 void SetPasswordExceptionList(); | 65 void SetPasswordExceptionList(); |
66 | 66 |
| 67 // Returns true if the user needs to be authenticated before a plaintext |
| 68 // password is revealed. |
| 69 bool IsAuthenticationRequired(); |
| 70 |
67 // A short class to mediate requests to the password store. | 71 // A short class to mediate requests to the password store. |
68 class ListPopulater : public PasswordStoreConsumer { | 72 class ListPopulater : public PasswordStoreConsumer { |
69 public: | 73 public: |
70 explicit ListPopulater(PasswordManagerHandler* page); | 74 explicit ListPopulater(PasswordManagerHandler* page); |
71 virtual ~ListPopulater(); | 75 virtual ~ListPopulater(); |
72 | 76 |
73 // Send a query to the password store to populate a list. | 77 // Send a query to the password store to populate a list. |
74 virtual void Populate() = 0; | 78 virtual void Populate() = 0; |
75 | 79 |
76 protected: | 80 protected: |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 120 |
117 ScopedVector<autofill::PasswordForm> password_list_; | 121 ScopedVector<autofill::PasswordForm> password_list_; |
118 ScopedVector<autofill::PasswordForm> password_exception_list_; | 122 ScopedVector<autofill::PasswordForm> password_exception_list_; |
119 | 123 |
120 // User's pref | 124 // User's pref |
121 std::string languages_; | 125 std::string languages_; |
122 | 126 |
123 // Whether to show stored passwords or not. | 127 // Whether to show stored passwords or not. |
124 BooleanPrefMember show_passwords_; | 128 BooleanPrefMember show_passwords_; |
125 | 129 |
126 // Indicates whether or not the user has recently been authenticated. | 130 // Indicates whether or not the password manager should require the user to |
127 // Used to determine whether or not to reveal plain text passwords. | 131 // reauthenticate before revealing plaintext passwords. |
128 bool is_user_authenticated_; | 132 bool require_reauthentication_; |
| 133 |
| 134 // The last time the user was successfully authenticated. |
| 135 // Used to determine whether or not to reveal plaintext passwords. |
| 136 base::TimeTicks last_authentication_time_; |
129 | 137 |
130 DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); | 138 DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); |
131 }; | 139 }; |
132 | 140 |
133 } // namespace options | 141 } // namespace options |
134 | 142 |
135 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ | 143 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ |
OLD | NEW |