| 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 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1986 std::vector<Suggestion> AutofillManager::GetCreditCardSuggestions( | 1986 std::vector<Suggestion> AutofillManager::GetCreditCardSuggestions( |
| 1987 const FormFieldData& field, | 1987 const FormFieldData& field, |
| 1988 const AutofillType& type) const { | 1988 const AutofillType& type) const { |
| 1989 credit_card_form_event_logger_->OnDidPollSuggestions(field); | 1989 credit_card_form_event_logger_->OnDidPollSuggestions(field); |
| 1990 | 1990 |
| 1991 // The field value is sanitized before attempting to match it to the user's | 1991 // The field value is sanitized before attempting to match it to the user's |
| 1992 // data. | 1992 // data. |
| 1993 std::vector<Suggestion> suggestions = | 1993 std::vector<Suggestion> suggestions = |
| 1994 personal_data_->GetCreditCardSuggestions( | 1994 personal_data_->GetCreditCardSuggestions( |
| 1995 type, SanitizeCreditCardFieldValue(field.value)); | 1995 type, SanitizeCreditCardFieldValue(field.value)); |
| 1996 const std::vector<CreditCard*> cards_to_suggest = |
| 1997 personal_data_->GetCreditCardsToSuggest(); |
| 1998 for (const CreditCard* credit_card : cards_to_suggest) { |
| 1999 if (!credit_card->bank_name().empty()) { |
| 2000 credit_card_form_event_logger_->SetBankNameAvailable(); |
| 2001 break; |
| 2002 } |
| 2003 } |
| 1996 for (size_t i = 0; i < suggestions.size(); i++) { | 2004 for (size_t i = 0; i < suggestions.size(); i++) { |
| 1997 suggestions[i].frontend_id = | 2005 suggestions[i].frontend_id = |
| 1998 MakeFrontendID(suggestions[i].backend_id, std::string()); | 2006 MakeFrontendID(suggestions[i].backend_id, std::string()); |
| 1999 suggestions[i].is_value_bold = IsCreditCardPopupValueBold(); | 2007 suggestions[i].is_value_bold = IsCreditCardPopupValueBold(); |
| 2000 } | 2008 } |
| 2001 return suggestions; | 2009 return suggestions; |
| 2002 } | 2010 } |
| 2003 | 2011 |
| 2004 void AutofillManager::ParseForms(const std::vector<FormData>& forms) { | 2012 void AutofillManager::ParseForms(const std::vector<FormData>& forms) { |
| 2005 if (forms.empty()) | 2013 if (forms.empty()) |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2356 #endif // ENABLE_FORM_DEBUG_DUMP | 2364 #endif // ENABLE_FORM_DEBUG_DUMP |
| 2357 | 2365 |
| 2358 void AutofillManager::LogCardUploadDecisions(int upload_decision_metrics) { | 2366 void AutofillManager::LogCardUploadDecisions(int upload_decision_metrics) { |
| 2359 AutofillMetrics::LogCardUploadDecisionMetrics(upload_decision_metrics); | 2367 AutofillMetrics::LogCardUploadDecisionMetrics(upload_decision_metrics); |
| 2360 AutofillMetrics::LogCardUploadDecisionsUkm(client_->GetUkmRecorder(), | 2368 AutofillMetrics::LogCardUploadDecisionsUkm(client_->GetUkmRecorder(), |
| 2361 pending_upload_request_url_, | 2369 pending_upload_request_url_, |
| 2362 upload_decision_metrics); | 2370 upload_decision_metrics); |
| 2363 } | 2371 } |
| 2364 | 2372 |
| 2365 } // namespace autofill | 2373 } // namespace autofill |
| OLD | NEW |