[go: nahoru, domu]

[Autofill local card migration] Refactor the local_card_migration_manager

To simplify the logic of triggering from settings page, we need to refactor the current local_card_migration_manager:

1. Move the isServerCard to the personal_data_manager. To determine a card is whether a server card or has server dup only depends on the personal_data_manager. So later we can use this function directly without create local_card_migration_manager when we create new attribute for each credit card entry for the settings page. Add unittests in the personal_data_manager.

2. Extract the prepare migratable credit cards to a helper function. Later, when we implement checking migration requirements in the settings page, we do not need to check the migration requirement twice after we bridge back. So we can directly call PrepareMigratableCreditCard() and AttemptToOfferLocalCardMigration() for the settings page.

Bug: 852904
Change-Id: I12b90054e96a9cafb6905c39608c7a5c1cbc2f8c
Reviewed-on: https://chromium-review.googlesource.com/1167796
Reviewed-by: Mathieu Perreault <mathp@chromium.org>
Reviewed-by: Jared Saul <jsaul@google.com>
Commit-Queue: Sujie Zhu <sujiezhu@google.com>
Cr-Commit-Position: refs/heads/master@{#582729}
5 files changed