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