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 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1980 MakeFrontendID(std::string(), suggestions[i].backend_id); | 1980 MakeFrontendID(std::string(), suggestions[i].backend_id); |
1981 } | 1981 } |
1982 return suggestions; | 1982 return suggestions; |
1983 } | 1983 } |
1984 | 1984 |
1985 std::vector<Suggestion> AutofillManager::GetCreditCardSuggestions( | 1985 std::vector<Suggestion> AutofillManager::GetCreditCardSuggestions( |
1986 const FormFieldData& field, | 1986 const FormFieldData& field, |
1987 const AutofillType& type) const { | 1987 const AutofillType& type) const { |
1988 credit_card_form_event_logger_->OnDidPollSuggestions(field); | 1988 credit_card_form_event_logger_->OnDidPollSuggestions(field); |
1989 | 1989 |
1990 bool isBankNameAvailable = false; | |
1990 // 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 |
1991 // data. | 1992 // data. |
1992 std::vector<Suggestion> suggestions = | 1993 std::vector<Suggestion> suggestions = |
1993 personal_data_->GetCreditCardSuggestions( | 1994 personal_data_->GetCreditCardSuggestions( |
1994 type, SanitizeCreditCardFieldValue(field.value)); | 1995 type, SanitizeCreditCardFieldValue(field.value), isBankNameAvailable); |
sebsg
2017/06/12 21:17:00
I'm not a fan of setting a value in functions like
Shanfeng
2017/06/12 23:34:58
Done.
| |
1996 if (isBankNameAvailable) { | |
1997 credit_card_form_event_logger_->SetBankNameAvailable(); | |
1998 } | |
1995 for (size_t i = 0; i < suggestions.size(); i++) { | 1999 for (size_t i = 0; i < suggestions.size(); i++) { |
1996 suggestions[i].frontend_id = | 2000 suggestions[i].frontend_id = |
1997 MakeFrontendID(suggestions[i].backend_id, std::string()); | 2001 MakeFrontendID(suggestions[i].backend_id, std::string()); |
1998 suggestions[i].is_value_bold = IsCreditCardPopupValueBold(); | 2002 suggestions[i].is_value_bold = IsCreditCardPopupValueBold(); |
1999 } | 2003 } |
2000 return suggestions; | 2004 return suggestions; |
2001 } | 2005 } |
2002 | 2006 |
2003 void AutofillManager::ParseForms(const std::vector<FormData>& forms) { | 2007 void AutofillManager::ParseForms(const std::vector<FormData>& forms) { |
2004 if (forms.empty()) | 2008 if (forms.empty()) |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2355 #endif // ENABLE_FORM_DEBUG_DUMP | 2359 #endif // ENABLE_FORM_DEBUG_DUMP |
2356 | 2360 |
2357 void AutofillManager::LogCardUploadDecisions(int upload_decision_metrics) { | 2361 void AutofillManager::LogCardUploadDecisions(int upload_decision_metrics) { |
2358 AutofillMetrics::LogCardUploadDecisionMetrics(upload_decision_metrics); | 2362 AutofillMetrics::LogCardUploadDecisionMetrics(upload_decision_metrics); |
2359 AutofillMetrics::LogCardUploadDecisionsUkm(client_->GetUkmRecorder(), | 2363 AutofillMetrics::LogCardUploadDecisionsUkm(client_->GetUkmRecorder(), |
2360 pending_upload_request_url_, | 2364 pending_upload_request_url_, |
2361 upload_decision_metrics); | 2365 upload_decision_metrics); |
2362 } | 2366 } |
2363 | 2367 |
2364 } // namespace autofill | 2368 } // namespace autofill |
OLD | NEW |