| 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 "components/autofill/content/renderer/password_form_conversion_utils.h" | 5 #include "components/autofill/content/renderer/password_form_conversion_utils.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 // |typed_username_value|. In case when it was, |typed_username_value| | 582 // |typed_username_value|. In case when it was, |typed_username_value| |
| 583 // is incomplete, so we should leave autofilled value. | 583 // is incomplete, so we should leave autofilled value. |
| 584 username_value = typed_username_value; | 584 username_value = typed_username_value; |
| 585 } | 585 } |
| 586 } | 586 } |
| 587 password_form->username_value = username_value; | 587 password_form->username_value = username_value; |
| 588 } | 588 } |
| 589 | 589 |
| 590 password_form->origin = | 590 password_form->origin = |
| 591 form_util::GetCanonicalOriginForDocument(form.document); | 591 form_util::GetCanonicalOriginForDocument(form.document); |
| 592 GURL::Replacements rep; | 592 password_form->signon_realm = GetSignOnRealm(password_form->origin); |
| 593 rep.SetPathStr(""); | |
| 594 password_form->signon_realm = | |
| 595 password_form->origin.ReplaceComponents(rep).spec(); | |
| 596 password_form->other_possible_usernames.swap(other_possible_usernames); | 593 password_form->other_possible_usernames.swap(other_possible_usernames); |
| 597 | 594 |
| 598 if (!password.IsNull()) { | 595 if (!password.IsNull()) { |
| 599 password_form->password_element = FieldName(password, "anonymous_password"); | 596 password_form->password_element = FieldName(password, "anonymous_password"); |
| 600 blink::WebString password_value = password.Value(); | 597 blink::WebString password_value = password.Value(); |
| 601 if (FieldHasNonscriptModifiedValue(field_value_and_properties_map, | 598 if (FieldHasNonscriptModifiedValue(field_value_and_properties_map, |
| 602 password)) | 599 password)) |
| 603 password_value = blink::WebString::FromUTF16( | 600 password_value = blink::WebString::FromUTF16( |
| 604 *field_value_and_properties_map->at(password).first); | 601 *field_value_and_properties_map->at(password).first); |
| 605 password_form->password_value = password_value.Utf16(); | 602 password_form->password_value = password_value.Utf16(); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 autocomplete_value_lowercase, base::kWhitespaceASCII, | 756 autocomplete_value_lowercase, base::kWhitespaceASCII, |
| 760 base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) { | 757 base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) { |
| 761 if (base::StartsWith(token, kAutocompleteCreditCardPrefix, | 758 if (base::StartsWith(token, kAutocompleteCreditCardPrefix, |
| 762 base::CompareCase::SENSITIVE)) { | 759 base::CompareCase::SENSITIVE)) { |
| 763 return true; | 760 return true; |
| 764 } | 761 } |
| 765 } | 762 } |
| 766 return false; | 763 return false; |
| 767 } | 764 } |
| 768 | 765 |
| 766 std::string GetSignOnRealm(const GURL& origin) { |
| 767 GURL::Replacements rep; |
| 768 rep.SetPathStr(""); |
| 769 return origin.ReplaceComponents(rep).spec(); |
| 770 } |
| 769 } // namespace autofill | 771 } // namespace autofill |
| OLD | NEW |