1 // Copyright 2019 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef IOS_WEB_VIEW_INTERNAL_AUTOFILL_CWV_CREDIT_CARD_SAVER_INTERNAL_H_ 6 #define IOS_WEB_VIEW_INTERNAL_AUTOFILL_CWV_CREDIT_CARD_SAVER_INTERNAL_H_ 7 8 #import "ios/web_view/public/cwv_credit_card_saver.h" 9 10 #include <memory> 11 12 #include "components/autofill/core/browser/autofill_client.h" 13 #include "components/autofill/core/browser/payments/legal_message_line.h" 14 15 namespace autofill { 16 class CreditCard; 17 } // namespace autofill 18 19 @interface CWVCreditCardSaver () 20 21 // Designated Initializer. 22 // |creditCard| The card that needs to be saved. 23 // |saveOptions| Additional options that may apply to this save attempt. 24 // |legalMessage| Contains messaging that must be displayed to the user. 25 // |savePromptCallback| The callback to run when saving the card. 26 - (instancetype) 27 initWithCreditCard:(const autofill::CreditCard&)creditCard 28 saveOptions: 29 (autofill::AutofillClient::SaveCreditCardOptions)saveOptions 30 legalMessageLines:(autofill::LegalMessageLines)legalMessageLines 31 savePromptCallback:(autofill::AutofillClient::UploadSaveCardPromptCallback) 32 uploadSavePromptCallback NS_DESIGNATED_INITIALIZER; 33 34 // Called to notify when upload was completed. 35 - (void)handleCreditCardUploadCompleted:(BOOL)cardSaved; 36 37 // Use to notify CWVCreditCardSaver that it needs to obtain risk data for 38 // credit card upload and to pass it back in |callback|. 39 - (void)loadRiskData:(base::OnceCallback<void(const std::string&)>)callback; 40 41 @end 42 43 #endif // IOS_WEB_VIEW_INTERNAL_AUTOFILL_CWV_CREDIT_CARD_SAVER_INTERNAL_H_ 44