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 #include <ostream> | 5 #include <ostream> |
6 #include <sstream> | 6 #include <sstream> |
7 | 7 |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 bool PasswordForm::IsPublicSuffixMatch() const { | 87 bool PasswordForm::IsPublicSuffixMatch() const { |
88 CHECK(is_alive); | 88 CHECK(is_alive); |
89 return !original_signon_realm.empty(); | 89 return !original_signon_realm.empty(); |
90 } | 90 } |
91 | 91 |
92 bool PasswordForm::IsPossibleChangePasswordForm() const { | 92 bool PasswordForm::IsPossibleChangePasswordForm() const { |
93 return !new_password_element.empty() && | 93 return !new_password_element.empty() && |
94 layout != PasswordForm::Layout::LAYOUT_LOGIN_AND_SIGNUP; | 94 layout != PasswordForm::Layout::LAYOUT_LOGIN_AND_SIGNUP; |
95 } | 95 } |
96 | 96 |
| 97 bool PasswordForm::IsPossibleChangePasswordFormWithoutUsername() const { |
| 98 return IsPossibleChangePasswordForm() && username_element.empty(); |
| 99 } |
| 100 |
97 bool PasswordForm::operator==(const PasswordForm& form) const { | 101 bool PasswordForm::operator==(const PasswordForm& form) const { |
98 return scheme == form.scheme && | 102 return scheme == form.scheme && |
99 signon_realm == form.signon_realm && | 103 signon_realm == form.signon_realm && |
100 original_signon_realm == form.original_signon_realm && | 104 original_signon_realm == form.original_signon_realm && |
101 origin == form.origin && | 105 origin == form.origin && |
102 action == form.action && | 106 action == form.action && |
103 submit_element == form.submit_element && | 107 submit_element == form.submit_element && |
104 username_element == form.username_element && | 108 username_element == form.username_element && |
105 username_marked_by_site == form.username_marked_by_site && | 109 username_marked_by_site == form.username_marked_by_site && |
106 username_value == form.username_value && | 110 username_value == form.username_value && |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string); | 170 form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string); |
167 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string); | 171 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string); |
168 return os << "PasswordForm(" << form_as_string << ")"; | 172 return os << "PasswordForm(" << form_as_string << ")"; |
169 } | 173 } |
170 | 174 |
171 std::ostream& operator<<(std::ostream& os, PasswordForm* form) { | 175 std::ostream& operator<<(std::ostream& os, PasswordForm* form) { |
172 return os << "&" << *form; | 176 return os << "&" << *form; |
173 } | 177 } |
174 | 178 |
175 } // namespace autofill | 179 } // namespace autofill |
OLD | NEW |