#ifndef UI_VIEWS_BUBBLE_BUBBLE_DIALOG_DELEGATE_VIEW_H_
#define UI_VIEWS_BUBBLE_BUBBLE_DIALOG_DELEGATE_VIEW_H_
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include "base/check.h"
#include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_span.h"
#include "base/memory/weak_ptr.h"
#include "base/types/pass_key.h"
#include "build/build_config.h"
#include "ui/accessibility/ax_enums.mojom-forward.h"
#include "ui/base/class_property.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_utils.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/base/mojom/ui_base_types.mojom-shared.h"
#include "ui/color/color_variant.h"
#include "ui/compositor/layer_type.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/views/bubble/bubble_border.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/metadata/view_factory.h"
#include "ui/views/view_tracker.h"
#include "ui/views/view_utils.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_observer.h"
#include "ui/views/window/dialog_delegate.h"
#if BUILDFLAG(IS_MAC)
#include "ui/base/cocoa/bubble_closer.h"
#endif
class AccountChooserDialogView;
class AppDialogView;
class AnnouncementView;
class BruschettaUninstallerView;
class ChromeLabsBubbleView;
class ColorPickerViewTest;
class ContentSettingBubbleContents;
class CriticalNotificationBubbleView;
class CrostiniAnsibleSoftwareConfigView;
class CrostiniExpiredContainerWarningView;
class CrostiniForceCloseView;
class CrostiniPackageInstallFailureView;
class CrostiniRecoveryView;
class CrostiniUninstallerView;
class CrostiniUpdateFilesystemView;
class DiceWebSigninInterceptionBubbleView;
class ExtensionInstallDialogView;
class ExtensionPopup;
class ExtensionsMenuView;
class FlyingIndicator;
class GlobalErrorBubbleView;
class HomePageUndoBubble;
class MediaDialogView;
class HatsNextWebDialog;
class IncognitoClearBrowsingDataDialog;
class IOSPromoBubbleView;
class LocationBarBubbleDelegateView;
class NetworkProfileBubbleView;
class PageInfoBubbleViewBase;
class PermissionPromptBaseView;
class PluginVmInstallerView;
class ProfileMenuViewBase;
class RemoveSuggestionBubbleDialogDelegateView;
class StoragePressureBubbleView;
class TabGroupEditorBubbleView;
class TabHoverCardBubbleView;
class TestBubbleView;
class ToolbarActionHoverCardBubbleView;
class ScreenshotSurfaceTestDialog;
class WebBubbleView;
class WebUIBubbleDialogView;
FORWARD_DECLARE_TEST(InProcessBrowserTest,
RunsScheduledLayoutOnAnchoredBubbles);
namespace ambient_signin {
class AmbientSigninBubbleView;
}
namespace arc {
class ArcSplashScreenDialogView;
class BaseDialogDelegateView;
class ResizeConfirmationDialogView;
namespace input_overlay {
class DeleteEditShortcut;
class RichNudge;
}
}
namespace ash {
class AnchoredNudge;
class ContextualNudge;
class DictationBubbleView;
class FaceGazeBubbleView;
class GameDashboardMainMenuView;
class HelpBubbleViewAsh;
class ImeModeIndicatorView;
class KioskAppInstructionBubble;
class MouseKeysBubbleView;
class NetworkInfoBubble;
class NetworkStateListInfoBubble;
class PaletteWelcomeBubbleView;
class QuickInsertCapsLockStateView;
class QuickInsertPreviewBubbleView;
class ShelfBubble;
class TestBubbleDialogDelegateView;
class TestBubbleDialogDelegate;
class TrayBubbleView;
FORWARD_DECLARE_TEST(OverviewSessionTest, DoNotHideBubbleTransient);
FORWARD_DECLARE_TEST(ResizeShadowAndCursorTest,
DefaultCursorOnBubbleWidgetCorners);
FORWARD_DECLARE_TEST(SnapGroupOverviewTest, BubbleTransientIsVisibleInOverview);
FORWARD_DECLARE_TEST(
SnapGroupDesksTest,
NoCrashWhenDraggingOverviewGroupItemWithBubbleToAnotherDesk);
FORWARD_DECLARE_TEST(SnapGroupTest,
NoCrashWhenReSnappingSecondaryToPrimaryWithTransient);
namespace sharesheet {
class SharesheetBubbleView;
}
}
namespace autofill {
class CardUnmaskAuthenticationSelectionDialogView;
class CardUnmaskPromptViews;
class LocalCardMigrationDialogView;
class LocalCardMigrationErrorDialogView;
}
namespace captions {
class CaptionBubble;
}
namespace chromeos {
class MultitaskMenu;
}
namespace gfx {
class Rect;
}
namespace lens {
class LensPreselectionBubble;
class LensRegionSearchInstructionsView;
}
namespace media_router {
class CastDialogView;
class MediaRemotingDialogView;
}
namespace send_tab_to_self {
class SendTabToSelfToolbarBubbleView;
}
namespace toasts {
class ToastView;
}
namespace ui {
class TrackedElement;
}
namespace ui::ime {
class AnnouncementView;
class CandidateWindowView;
class GrammarSuggestionWindow;
class InfolistWindow;
class SuggestionWindowView;
class UndoWindow;
}
namespace user_education {
class HelpBubbleView;
namespace test {
class TestCustomHelpBubbleView;
}
}
namespace webid {
class AccountSelectionBubbleView;
}
namespace views {
class AnchorTestBubbleDialogDelegateView;
class Button;
class FocusManagerTestBubbleDialogDelegateView;
class FrameViewTestBubbleDialogDelegateView;
class InfoBubble;
class InteractionSequenceViewsTest;
class TestBubbleDialogDelegateView;
class TestBubbleView;
class TouchSelectionMenuViews;
namespace examples {
template <class DialogType>
class DialogExampleDelegate;
class ExampleBubble;
class LoginBubbleDialogView;
}
namespace test {
class SimpleBubbleView;
class TestBubbleView;
class WidgetTestBubbleDialogDelegateView;
FORWARD_DECLARE_TEST(DesktopWidgetTestInteractive, FocusChangesOnBubble);
FORWARD_DECLARE_TEST(InteractionTestUtilViewsTest, ActivateSurface);
FORWARD_DECLARE_TEST(InteractionTestUtilViewsTest, Confirm);
}
using BubbleAnchor = std::variant<View*, ui::TrackedElement*, std::nullptr_t>;
class VIEWS_EXPORT BubbleDialogDelegate : public DialogDelegate {
public:
BubbleDialogDelegate(
BubbleAnchor anchor,
BubbleBorder::Arrow arrow,
BubbleBorder::Shadow shadow = BubbleBorder::DIALOG_SHADOW,
bool autosize = false);
BubbleDialogDelegate(const BubbleDialogDelegate& other) = delete;
BubbleDialogDelegate& operator=(const BubbleDialogDelegate& other) = delete;
~BubbleDialogDelegate() override;
BubbleDialogDelegate* AsBubbleDialogDelegate() override;
std::unique_ptr<FrameView> CreateFrameView(Widget* widget) override;
ClientView* CreateClientView(Widget* widget) override;
ax::mojom::Role GetAccessibleWindowRole() final;
static Widget* CreateBubble(
std::unique_ptr<BubbleDialogDelegate> bubble_delegate,
Widget::InitParams::Ownership ownership =
Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET);
static Widget* CreateBubble(
BubbleDialogDelegate* bubble_delegate,
Widget::InitParams::Ownership ownership =
Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET);
void SetAnchorView(View* view);
View* GetAnchorView() const;
void SetMainImage(ui::ImageModel main_image);
const ui::ImageModel& GetMainImage() const { return main_image_; }
virtual gfx::Rect GetAnchorRect() const;
const std::optional<gfx::Rect>& anchor_rect() const { return anchor_rect_; }
void SetAnchorRect(const gfx::Rect& rect);
void SetAnchor(BubbleAnchor anchor);
BubbleAnchor GetAnchor() const;
void SetAnchorWidget(views::Widget* anchor_widget);
Widget* anchor_widget() { return anchor_widget_; }
const Widget* anchor_widget() const { return anchor_widget_; }
void SetArrow(BubbleBorder::Arrow arrow);
BubbleBorder::Arrow arrow() const { return arrow_; }
void SetArrowWithoutResizing(BubbleBorder::Arrow arrow);
bool adjust_if_offscreen() const { return adjust_if_offscreen_; }
void set_adjust_if_offscreen(bool adjust) { adjust_if_offscreen_ = adjust; }
BubbleBorder::Shadow GetShadow() const;
void set_shadow(BubbleBorder::Shadow shadow) { shadow_ = shadow; }
virtual void OnAnchorBoundsChanged();
void UpdateInputProtectorsTimeStamp();
virtual std::u16string GetSubtitle() const;
void SetSubtitle(const std::u16string& subtitle);
bool GetSubtitleAllowCharacterBreak() const;
void SetSubtitleAllowCharacterBreak(bool allow);
bool is_autosized() const { return autosize_; }
class VIEWS_EXPORT CloseOnDeactivatePin {
public:
virtual ~CloseOnDeactivatePin();
CloseOnDeactivatePin(const CloseOnDeactivatePin&) = delete;
void operator=(const CloseOnDeactivatePin&) = delete;
private:
class Pins;
friend class BubbleDialogDelegate;
explicit CloseOnDeactivatePin(base::WeakPtr<Pins> pins);
const base::WeakPtr<Pins> pins_;
};
void set_close_on_deactivate(bool close) { close_on_deactivate_ = close; }
bool ShouldCloseOnDeactivate() const;
std::unique_ptr<CloseOnDeactivatePin> PreventCloseOnDeactivate();
void SetHighlightedButton(Button* highlighted_button);
gfx::NativeView parent_window() const { return parent_window_; }
void set_parent_window(gfx::NativeView window) { parent_window_ = window; }
bool has_parent() { return has_parent_; }
void set_has_parent(bool has_parent) { has_parent_ = has_parent; }
bool accept_events() const { return accept_events_; }
void set_accept_events(bool accept_events) { accept_events_ = accept_events; }
void set_focus_traversable_from_anchor_view(bool focusable) {
focus_traversable_from_anchor_view_ = focusable;
}
void set_highlight_button_when_shown(bool highlight) {
highlight_button_when_shown_ = highlight;
}
ui::ColorVariant background_color() const { return color_; }
void SetBackgroundColor(ui::ColorVariant color);
gfx::Insets footnote_margins() const {
return frame_margins().footnote.value_or(gfx::Insets());
}
void UseCompactMargins();
ui::LayerType layer_type() const { return layer_type_; }
void set_layer_type(ui::LayerType layer_type) {
CHECK(layer_type == ui::LAYER_TEXTURED ||
layer_type == ui::LAYER_NOT_DRAWN);
layer_type_ = layer_type;
}
virtual void OnBeforeBubbleWidgetInit(Widget::InitParams* params,
Widget* widget) const {}
static gfx::Size GetMaxAvailableScreenSpaceToPlaceBubble(
BubbleAnchor anchor,
BubbleBorder::Arrow arrow,
bool adjust_if_offscreen,
BubbleFrameView::PreferredArrowAdjustment arrow_adjustment);
static gfx::Size GetAvailableSpaceToPlaceBubble(BubbleBorder::Arrow arrow,
gfx::Rect anchor_rect,
gfx::Rect screen_rect);
void SizeToContents();
virtual gfx::Rect GetBubbleBounds();
protected:
class VIEWS_EXPORT BubbleUmaLogger {
public:
BubbleUmaLogger();
~BubbleUmaLogger();
void set_delegate(views::BubbleDialogDelegate* delegate) {
delegate_ = delegate;
}
void set_bubble_view(views::View* view) { bubble_view_ = view; }
void set_allowed_class_names_for_testing(
const base::span<const char* const>& value) {
allowed_class_names_for_testing_ = value;
}
std::optional<std::string> GetBubbleName() const;
base::WeakPtr<BubbleUmaLogger> GetWeakPtr();
template <typename Value>
void LogMetric(void (*uma_func)(std::string_view, Value),
std::string_view histogram_name,
Value value) const;
private:
std::optional<raw_ptr<views::View>> bubble_view_;
std::optional<raw_ptr<views::BubbleDialogDelegate>> delegate_;
std::optional<base::raw_span<const char* const>>
allowed_class_names_for_testing_;
base::WeakPtrFactory<BubbleUmaLogger> weak_factory_{this};
};
virtual void Init() {}
BubbleUmaLogger& bubble_uma_logger() { return bubble_uma_logger_; }
virtual void OnWidgetClosing(Widget* widget) {}
virtual void OnWidgetDestroying(Widget* widget) {}
virtual void OnWidgetActivationChanged(Widget* widget, bool active) {}
virtual void OnWidgetDestroyed(Widget* widget) {}
virtual void OnWidgetBoundsChanged(Widget* widget, const gfx::Rect& bounds) {}
virtual void OnWidgetVisibilityChanged(Widget* widget, bool visible) {}
private:
class AnchorViewObserver;
class AnchorWidgetObserver;
class BubbleWidgetObserver;
FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateViewTest,
VisibleWidgetShowsInkDropOnAttaching);
FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateViewTest,
AttachedWidgetShowsInkDropWhenVisible);
FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateViewTest,
MultipleBubbleAnchorHighlightTestInOrder);
FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateViewTest,
MultipleBubbleAnchorHighlightTestOutOfOrder);
friend class AnchorViewObserver;
friend class AnchorWidgetObserver;
friend class BubbleWidgetObserver;
friend class TestBubbleUmaLogger;
friend class BubbleBorderDelegate;
friend class BubbleWindowTargeter;
void OnAnchorWidgetDestroying();
void OnAnchorWidgetBoundsChanged();
void OnBubbleWidgetClosing();
void OnBubbleWidgetVisibilityChanged(bool visible);
void OnBubbleWidgetActivationChanged(bool active);
void OnBubbleWidgetPaintAsActiveChanged();
void OnDeactivate();
void UpdateFrameColor();
void NotifyAnchoredBubbleIsPrimary();
void UpdateHighlightedButton(bool highlight);
void SetAnchoredDialogKey();
gfx::Rect GetDesiredBubbleBounds();
BubbleBorder::Arrow arrow_ = BubbleBorder::NONE;
BubbleBorder::Shadow shadow_;
ui::ColorVariant color_ = ui::kColorBubbleBackground;
raw_ptr<Widget> anchor_widget_ = nullptr;
raw_ptr<ui::TrackedElement> anchor_tracked_element_ = nullptr;
std::unique_ptr<AnchorViewObserver> anchor_view_observer_;
std::unique_ptr<AnchorWidgetObserver> anchor_widget_observer_;
std::unique_ptr<BubbleWidgetObserver> bubble_widget_observer_;
bool adjust_if_offscreen_ = true;
bool focus_traversable_from_anchor_view_ = true;
ViewTracker highlighted_button_tracker_;
ui::ImageModel main_image_;
std::u16string subtitle_;
bool subtitle_allow_character_break_ = false;
ui::LayerType layer_type_ = ui::LayerType::LAYER_TEXTURED;
bool autosize_ = false;
bool close_on_deactivate_ = true;
std::unique_ptr<CloseOnDeactivatePin::Pins> close_on_deactivate_pins_;
bool highlight_button_when_shown_ = true;
mutable std::optional<gfx::Rect> anchor_rect_;
bool accept_events_ = true;
gfx::NativeView parent_window_ = gfx::NativeView();
bool has_parent_ = true;
#if BUILDFLAG(IS_MAC)
std::unique_ptr<ui::BubbleCloser> mac_bubble_closer_;
#endif
std::optional<Button::ScopedAnchorHighlight> button_anchor_highlight_;
BubbleUmaLogger bubble_uma_logger_;
std::optional<base::TimeTicks> bubble_created_time_;
std::optional<base::TimeTicks> bubble_shown_time_;
base::TimeDelta bubble_shown_duration_;
};
class VIEWS_EXPORT BubbleDialogDelegateView : public View,
public BubbleDialogDelegate {
METADATA_HEADER(BubbleDialogDelegateView, View)
public:
using BddvPassKey = base::PassKey<BubbleDialogDelegateView>;
template <typename T>
static bool IsBubbleDialogDelegateView(const BubbleDialogDelegateView* view) {
return ui::metadata::IsClass<T, BubbleDialogDelegateView>(view);
}
template <typename T>
static Widget* CreateBubble(
std::unique_ptr<T> delegate,
Widget::InitParams::Ownership ownership =
Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) {
CHECK(IsBubbleDialogDelegateView<T>(delegate.get()));
return BubbleDialogDelegate::CreateBubble(std::move(delegate), ownership);
}
static Widget* CreateBubble(
BubbleDialogDelegateView* bubble_delegate,
Widget::InitParams::Ownership ownership =
Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET);
explicit BubbleDialogDelegateView(
BddvPassKey,
View* anchor_view = nullptr,
BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_LEFT,
BubbleBorder::Shadow shadow = BubbleBorder::DIALOG_SHADOW,
bool autosize = false)
: BubbleDialogDelegateView(anchor_view, arrow, shadow, autosize) {}
BubbleDialogDelegateView(const BubbleDialogDelegateView&) = delete;
BubbleDialogDelegateView& operator=(const BubbleDialogDelegateView&) = delete;
~BubbleDialogDelegateView() override;
View* GetContentsView() override;
Widget* GetWidget() override;
const Widget* GetWidget() const override;
protected:
gfx::Size GetMinimumSize() const final;
gfx::Size GetMaximumSize() const final;
private:
FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CreateDelegate);
FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, NonClientHitTest);
friend class ::AccountChooserDialogView;
friend class ::AnnouncementView;
friend class ::AppDialogView;
friend class ::BruschettaUninstallerView;
friend class ::ChromeLabsBubbleView;
friend class ::ColorPickerViewTest;
friend class ::ContentSettingBubbleContents;
friend class ::CriticalNotificationBubbleView;
friend class ::CrostiniAnsibleSoftwareConfigView;
friend class ::CrostiniExpiredContainerWarningView;
friend class ::CrostiniForceCloseView;
friend class ::CrostiniPackageInstallFailureView;
friend class ::CrostiniRecoveryView;
friend class ::CrostiniUninstallerView;
friend class ::CrostiniUpdateFilesystemView;
friend class ::DiceWebSigninInterceptionBubbleView;
friend class ::ExtensionInstallDialogView;
friend class ::ExtensionPopup;
friend class ::ExtensionsMenuView;
friend class ::FlyingIndicator;
friend class ::GlobalErrorBubbleView;
friend class ::HomePageUndoBubble;
friend class ::IOSPromoBubbleView;
friend class ::MediaDialogView;
friend class ::HatsNextWebDialog;
friend class ::IncognitoClearBrowsingDataDialog;
friend class ::LocationBarBubbleDelegateView;
friend class ::NetworkProfileBubbleView;
friend class ::PageInfoBubbleViewBase;
friend class ::PermissionPromptBaseView;
friend class ::PluginVmInstallerView;
friend class ::ProfileMenuViewBase;
friend class ::RemoveSuggestionBubbleDialogDelegateView;
friend class ::StoragePressureBubbleView;
friend class ::TabGroupEditorBubbleView;
friend class ::TabHoverCardBubbleView;
friend class ::TestBubbleView;
friend class ::ToolbarActionHoverCardBubbleView;
friend class ::ScreenshotSurfaceTestDialog;
friend class ::WebBubbleView;
friend class ::WebUIBubbleDialogView;
FRIEND_TEST_ALL_PREFIXES(::InProcessBrowserTest,
RunsScheduledLayoutOnAnchoredBubbles);
friend class ::ambient_signin::AmbientSigninBubbleView;
friend class ::arc::ArcSplashScreenDialogView;
friend class ::arc::BaseDialogDelegateView;
friend class ::arc::ResizeConfirmationDialogView;
friend class ::arc::input_overlay::DeleteEditShortcut;
friend class ::arc::input_overlay::RichNudge;
friend class ::ash::AnchoredNudge;
friend class ::ash::ContextualNudge;
friend class ::ash::DictationBubbleView;
friend class ::ash::FaceGazeBubbleView;
friend class ::ash::GameDashboardMainMenuView;
friend class ::ash::HelpBubbleViewAsh;
friend class ::ash::ImeModeIndicatorView;
friend class ::ash::KioskAppInstructionBubble;
friend class ::ash::MouseKeysBubbleView;
friend class ::ash::NetworkInfoBubble;
friend class ::ash::NetworkStateListInfoBubble;
friend class ::ash::PaletteWelcomeBubbleView;
friend class ::ash::QuickInsertCapsLockStateView;
friend class ::ash::QuickInsertPreviewBubbleView;
friend class ::ash::ShelfBubble;
friend class ::ash::TestBubbleDialogDelegateView;
friend class ::ash::TestBubbleDialogDelegate;
friend class ::ash::TrayBubbleView;
FRIEND_TEST_ALL_PREFIXES(::ash::OverviewSessionTest,
DoNotHideBubbleTransient);
FRIEND_TEST_ALL_PREFIXES(::ash::ResizeShadowAndCursorTest,
DefaultCursorOnBubbleWidgetCorners);
FRIEND_TEST_ALL_PREFIXES(::ash::SnapGroupOverviewTest,
BubbleTransientIsVisibleInOverview);
FRIEND_TEST_ALL_PREFIXES(
::ash::SnapGroupDesksTest,
NoCrashWhenDraggingOverviewGroupItemWithBubbleToAnotherDesk);
FRIEND_TEST_ALL_PREFIXES(
::ash::SnapGroupTest,
NoCrashWhenReSnappingSecondaryToPrimaryWithTransient);
friend class ::ash::sharesheet::SharesheetBubbleView;
friend class ::autofill::CardUnmaskAuthenticationSelectionDialogView;
friend class ::autofill::CardUnmaskPromptViews;
friend class ::autofill::LocalCardMigrationDialogView;
friend class ::autofill::LocalCardMigrationErrorDialogView;
friend class ::captions::CaptionBubble;
friend class ::chromeos::MultitaskMenu;
friend class ::lens::LensPreselectionBubble;
friend class ::lens::LensRegionSearchInstructionsView;
friend class ::media_router::CastDialogView;
friend class ::media_router::MediaRemotingDialogView;
friend class ::send_tab_to_self::SendTabToSelfToolbarBubbleView;
friend class ::toasts::ToastView;
friend class ::ui::ime::AnnouncementView;
friend class ::ui::ime::CandidateWindowView;
friend class ::ui::ime::GrammarSuggestionWindow;
friend class ::ui::ime::InfolistWindow;
friend class ::ui::ime::SuggestionWindowView;
friend class ::ui::ime::UndoWindow;
friend class ::user_education::HelpBubbleView;
friend class ::user_education::test::TestCustomHelpBubbleView;
friend class ::webid::AccountSelectionBubbleView;
friend class AnchorTestBubbleDialogDelegateView;
friend class FocusManagerTestBubbleDialogDelegateView;
friend class FrameViewTestBubbleDialogDelegateView;
friend class InfoBubble;
friend class InteractionSequenceViewsTest;
friend class TestBubbleDialogDelegateView;
friend class TestBubbleView;
friend class TouchSelectionMenuViews;
FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateViewInteractiveTest,
BubbleAndParentNotActiveSimultaneously);
FRIEND_TEST_ALL_PREFIXES(BubbleDialogDelegateViewTest,
ClientViewIsPaintedToLayer);
FRIEND_TEST_ALL_PREFIXES(WidgetFocusObserverTest, Bubble);
friend class examples::DialogExampleDelegate<BubbleDialogDelegateView>;
friend class examples::ExampleBubble;
friend class examples::LoginBubbleDialogView;
friend class test::SimpleBubbleView;
friend class test::TestBubbleView;
friend class test::WidgetTestBubbleDialogDelegateView;
FRIEND_TEST_ALL_PREFIXES(test::DesktopWidgetTestInteractive,
FocusChangesOnBubble);
FRIEND_TEST_ALL_PREFIXES(test::InteractionTestUtilViewsTest, ActivateSurface);
FRIEND_TEST_ALL_PREFIXES(test::InteractionTestUtilViewsTest, Confirm);
explicit BubbleDialogDelegateView(
BubbleAnchor anchor = nullptr,
BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_LEFT,
BubbleBorder::Shadow shadow = BubbleBorder::DIALOG_SHADOW,
bool autosize = false);
static BddvPassKey CreatePassKey() { return BddvPassKey(); }
};
BEGIN_VIEW_BUILDER(VIEWS_EXPORT, BubbleDialogDelegateView, View)
VIEW_BUILDER_PROPERTY(ax::mojom::Role, AccessibleWindowRole)
VIEW_BUILDER_PROPERTY(std::u16string, AccessibleTitle)
VIEW_BUILDER_PROPERTY(bool, CanMaximize)
VIEW_BUILDER_PROPERTY(bool, CanMinimize)
VIEW_BUILDER_PROPERTY(bool, CanResize)
VIEW_BUILDER_VIEW_TYPE_PROPERTY(views::View, ExtraView)
VIEW_BUILDER_VIEW_TYPE_PROPERTY(views::View, FootnoteView)
VIEW_BUILDER_PROPERTY(bool, FocusTraversesOut)
VIEW_BUILDER_PROPERTY(bool, EnableArrowKeyTraversal)
VIEW_BUILDER_PROPERTY(ui::ImageModel, Icon)
VIEW_BUILDER_PROPERTY(ui::ImageModel, AppIcon)
VIEW_BUILDER_PROPERTY(ui::ImageModel, MainImage)
VIEW_BUILDER_PROPERTY(ui::mojom::ModalType, ModalType)
VIEW_BUILDER_PROPERTY(WidgetDelegate::OwnedByWidgetPassKey, OwnedByWidget)
VIEW_BUILDER_PROPERTY(bool, ShowCloseButton)
VIEW_BUILDER_PROPERTY(bool, ShowIcon)
VIEW_BUILDER_PROPERTY(bool, ShowTitle)
VIEW_BUILDER_OVERLOAD_METHOD_CLASS(WidgetDelegate,
SetTitle,
const std::u16string&)
VIEW_BUILDER_OVERLOAD_METHOD_CLASS(WidgetDelegate, SetTitle, int)
#if defined(USE_AURA)
VIEW_BUILDER_PROPERTY(bool, CenterTitle)
#endif
VIEW_BUILDER_PROPERTY(int, Buttons)
VIEW_BUILDER_PROPERTY(int, DefaultButton)
VIEW_BUILDER_METHOD(SetButtonLabel, ui::mojom::DialogButton, std::u16string)
VIEW_BUILDER_METHOD(SetButtonEnabled, ui::mojom::DialogButton, bool)
VIEW_BUILDER_METHOD(set_margins, gfx::Insets)
VIEW_BUILDER_METHOD(set_frame_margins, const DialogDelegate::FrameMargins&)
VIEW_BUILDER_METHOD(set_use_round_corners, bool)
VIEW_BUILDER_METHOD(set_corner_radius, int)
VIEW_BUILDER_METHOD(set_draggable, bool)
VIEW_BUILDER_METHOD(set_use_custom_frame, bool)
VIEW_BUILDER_METHOD(set_fixed_width, int)
VIEW_BUILDER_METHOD(set_highlight_button_when_shown, bool)
VIEW_BUILDER_PROPERTY(base::OnceClosure, AcceptCallback)
VIEW_BUILDER_PROPERTY(base::OnceClosure, CancelCallback)
VIEW_BUILDER_PROPERTY(base::OnceClosure, CloseCallback)
VIEW_BUILDER_PROPERTY(const gfx::Insets&, ButtonRowInsets)
END_VIEW_BUILDER
}
DEFINE_VIEW_BUILDER(VIEWS_EXPORT, BubbleDialogDelegateView)
#endif