File: payments_view_factory.h

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (107 lines) | stat: -rw-r--r-- 4,501 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_AUTOFILL_PAYMENTS_PAYMENTS_VIEW_FACTORY_H_
#define CHROME_BROWSER_UI_AUTOFILL_PAYMENTS_PAYMENTS_VIEW_FACTORY_H_

#include <memory>

#include "base/functional/callback_forward.h"
#include "base/memory/weak_ptr.h"

namespace content {
class WebContents;
}

namespace autofill {

class AutofillErrorDialogController;
class AutofillErrorDialogView;
class AutofillProgressDialogController;
class AutofillProgressDialogView;
class BnplTosController;
class BnplTosView;
class CardUnmaskAuthenticationSelectionDialogController;
class CardUnmaskAuthenticationSelectionDialog;
class CardUnmaskOtpInputDialogController;
class CardUnmaskOtpInputDialogView;
class SaveAndFillDialogController;
class SaveAndFillDialogView;

namespace payments {
class PaymentsWindowUserConsentDialogController;
class PaymentsWindowUserConsentDialog;
class SelectBnplIssuerView;
class SelectBnplIssuerDialogController;
}  // namespace payments

// Factory function for creating and showing the autofill progress dialog
// view.
// Note: On Desktop the view's ownership is transferred to the widget, which
// deletes it on dismissal, so no lifecycle management is needed. However, on
// Android this is not the case, the view's implementation must delete itself
// when dismissed.
std::unique_ptr<AutofillProgressDialogView> CreateAndShowProgressDialog(
    base::WeakPtr<AutofillProgressDialogController> controller,
    content::WebContents* web_contents);

// Factory function for creating and showing the view.
base::WeakPtr<AutofillErrorDialogView> CreateAndShowAutofillErrorDialog(
    AutofillErrorDialogController* controller,
    content::WebContents* web_contents);

// Factory function for the card unmask view creates and shows the dialog.
CardUnmaskAuthenticationSelectionDialog*
CreateAndShowCardUnmaskAuthenticationSelectionDialog(
    content::WebContents* web_contents,
    CardUnmaskAuthenticationSelectionDialogController* controller);

// Factory function for creating and showing the card unmask otp input dialog
// view. This dialog is shown when user needs to input the OTP text received
// to unmask the credit card.
base::WeakPtr<CardUnmaskOtpInputDialogView> CreateAndShowOtpInputDialog(
    base::WeakPtr<CardUnmaskOtpInputDialogController> controller,
    content::WebContents* web_contents);

// Factory function for creating the payments window user consent dialog. This
// dialog is triggered when a payments window flow is started and if there was
// no intentional user consent to open a pop-up and redirect to a payments
// window flow. Once the dialog is accepted, it is treated as receiving user
// consent and the payments window flow will start. If the dialog is cancelled,
// the flow will end.
base::WeakPtr<payments::PaymentsWindowUserConsentDialog>
CreateAndShowPaymentsWindowUserConsentDialog(
    base::WeakPtr<payments::PaymentsWindowUserConsentDialogController>
        controller,
    content::WebContents* web_contents,
    base::OnceClosure accept_callback,
    base::OnceClosure cancel_callback);

// Factory function for creating and showing the BNPL Terms of Service.
std::unique_ptr<BnplTosView> CreateAndShowBnplTos(
    base::WeakPtr<BnplTosController> controller,
    content::WebContents* web_contents);

#if !BUILDFLAG(IS_ANDROID)
// Factory function for creating the "Save and Fill" dialog. This dialog
// is triggered when the user has no saved credit cards and clicks on the
// "Save and Fill" suggestion in the credit card dropdown menu. It presents
// a centered modal dialog where the user can conveniently save a new
// credit card and simultaneously fill it into the form with a single click.
std::unique_ptr<SaveAndFillDialogView> CreateAndShowSaveAndFillDialog(
    base::WeakPtr<SaveAndFillDialogController> controller,
    content::WebContents* web_contents);
#endif  // !BUILDFLAG(IS_ANDROID)

// Factory function for creating and showing the BNPL issuer selection dialog.
// This dialog is triggered when the BNPL payment method has been selected and
// the user needs to select an issuer.
std::unique_ptr<payments::SelectBnplIssuerView>
CreateAndShowBnplIssuerSelectionDialog(
    base::WeakPtr<payments::SelectBnplIssuerDialogController> controller,
    content::WebContents* web_contents);

}  // namespace autofill

#endif  // CHROME_BROWSER_UI_AUTOFILL_PAYMENTS_PAYMENTS_VIEW_FACTORY_H_