chromium/components/autofill/core/browser/payments/local_card_migration_manager.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/autofill/core/browser/payments/local_card_migration_manager.h"

#include <stddef.h>

#include <algorithm>
#include <unordered_map>
#include <vector>

#include "base/check_deref.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/autofill_client.h"
#include "components/autofill/core/browser/autofill_experiments.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
#include "components/autofill/core/browser/form_data_importer.h"
#include "components/autofill/core/browser/metrics/autofill_metrics.h"
#include "components/autofill/core/browser/metrics/payments/local_card_migration_metrics.h"
#include "components/autofill/core/browser/payments/client_behavior_constants.h"
#include "components/autofill/core/browser/payments/credit_card_save_manager.h"
#include "components/autofill/core/browser/payments/payments_network_interface.h"
#include "components/autofill/core/browser/payments/payments_util.h"
#include "components/autofill/core/browser/payments_data_manager.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/signin/public/identity_manager/identity_manager.h"

namespace autofill {
namespace {

PaymentsRpcResult;

}  // namespace

MigratableCreditCard::MigratableCreditCard(const CreditCard& credit_card)
    :{}

MigratableCreditCard::MigratableCreditCard(const MigratableCreditCard&) =
    default;

MigratableCreditCard::MigratableCreditCard(MigratableCreditCard&&) = default;

MigratableCreditCard& MigratableCreditCard::operator=(
    const MigratableCreditCard&) = default;

MigratableCreditCard& MigratableCreditCard::operator=(MigratableCreditCard&&) =
    default;

MigratableCreditCard::~MigratableCreditCard() = default;

LocalCardMigrationManager::LocalCardMigrationManager(
    AutofillClient* client,
    const std::string& app_locale)
    :{}

LocalCardMigrationManager::~LocalCardMigrationManager() = default;

bool LocalCardMigrationManager::ShouldOfferLocalCardMigration(
    const std::optional<CreditCard>& extracted_credit_card,
    int credit_card_import_type) {}

void LocalCardMigrationManager::AttemptToOfferLocalCardMigration(
    bool is_from_settings_page) {}

// Callback function when user agrees to migration on the intermediate dialog.
// Call ShowMainMigrationDialog() to pop up a larger, modal dialog showing the
// local cards to be uploaded.
void LocalCardMigrationManager::OnUserAcceptedIntermediateMigrationDialog() {}

// Send the migration request once risk data is available.
void LocalCardMigrationManager::OnUserAcceptedMainMigrationDialog(
    const std::vector<std::string>& selected_card_guids) {}

void LocalCardMigrationManager::OnUserDeletedLocalCardViaMigrationDialog(
    const std::string& deleted_card_guid) {}

bool LocalCardMigrationManager::IsCreditCardMigrationEnabled() {}

void LocalCardMigrationManager::OnDidGetUploadDetails(
    bool is_from_settings_page,
    PaymentsRpcResult result,
    const std::u16string& context_token,
    std::unique_ptr<base::Value::Dict> legal_message,
    std::vector<std::pair<int, int>> supported_card_bin_ranges) {}

void LocalCardMigrationManager::OnDidMigrateLocalCards(
    PaymentsRpcResult result,
    std::unique_ptr<std::unordered_map<std::string, std::string>> save_result,
    const std::string& display_text) {}

void LocalCardMigrationManager::OnDidGetMigrationRiskData(
    const std::string& risk_data) {}

// Send the migration request. Will call
// `client_->GetPaymentsAutofillClient()->GetPaymentsNetworkInterface()` to
// create a new PaymentsRequest. Also create a new callback function
// OnDidMigrateLocalCards.
void LocalCardMigrationManager::SendMigrateLocalCardsRequest() {}

LocalCardMigrationStrikeDatabase*
LocalCardMigrationManager::GetLocalCardMigrationStrikeDatabase() {}

// Pops up a larger, modal dialog showing the local cards to be uploaded. Pass
// the reference of vector<MigratableCreditCard> and the callback function is
// OnUserAcceptedMainMigrationDialog(). Can be called when user agrees to
// migration on the intermediate dialog or directly from settings page.
void LocalCardMigrationManager::ShowMainMigrationDialog() {}

int LocalCardMigrationManager::GetDetectedValues() const {}

void LocalCardMigrationManager::GetMigratableCreditCards() {}

void LocalCardMigrationManager::FilterOutUnsupportedLocalCards(
    const std::vector<std::pair<int, int>>& supported_card_bin_ranges) {}

PaymentsDataManager& LocalCardMigrationManager::payments_data_manager() {}

const PaymentsDataManager& LocalCardMigrationManager::payments_data_manager()
    const {}

}  // namespace autofill