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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 PasswordForm::~PasswordForm() { | 83 PasswordForm::~PasswordForm() { |
84 CHECK(is_alive); | 84 CHECK(is_alive); |
85 is_alive = false; | 85 is_alive = false; |
86 } | 86 } |
87 | 87 |
88 bool PasswordForm::IsPublicSuffixMatch() const { | 88 bool PasswordForm::IsPublicSuffixMatch() const { |
89 CHECK(is_alive); | 89 CHECK(is_alive); |
90 return !original_signon_realm.empty(); | 90 return !original_signon_realm.empty(); |
91 } | 91 } |
92 | 92 |
| 93 bool PasswordForm::IsPossibleChangePasswordForm() const { |
| 94 return !new_password_element.empty() && |
| 95 layout != PasswordForm::Layout::LAYOUT_LOGIN_AND_SIGNUP; |
| 96 } |
| 97 |
93 bool PasswordForm::operator==(const PasswordForm& form) const { | 98 bool PasswordForm::operator==(const PasswordForm& form) const { |
94 return scheme == form.scheme && | 99 return scheme == form.scheme && |
95 signon_realm == form.signon_realm && | 100 signon_realm == form.signon_realm && |
96 original_signon_realm == form.original_signon_realm && | 101 original_signon_realm == form.original_signon_realm && |
97 origin == form.origin && | 102 origin == form.origin && |
98 action == form.action && | 103 action == form.action && |
99 submit_element == form.submit_element && | 104 submit_element == form.submit_element && |
100 username_element == form.username_element && | 105 username_element == form.username_element && |
101 username_marked_by_site == form.username_marked_by_site && | 106 username_marked_by_site == form.username_marked_by_site && |
102 username_value == form.username_value && | 107 username_value == form.username_value && |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string); | 168 form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string); |
164 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string); | 169 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string); |
165 return os << "PasswordForm(" << form_as_string << ")"; | 170 return os << "PasswordForm(" << form_as_string << ")"; |
166 } | 171 } |
167 | 172 |
168 std::ostream& operator<<(std::ostream& os, PasswordForm* form) { | 173 std::ostream& operator<<(std::ostream& os, PasswordForm* form) { |
169 return os << "&" << *form; | 174 return os << "&" << *form; |
170 } | 175 } |
171 | 176 |
172 } // namespace autofill | 177 } // namespace autofill |
OLD | NEW |