#include "chrome/browser/ui/views/autofill/autofill_bubble_handler_impl.h"
#include <memory>
#include "base/functional/callback_forward.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/autofill/autofill_bubble_base.h"
#include "chrome/browser/ui/autofill/payments/save_card_ui.h"
#include "chrome/browser/ui/autofill/payments/save_iban_ui.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/views/autofill/add_new_address_bubble_view.h"
#include "chrome/browser/ui/views/autofill/payments/local_card_migration_bubble_views.h"
#include "chrome/browser/ui/views/autofill/payments/local_card_migration_icon_view.h"
#include "chrome/browser/ui/views/autofill/payments/manage_saved_iban_bubble_view.h"
#include "chrome/browser/ui/views/autofill/payments/mandatory_reauth_confirmation_bubble_view.h"
#include "chrome/browser/ui/views/autofill/payments/mandatory_reauth_opt_in_bubble_view.h"
#include "chrome/browser/ui/views/autofill/payments/offer_notification_bubble_views.h"
#include "chrome/browser/ui/views/autofill/payments/offer_notification_icon_view.h"
#include "chrome/browser/ui/views/autofill/payments/save_card_bubble_views.h"
#include "chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.h"
#include "chrome/browser/ui/views/autofill/payments/save_card_offer_bubble_views.h"
#include "chrome/browser/ui/views/autofill/payments/save_iban_bubble_view.h"
#include "chrome/browser/ui/views/autofill/payments/save_payment_method_and_virtual_card_enroll_confirmation_bubble_views.h"
#include "chrome/browser/ui/views/autofill/payments/virtual_card_enroll_bubble_views.h"
#include "chrome/browser/ui/views/autofill/payments/virtual_card_enroll_icon_view.h"
#include "chrome/browser/ui/views/autofill/payments/virtual_card_manual_fallback_bubble_views.h"
#include "chrome/browser/ui/views/autofill/payments/virtual_card_manual_fallback_icon_view.h"
#include "chrome/browser/ui/views/autofill/save_address_profile_view.h"
#include "chrome/browser/ui/views/autofill/update_address_profile_view.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/toolbar_button_provider.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_view.h"
#include "chrome/browser/ui/views/profiles/avatar_toolbar_button.h"
#include "components/autofill/content/browser/content_autofill_driver.h"
#include "components/autofill/content/browser/content_autofill_driver_factory.h"
#include "components/autofill/core/browser/autofill_client.h"
#include "components/autofill/core/browser/payments/virtual_card_enrollment_manager.h"
#include "components/autofill/core/browser/ui/payments/virtual_card_enroll_bubble_controller.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/constrained_window/constrained_window_views.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h"
namespace autofill {
namespace {
template <class ViewType, class ControllerType>
AutofillBubbleBase* ShowAddressProfileBubble(
ToolbarButtonProvider* toolbar_button_provider_,
content::WebContents* web_contents,
std::unique_ptr<ControllerType> controller,
bool is_user_gesture) { … }
}
AutofillBubbleHandlerImpl::AutofillBubbleHandlerImpl(
Browser* browser,
ToolbarButtonProvider* toolbar_button_provider)
: … { … }
AutofillBubbleHandlerImpl::~AutofillBubbleHandlerImpl() = default;
AutofillBubbleBase* AutofillBubbleHandlerImpl::ShowSaveCreditCardBubble(
content::WebContents* web_contents,
SaveCardBubbleController* controller,
bool is_user_gesture) { … }
AutofillBubbleBase* AutofillBubbleHandlerImpl::ShowIbanBubble(
content::WebContents* web_contents,
IbanBubbleController* controller,
bool is_user_gesture,
IbanBubbleType bubble_type) { … }
AutofillBubbleBase* AutofillBubbleHandlerImpl::ShowLocalCardMigrationBubble(
content::WebContents* web_contents,
LocalCardMigrationBubbleController* controller,
bool is_user_gesture) { … }
AutofillBubbleBase* AutofillBubbleHandlerImpl::ShowOfferNotificationBubble(
content::WebContents* web_contents,
OfferNotificationBubbleController* controller,
bool is_user_gesture) { … }
AutofillBubbleBase* AutofillBubbleHandlerImpl::ShowSaveAddressProfileBubble(
content::WebContents* web_contents,
std::unique_ptr<SaveAddressBubbleController> controller,
bool is_user_gesture) { … }
AutofillBubbleBase* AutofillBubbleHandlerImpl::ShowUpdateAddressProfileBubble(
content::WebContents* web_contents,
std::unique_ptr<UpdateAddressBubbleController> controller,
bool is_user_gesture) { … }
AutofillBubbleBase* AutofillBubbleHandlerImpl::ShowAddNewAddressProfileBubble(
content::WebContents* web_contents,
std::unique_ptr<AddNewAddressBubbleController> controller,
bool is_user_gesture) { … }
AutofillBubbleBase*
AutofillBubbleHandlerImpl::ShowVirtualCardManualFallbackBubble(
content::WebContents* web_contents,
VirtualCardManualFallbackBubbleController* controller,
bool is_user_gesture) { … }
AutofillBubbleBase* AutofillBubbleHandlerImpl::ShowVirtualCardEnrollBubble(
content::WebContents* web_contents,
VirtualCardEnrollBubbleController* controller,
bool is_user_gesture) { … }
AutofillBubbleBase*
AutofillBubbleHandlerImpl::ShowVirtualCardEnrollConfirmationBubble(
content::WebContents* web_contents,
VirtualCardEnrollBubbleController* controller) { … }
AutofillBubbleBase* AutofillBubbleHandlerImpl::ShowMandatoryReauthBubble(
content::WebContents* web_contents,
MandatoryReauthBubbleController* controller,
bool is_user_gesture,
MandatoryReauthBubbleType bubble_type) { … }
AutofillBubbleBase* AutofillBubbleHandlerImpl::ShowSaveCardConfirmationBubble(
content::WebContents* web_contents,
SaveCardBubbleController* controller) { … }
AutofillBubbleBase* AutofillBubbleHandlerImpl::ShowSaveIbanConfirmationBubble(
content::WebContents* web_contents,
IbanBubbleController* controller) { … }
AutofillBubbleBase*
AutofillBubbleHandlerImpl::ShowSaveCardAndVirtualCardEnrollConfirmationBubble(
views::View* anchor_view,
content::WebContents* web_contents,
base::OnceCallback<void(PaymentsBubbleClosedReason)>
controller_hide_callback,
PageActionIconView* icon_view,
SavePaymentMethodAndVirtualCardEnrollConfirmationUiParams ui_params) { … }
}