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 COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
6 #define COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 6 #define COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 // TODO(vabr): Remove |is_alive| once http://crbug.com/486931 is fixed. | 271 // TODO(vabr): Remove |is_alive| once http://crbug.com/486931 is fixed. |
272 bool is_alive; // Set on construction, reset on destruction. | 272 bool is_alive; // Set on construction, reset on destruction. |
273 | 273 |
274 // Returns true if this match was found using public suffix matching. | 274 // Returns true if this match was found using public suffix matching. |
275 bool IsPublicSuffixMatch() const; | 275 bool IsPublicSuffixMatch() const; |
276 | 276 |
277 // Return true if we consider this form to be a change password form. | 277 // Return true if we consider this form to be a change password form. |
278 // We use only client heuristics, so it could include signup forms. | 278 // We use only client heuristics, so it could include signup forms. |
279 bool IsPossibleChangePasswordForm() const; | 279 bool IsPossibleChangePasswordForm() const; |
280 | 280 |
| 281 // Return true if we consider this form to be a change password form |
| 282 // without username field. We use only client heuristics, so it could |
| 283 // include signup forms. |
| 284 bool IsPossibleChangePasswordFormWithoutUsername() const; |
| 285 |
281 // Equality operators for testing. | 286 // Equality operators for testing. |
282 bool operator==(const PasswordForm& form) const; | 287 bool operator==(const PasswordForm& form) const; |
283 bool operator!=(const PasswordForm& form) const; | 288 bool operator!=(const PasswordForm& form) const; |
284 | 289 |
285 PasswordForm(); | 290 PasswordForm(); |
286 ~PasswordForm(); | 291 ~PasswordForm(); |
287 }; | 292 }; |
288 | 293 |
289 // Map username to PasswordForm* for convenience. See password_form_manager.h. | 294 // Map username to PasswordForm* for convenience. See password_form_manager.h. |
290 typedef base::ScopedPtrMap<base::string16, scoped_ptr<PasswordForm>> | 295 typedef base::ScopedPtrMap<base::string16, scoped_ptr<PasswordForm>> |
291 PasswordFormMap; | 296 PasswordFormMap; |
292 | 297 |
293 // Like PasswordFormMap, but with weak (not owned) pointers. | 298 // Like PasswordFormMap, but with weak (not owned) pointers. |
294 typedef std::map<base::string16, const PasswordForm*> ConstPasswordFormMap; | 299 typedef std::map<base::string16, const PasswordForm*> ConstPasswordFormMap; |
295 | 300 |
296 // For testing. | 301 // For testing. |
297 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); | 302 std::ostream& operator<<(std::ostream& os, PasswordForm::Layout layout); |
298 std::ostream& operator<<(std::ostream& os, const autofill::PasswordForm& form); | 303 std::ostream& operator<<(std::ostream& os, const autofill::PasswordForm& form); |
299 std::ostream& operator<<(std::ostream& os, autofill::PasswordForm* form); | 304 std::ostream& operator<<(std::ostream& os, autofill::PasswordForm* form); |
300 | 305 |
301 } // namespace autofill | 306 } // namespace autofill |
302 | 307 |
303 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ | 308 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_FORM_H__ |
OLD | NEW |