chromium/chrome/browser/ui/autofill/address_bubbles_controller.h

// Copyright 2020 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_ADDRESS_BUBBLES_CONTROLLER_H_
#define CHROME_BROWSER_UI_AUTOFILL_ADDRESS_BUBBLES_CONTROLLER_H_

#include <string>

#include "base/functional/callback.h"
#include "chrome/browser/ui/autofill/address_bubble_controller_delegate.h"
#include "chrome/browser/ui/autofill/address_bubbles_icon_controller.h"
#include "chrome/browser/ui/autofill/autofill_bubble_controller_base.h"
#include "components/autofill/core/browser/autofill_client.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "content/public/browser/web_contents_user_data.h"

namespace autofill {

class AutofillBubbleBase;

// The controller of the address page action icon, see the implementation of
// the `AddressBubblesIconController` interface. Different types of address
// bubbles can be bound to the icon (e.g. save or update address). This
// controller acts as the delegate for them (hence implementing
// `AddressBubbleControllerDelegate`) to support higher level flows like saving
// an address with editing.
// Only single instance of this controller exists for a `WebContents`, to use
// it for different flows it must be reconfigured, see the arguments of
// the `OfferSave()` method.
class AddressBubblesController
    : public AutofillBubbleControllerBase,
      public AddressBubblesIconController,
      public content::WebContentsUserData<
          AddressBubblesController>,
      public AddressBubbleControllerDelegate {};

}  // namespace autofill

#endif  // CHROME_BROWSER_UI_AUTOFILL_ADDRESS_BUBBLES_CONTROLLER_H_