Chromium Code Reviews| Index: components/autofill/core/browser/autofill_manager.cc |
| diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc |
| index d7e7cfcf3e2bb6bb3f98cf20f8441a302e74f6fc..d84915073be543e61d423b356215e57ad3b36dcb 100644 |
| --- a/components/autofill/core/browser/autofill_manager.cc |
| +++ b/components/autofill/core/browser/autofill_manager.cc |
| @@ -290,6 +290,13 @@ bool AutofillManager::ShouldShowScanCreditCard(const FormData& form, |
| return field.value.size() <= kShowScanCreditCardMaxValueLength; |
| } |
| +bool AutofillManager::IsCreditCardField(const FormData& form, |
| + const FormFieldData& field) { |
| + AutofillField* autofill_field = GetAutofillField(form, field); |
| + // TODO(csashi): Should we check GetStorableType()? |
|
Mathieu
2016/11/30 21:27:35
I believe this is fine as is.
csashi
2016/12/01 01:13:43
Done.
|
| + return autofill_field && autofill_field->Type().group() == CREDIT_CARD; |
| +} |
| + |
| bool AutofillManager::ShouldShowCreditCardSigninPromo( |
| const FormData& form, |
| const FormFieldData& field) { |
| @@ -510,8 +517,6 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id, |
| if (!IsValidFormData(form) || !IsValidFormFieldData(field)) |
| return; |
| - std::vector<Suggestion> suggestions; |
| - |
| gfx::RectF transformed_box = |
| driver_->TransformBoundingBoxToViewportCoordinates(bounding_box); |
| external_delegate_->OnQuery(query_id, form, field, transformed_box); |
| @@ -536,6 +541,8 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id, |
| } |
| } |
| + std::vector<Suggestion> suggestions; |
| + |
| if (is_autofill_possible && |
| driver_->RendererIsAvailable() && |
| got_autofillable_form) { |
| @@ -1770,6 +1777,7 @@ std::vector<Suggestion> AutofillManager::GetCreditCardSuggestions( |
| for (size_t i = 0; i < suggestions.size(); i++) { |
| suggestions[i].frontend_id = |
| MakeFrontendID(suggestions[i].backend_id, std::string()); |
| + suggestions[i].is_value_bold = IsCreditCardPopupValueBold(); |
| } |
| return suggestions; |
| } |