Chromium Code Reviews| 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/core/browser/autofill_manager.h" | 5 #include "components/autofill/core/browser/autofill_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2000 // static | 2000 // static |
| 2001 void AutofillManager::DeterminePossibleFieldTypesForUpload( | 2001 void AutofillManager::DeterminePossibleFieldTypesForUpload( |
| 2002 const std::vector<AutofillProfile>& profiles, | 2002 const std::vector<AutofillProfile>& profiles, |
| 2003 const std::vector<CreditCard>& credit_cards, | 2003 const std::vector<CreditCard>& credit_cards, |
| 2004 const std::string& app_locale, | 2004 const std::string& app_locale, |
| 2005 FormStructure* submitted_form) { | 2005 FormStructure* submitted_form) { |
| 2006 // For each field in the |submitted_form|, extract the value. Then for each | 2006 // For each field in the |submitted_form|, extract the value. Then for each |
| 2007 // profile or credit card, identify any stored types that match the value. | 2007 // profile or credit card, identify any stored types that match the value. |
| 2008 for (size_t i = 0; i < submitted_form->field_count(); ++i) { | 2008 for (size_t i = 0; i < submitted_form->field_count(); ++i) { |
| 2009 AutofillField* field = submitted_form->field(i); | 2009 AutofillField* field = submitted_form->field(i); |
| 2010 if (!field->possible_types().empty()) { | |
| 2011 // If this is an upload for password form submission, Password Manager | |
| 2012 // could already set types for some fields. | |
|
Roger McFarlane (Chromium)
2017/04/04 19:09:42
The goal of this function is to include all of the
dvadym
2017/04/05 13:28:28
Good point. I thought, when I was writing this cod
| |
| 2013 continue; | |
| 2014 } | |
| 2010 ServerFieldTypeSet matching_types; | 2015 ServerFieldTypeSet matching_types; |
| 2011 | 2016 |
| 2012 base::string16 value; | 2017 base::string16 value; |
| 2013 base::TrimWhitespace(field->value, base::TRIM_ALL, &value); | 2018 base::TrimWhitespace(field->value, base::TRIM_ALL, &value); |
| 2014 | 2019 |
| 2015 for (const AutofillProfile& profile : profiles) | 2020 for (const AutofillProfile& profile : profiles) |
| 2016 profile.GetMatchingTypes(value, app_locale, &matching_types); | 2021 profile.GetMatchingTypes(value, app_locale, &matching_types); |
| 2017 for (const CreditCard& card : credit_cards) | 2022 for (const CreditCard& card : credit_cards) |
| 2018 card.GetMatchingTypes(value, app_locale, &matching_types); | 2023 card.GetMatchingTypes(value, app_locale, &matching_types); |
| 2019 | 2024 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2198 } | 2203 } |
| 2199 #endif // ENABLE_FORM_DEBUG_DUMP | 2204 #endif // ENABLE_FORM_DEBUG_DUMP |
| 2200 | 2205 |
| 2201 void AutofillManager::LogCardUploadDecisionUkm( | 2206 void AutofillManager::LogCardUploadDecisionUkm( |
| 2202 AutofillMetrics::CardUploadDecisionMetric upload_decision) { | 2207 AutofillMetrics::CardUploadDecisionMetric upload_decision) { |
| 2203 AutofillMetrics::LogCardUploadDecisionUkm( | 2208 AutofillMetrics::LogCardUploadDecisionUkm( |
| 2204 client_->GetUkmService(), pending_upload_request_url_, upload_decision); | 2209 client_->GetUkmService(), pending_upload_request_url_, upload_decision); |
| 2205 } | 2210 } |
| 2206 | 2211 |
| 2207 } // namespace autofill | 2212 } // namespace autofill |
| OLD | NEW |