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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 target->SetInteger("generation_upload_status", form.generation_upload_status); | 56 target->SetInteger("generation_upload_status", form.generation_upload_status); |
57 target->SetString("display_name", form.display_name); | 57 target->SetString("display_name", form.display_name); |
58 target->SetString("icon_url", form.icon_url.possibly_invalid_spec()); | 58 target->SetString("icon_url", form.icon_url.possibly_invalid_spec()); |
59 target->SetString("federation_origin", form.federation_origin.Serialize()); | 59 target->SetString("federation_origin", form.federation_origin.Serialize()); |
60 target->SetBoolean("skip_next_zero_click", form.skip_zero_click); | 60 target->SetBoolean("skip_next_zero_click", form.skip_zero_click); |
61 std::ostringstream layout_string_stream; | 61 std::ostringstream layout_string_stream; |
62 layout_string_stream << form.layout; | 62 layout_string_stream << form.layout; |
63 target->SetString("layout", layout_string_stream.str()); | 63 target->SetString("layout", layout_string_stream.str()); |
64 target->SetBoolean("was_parsed_using_autofill_predictions", | 64 target->SetBoolean("was_parsed_using_autofill_predictions", |
65 form.was_parsed_using_autofill_predictions); | 65 form.was_parsed_using_autofill_predictions); |
| 66 target->SetString("affiliated_web_realm", form.affiliated_web_realm); |
66 } | 67 } |
67 | 68 |
68 } // namespace | 69 } // namespace |
69 | 70 |
70 PasswordForm::PasswordForm() | 71 PasswordForm::PasswordForm() |
71 : scheme(SCHEME_HTML), | 72 : scheme(SCHEME_HTML), |
72 username_marked_by_site(false), | 73 username_marked_by_site(false), |
73 password_value_is_default(false), | 74 password_value_is_default(false), |
74 new_password_value_is_default(false), | 75 new_password_value_is_default(false), |
75 new_password_marked_by_site(false), | 76 new_password_marked_by_site(false), |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 form_data.SameFormAs(form.form_data) && | 120 form_data.SameFormAs(form.form_data) && |
120 generation_upload_status == form.generation_upload_status && | 121 generation_upload_status == form.generation_upload_status && |
121 display_name == form.display_name && icon_url == form.icon_url && | 122 display_name == form.display_name && icon_url == form.icon_url && |
122 // We compare the serialization of the origins here, as we want unique | 123 // We compare the serialization of the origins here, as we want unique |
123 // origins to compare as '=='. | 124 // origins to compare as '=='. |
124 federation_origin.Serialize() == form.federation_origin.Serialize() && | 125 federation_origin.Serialize() == form.federation_origin.Serialize() && |
125 skip_zero_click == form.skip_zero_click && layout == form.layout && | 126 skip_zero_click == form.skip_zero_click && layout == form.layout && |
126 was_parsed_using_autofill_predictions == | 127 was_parsed_using_autofill_predictions == |
127 form.was_parsed_using_autofill_predictions && | 128 form.was_parsed_using_autofill_predictions && |
128 is_public_suffix_match == form.is_public_suffix_match && | 129 is_public_suffix_match == form.is_public_suffix_match && |
129 is_affiliation_based_match == form.is_affiliation_based_match; | 130 is_affiliation_based_match == form.is_affiliation_based_match && |
| 131 affiliated_web_realm == form.affiliated_web_realm; |
130 } | 132 } |
131 | 133 |
132 bool PasswordForm::operator!=(const PasswordForm& form) const { | 134 bool PasswordForm::operator!=(const PasswordForm& form) const { |
133 return !operator==(form); | 135 return !operator==(form); |
134 } | 136 } |
135 | 137 |
136 bool ArePasswordFormUniqueKeyEqual(const PasswordForm& left, | 138 bool ArePasswordFormUniqueKeyEqual(const PasswordForm& left, |
137 const PasswordForm& right) { | 139 const PasswordForm& right) { |
138 return (left.signon_realm == right.signon_realm && | 140 return (left.signon_realm == right.signon_realm && |
139 left.origin == right.origin && | 141 left.origin == right.origin && |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string); | 199 form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string); |
198 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string); | 200 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string); |
199 return os << "PasswordForm(" << form_as_string << ")"; | 201 return os << "PasswordForm(" << form_as_string << ")"; |
200 } | 202 } |
201 | 203 |
202 std::ostream& operator<<(std::ostream& os, PasswordForm* form) { | 204 std::ostream& operator<<(std::ostream& os, PasswordForm* form) { |
203 return os << "&" << *form; | 205 return os << "&" << *form; |
204 } | 206 } |
205 | 207 |
206 } // namespace autofill | 208 } // namespace autofill |
OLD | NEW |