#ifndef CHROME_BROWSER_UI_VIEWS_PROMOS_IOS_PROMO_BUBBLE_H_
#define CHROME_BROWSER_UI_VIEWS_PROMOS_IOS_PROMO_BUBBLE_H_
#include <memory>
#include "base/memory/raw_ptr.h"
#include "ui/base/interaction/element_identifier.h"
#include "ui/views/bubble/bubble_border.h"
namespace views {
class BubbleDialogDelegate;
class Button;
class View;
}
namespace IOSPromoConstants {
struct IOSPromoTypeConfigs;
}
class Profile;
namespace desktop_to_mobile_promos {
enum class BubbleType;
enum class PromoType;
}
class IOSPromoBubbleView;
DECLARE_ELEMENT_IDENTIFIER_VALUE(kIOSPromoBubbleElementId);
class IOSPromoBubble {
public:
class IOSPromoBubbleDelegate;
struct Anchor {
raw_ptr<views::View> view;
views::BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_RIGHT;
};
IOSPromoBubble(const IOSPromoBubble&) = delete;
IOSPromoBubble& operator=(const IOSPromoBubble&) = delete;
static void ShowPromoBubble(Anchor anchor,
views::Button* highlighted_button,
Profile* profile,
desktop_to_mobile_promos::PromoType promo_type,
desktop_to_mobile_promos::BubbleType bubble_type);
static void Hide();
static bool IsPromoTypeVisible(
desktop_to_mobile_promos::PromoType promo_type);
private:
friend class ::IOSPromoBubbleView;
static IOSPromoConstants::IOSPromoTypeConfigs SetUpBubble(
desktop_to_mobile_promos::PromoType promo_type,
desktop_to_mobile_promos::BubbleType bubble_type);
static std::unique_ptr<views::View> CreateContentView(
IOSPromoBubble::IOSPromoBubbleDelegate* bubble_delegate,
const IOSPromoConstants::IOSPromoTypeConfigs& ios_promo_config,
bool with_title,
desktop_to_mobile_promos::BubbleType bubble_type);
static std::unique_ptr<views::View> CreateImageAndBodyTextView(
const IOSPromoConstants::IOSPromoTypeConfigs& ios_promo_config,
desktop_to_mobile_promos::BubbleType bubble_type);
static std::unique_ptr<views::View> CreateButtonsView(
IOSPromoBubble::IOSPromoBubbleDelegate* bubble_delegate,
const IOSPromoConstants::IOSPromoTypeConfigs& ios_promo_config,
desktop_to_mobile_promos::BubbleType bubble_type);
static views::BubbleDialogDelegate* ios_promo_delegate_;
static desktop_to_mobile_promos::PromoType current_promo_type_;
};
#endif