| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 password_autocomplete_set(true), | 69 password_autocomplete_set(true), |
| 70 new_password_marked_by_site(false), | 70 new_password_marked_by_site(false), |
| 71 ssl_valid(false), | 71 ssl_valid(false), |
| 72 preferred(false), | 72 preferred(false), |
| 73 blacklisted_by_user(false), | 73 blacklisted_by_user(false), |
| 74 type(TYPE_MANUAL), | 74 type(TYPE_MANUAL), |
| 75 times_used(0), | 75 times_used(0), |
| 76 generation_upload_status(NO_SIGNAL_SENT), | 76 generation_upload_status(NO_SIGNAL_SENT), |
| 77 skip_zero_click(false), | 77 skip_zero_click(false), |
| 78 layout(Layout::LAYOUT_OTHER), | 78 layout(Layout::LAYOUT_OTHER), |
| 79 was_parsed_using_autofill_predictions(false), | 79 was_parsed_using_autofill_predictions(false) { |
| 80 is_alive(true) { | |
| 81 } | 80 } |
| 82 | 81 |
| 83 PasswordForm::~PasswordForm() { | 82 PasswordForm::~PasswordForm() { |
| 84 CHECK(is_alive); | |
| 85 is_alive = false; | |
| 86 } | 83 } |
| 87 | 84 |
| 88 bool PasswordForm::IsPublicSuffixMatch() const { | 85 bool PasswordForm::IsPublicSuffixMatch() const { |
| 89 CHECK(is_alive); | |
| 90 return !original_signon_realm.empty(); | 86 return !original_signon_realm.empty(); |
| 91 } | 87 } |
| 92 | 88 |
| 93 bool PasswordForm::operator==(const PasswordForm& form) const { | 89 bool PasswordForm::operator==(const PasswordForm& form) const { |
| 94 return scheme == form.scheme && | 90 return scheme == form.scheme && |
| 95 signon_realm == form.signon_realm && | 91 signon_realm == form.signon_realm && |
| 96 original_signon_realm == form.original_signon_realm && | 92 original_signon_realm == form.original_signon_realm && |
| 97 origin == form.origin && | 93 origin == form.origin && |
| 98 action == form.action && | 94 action == form.action && |
| 99 submit_element == form.submit_element && | 95 submit_element == form.submit_element && |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 &form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string); | 159 &form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string); |
| 164 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string); | 160 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string); |
| 165 return os << "PasswordForm(" << form_as_string << ")"; | 161 return os << "PasswordForm(" << form_as_string << ")"; |
| 166 } | 162 } |
| 167 | 163 |
| 168 std::ostream& operator<<(std::ostream& os, PasswordForm* form) { | 164 std::ostream& operator<<(std::ostream& os, PasswordForm* form) { |
| 169 return os << "&" << *form; | 165 return os << "&" << *form; |
| 170 } | 166 } |
| 171 | 167 |
| 172 } // namespace autofill | 168 } // namespace autofill |
| OLD | NEW |