#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_SUGGESTION_GENERATOR_H_
#define COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_SUGGESTION_GENERATOR_H_
#include <optional>
#include <string>
#include <vector>
#include "base/check_deref.h"
#include "base/containers/flat_map.h"
#include "base/memory/raw_ptr.h"
#include "base/types/optional_ref.h"
#include "components/autofill/core/browser/data_model/autofill_wallet_usage_data.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/metrics/log_event.h"
#include "components/autofill/core/browser/metrics/payments/card_metadata_metrics.h"
#include "components/autofill/core/browser/metrics/suggestions_list_metrics.h"
#include "components/autofill/core/browser/ui/suggestion.h"
#include "components/autofill/core/browser/ui/suggestion_type.h"
#include "components/autofill/core/common/aliases.h"
namespace autofill {
class AutofillClient;
class AutofillOfferData;
class CreditCard;
class FormFieldData;
class Iban;
struct CreditCardSuggestionSummary { … };
std::vector<Suggestion> GetSuggestionsForCreditCards(
const AutofillClient& client,
const FormFieldData& trigger_field,
const std::vector<std::u16string>& last_four_list_for_suggestion_filtering,
FieldType trigger_field_type,
AutofillSuggestionTriggerSource trigger_source,
bool should_show_scan_credit_card,
bool should_show_cards_from_account,
CreditCardSuggestionSummary& summary);
std::vector<Suggestion> GetSuggestionsForVirtualCardStandaloneCvc(
const AutofillClient& client,
const FormFieldData& trigger_field,
autofill_metrics::CardMetadataLoggingContext& metadata_logging_context,
base::flat_map<std::string, VirtualCardUsageData::VirtualCardLastFour>&
virtual_card_guid_to_last_four_map);
std::vector<CreditCard> GetTouchToFillCardsToSuggest(
const AutofillClient& client,
const FormFieldData& trigger_field,
FieldType trigger_field_type);
std::vector<Suggestion> GetCreditCardSuggestionsForTouchToFill(
base::span<const CreditCard> credit_cards,
const AutofillClient& client);
Suggestion CreateManageCreditCardsSuggestion(bool with_gpay_logo);
Suggestion CreateManageIbansSuggestion();
std::vector<Suggestion> GetSuggestionsForIbans(const std::vector<Iban>& ibans);
std::vector<Suggestion> GetPromoCodeSuggestionsFromPromoCodeOffers(
const std::vector<const AutofillOfferData*>& promo_code_offers);
bool IsCardSuggestionAcceptable(const CreditCard& card,
const AutofillClient& client,
bool is_manual_fallback);
std::vector<CreditCard> GetOrderedCardsToSuggestForTest(
const AutofillClient& client,
const FormFieldData& trigger_field,
FieldType trigger_field_type,
bool suppress_disused_cards,
bool prefix_match,
bool require_non_empty_value_on_trigger_field,
bool include_virtual_cards,
bool use_legacy_algorithm = false);
Suggestion CreateCreditCardSuggestionForTest(
const CreditCard& credit_card,
const AutofillClient& client,
FieldType trigger_field_type,
bool virtual_card_option,
bool card_linked_offer_available,
base::optional_ref<autofill_metrics::CardMetadataLoggingContext>
metadata_logging_context = std::nullopt);
bool ShouldShowVirtualCardOptionForTest(const CreditCard* candidate_card,
const AutofillClient& client);
}
#endif