#ifndef UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_
#define UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_
#include <array>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include <variant>
#include "base/gtest_prod_util.h"
#include "base/observer_list.h"
#include "base/time/time.h"
#include "base/types/pass_key.h"
#include "ui/accessibility/ax_enums.mojom-forward.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/base/mojom/ui_base_types.mojom-shared.h"
#include "ui/base/ui_base_types.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/metadata/view_factory.h"
#include "ui/views/view.h"
#include "ui/views/views_export.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
class AppInfoDialogViewsTest;
class AuthenticatorRequestDialogView;
class AutoSigninFirstRunDialogView;
class BatchUploadDialogView;
class BluetoothDeviceCredentialsView;
class BluetoothDevicePairConfirmView;
class BookmarkEditorView;
class BruschettaInstallerView;
class CaretBrowsingDialogDelegate;
class CertificateSelector;
class ChooserDialogView;
class ConfirmBubbleViews;
class ConstrainedWindowTestDialog;
class CreateChromeApplicationShortcutView;
class CreateShortcutConfirmationView;
class CredentialLeakDialogView;
class CryptoModulePasswordDialogView;
class DeprecatedAppsDialogView;
class DesktopMediaPickerDialogView;
class DownloadDangerPromptViews;
class DownloadInProgressDialogView;
class ExtensionPopupInteractiveUiTest;
class ExternalProtocolDialog;
class FirstRunDialog;
class HungRendererDialogView;
class ImportLockDialogView;
class InteractiveBrowserTestDialog;
class JavaScriptTabModalDialogViewViews;
class NativeDialogContainer;
class OneClickSigninDialogView;
class ParentPermissionDialogView;
class RelaunchRequiredDialogView;
class RequestPinView;
class SelectAudioOutputDialog;
class ShareThisTabDialogView;
class SigninViewControllerDelegateViews;
class TabDragControllerTestDialog;
class TestWebModalDialog;
class UninstallView;
class WebAppIdentityUpdateConfirmationView;
class WebAppUninstallDialogDelegateView;
FORWARD_DECLARE_TEST(ExtensionPopupInteractiveUiTest,
ExtensionPopupClosesOnShowingWebDialog);
namespace arc {
class ArcAppDialogView;
class DataRemovalConfirmationDialog;
}
namespace ash {
class AccessibilityConfirmationDialog;
class AccessibilityFeatureDisableDialog;
class CancelCastingDialog;
class ChildModalDialogDelegate;
class ConfirmSignoutDialog;
class DisplayChangeDialog;
class EchoDialogView;
class IdleActionWarningDialogView;
class LocalAuthenticationRequestView;
class LogoutConfirmationDialog;
class ManagementDisclosureDialog;
class MultiprofilesIntroDialog;
class PinRequestView;
class PublicAccountMonitoringInfoDialog;
class RequestSystemProxyCredentialsView;
class SessionAbortedDialog;
class ShutdownConfirmationDialog;
class TeleportWarningDialog;
FORWARD_DECLARE_TEST(SnapGroupDividerTest,
DividerStackingOrderWithDialogTransientUndoStacking);
FORWARD_DECLARE_TEST(SnapGroupDividerTest,
DividerStackingWhenResizingWithDialogTransient);
namespace enrollment {
class EnrollmentDialogView;
}
namespace printing::oauth2 {
class SigninDialog;
}
}
namespace autofill {
class AutofillErrorDialogViewNativeViews;
class AutofillProgressDialogViews;
class BnplTosDialog;
class CardUnmaskOtpInputDialogViews;
class EditAddressProfileView;
class SaveAndFillDialog;
class WebauthnDialogView;
namespace payments {
class PaymentsWindowUserConsentDialogView;
class SelectBnplIssuerDialog;
}
}
namespace borealis {
class BorealisSplashScreenView;
}
namespace extensions {
class SecurityDialogTrackerTest;
}
namespace glic {
class GlicFreDialogView;
}
namespace payments {
class PaymentRequestDialogView;
class SecurePaymentConfirmationDialogView;
class SecurePaymentConfirmationNoCredsDialogView;
}
namespace policy {
class EnterpriseStartupDialogView;
class IdleDialogView;
class PolicyDialogBase;
}
namespace remoting {
class MessageBoxCore;
}
namespace safe_browsing {
class PasswordReuseModalWarningDialog;
class PromptForScanningModalDialog;
class TailoredSecurityUnconsentedModal;
}
namespace task_manager {
class TaskManagerView;
}
namespace web_app {
class LaunchAppUserChoiceDialogView;
}
namespace webid {
class AccountSelectionModalView;
}
namespace views {
class BubbleFrameView;
class DialogClientView;
class DialogClientViewTestDelegate;
class DialogObserver;
class InitialFocusTestDialog;
class MakeCloseSynchronousTest;
class TestDialog;
class TestDialogDelegateView;
FORWARD_DECLARE_TEST(DesktopScreenPositionClientTest, PositionDialog);
FORWARD_DECLARE_TEST(DialogDelegateCloseTest, AnyCallbackInhibitsDefaultClose);
FORWARD_DECLARE_TEST(DialogDelegateCloseTest,
CloseParentWidgetDoesNotInvokeCloseCallback);
FORWARD_DECLARE_TEST(
DialogDelegateCloseTest,
RecursiveCloseFromAcceptCallbackDoesNotTriggerSecondCallback);
FORWARD_DECLARE_TEST(DialogTest, AcceptCallbackWithCloseDoesClose);
FORWARD_DECLARE_TEST(DialogTest, AcceptCallbackWithCloseDoesNotClose);
FORWARD_DECLARE_TEST(DialogTest, CancelCallbackWithCloseDoesClose);
FORWARD_DECLARE_TEST(DialogTest, CancelCallbackWithCloseDoesNotClose);
FORWARD_DECLARE_TEST(DialogTest, ButtonEnableUpdatesState);
FORWARD_DECLARE_TEST(DialogTest, UnfocusableInitialFocus);
namespace examples {
class ColoredDialog;
template <class DialogType>
class DialogExampleDelegate;
class WidgetExample;
}
namespace test {
class NativeWidgetMacTest;
class RootViewTestDialogDelegate;
FORWARD_DECLARE_TEST(DesktopNativeWidgetAuraTest, WindowModalityActivationTest);
FORWARD_DECLARE_TEST(DesktopNativeWidgetAuraTest, WindowMouseModalityTest);
FORWARD_DECLARE_TEST(DesktopWidgetTestInteractive,
DesktopNativeWidgetWithModalTransientChild);
FORWARD_DECLARE_TEST(DesktopWidgetTestInteractive,
WindowModalWindowDestroyedActivationTest);
FORWARD_DECLARE_TEST(WidgetCaptureTest, SystemModalWindowReleasesCapture);
}
class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
public:
struct Params {
Params();
~Params();
std::optional<int> default_button = std::nullopt;
bool round_corners = true;
std::optional<int> corner_radius = std::nullopt;
bool draggable = false;
bool custom_frame = true;
int buttons = static_cast<int>(ui::mojom::DialogButton::kOk) |
static_cast<int>(ui::mojom::DialogButton::kCancel);
std::array<std::u16string,
static_cast<size_t>(ui::mojom::DialogButton::kCancel) + 1>
button_labels;
std::array<std::optional<ui::ButtonStyle>,
static_cast<size_t>(ui::mojom::DialogButton::kCancel) + 1>
button_styles;
int enabled_buttons = static_cast<int>(ui::mojom::DialogButton::kOk) |
static_cast<int>(ui::mojom::DialogButton::kCancel);
};
DialogDelegate();
DialogDelegate(const DialogDelegate&) = delete;
DialogDelegate& operator=(const DialogDelegate&) = delete;
~DialogDelegate() override;
static Widget* CreateDialogWidget(std::unique_ptr<WidgetDelegate> delegate,
gfx::NativeWindow context,
gfx::NativeView parent,
gfx::AcceleratedWidget parent_widget =
gfx::kNullAcceleratedWidget);
static Widget* CreateDialogWidget(WidgetDelegate* delegate,
gfx::NativeWindow context,
gfx::NativeView parent,
gfx::AcceleratedWidget parent_widget =
gfx::kNullAcceleratedWidget);
static bool CanSupportCustomFrame(gfx::NativeView parent,
gfx::AcceleratedWidget parent_widget);
static Widget::InitParams GetDialogWidgetInitParams(WidgetDelegate* delegate,
gfx::NativeWindow context,
gfx::NativeView parent,
const gfx::Rect& bounds,
gfx::AcceleratedWidget parent_widget =
gfx::kNullAcceleratedWidget);
int buttons() const { return params_.buttons; }
int GetDefaultDialogButton() const;
std::u16string GetDialogButtonLabel(ui::mojom::DialogButton button) const;
ui::ButtonStyle GetDialogButtonStyle(ui::mojom::DialogButton button) const;
bool GetIsDefault(ui::mojom::DialogButton button) const;
virtual bool IsDialogButtonEnabled(ui::mojom::DialogButton button) const;
virtual bool ShouldIgnoreButtonPressedEventHandling(
View* button,
const ui::Event& event) const;
virtual bool ShouldAllowKeyEventsDuringInputProtection() const;
virtual bool Cancel();
virtual bool Accept();
View* GetInitiallyFocusedView() override;
DialogDelegate* AsDialogDelegate() override;
ClientView* CreateClientView(Widget* widget) override;
std::unique_ptr<FrameView> CreateFrameView(Widget* widget) override;
static std::unique_ptr<FrameView> CreateDialogFrameView(Widget* widget);
const gfx::Insets& margins() const { return margins_.contents.value(); }
void set_margins(const gfx::Insets& margins) {
set_frame_margins({.contents = margins});
}
void set_title_margins(const gfx::Insets& title_margins) {
set_frame_margins({.title = title_margins});
}
void set_footnote_margins(const gfx::Insets& footnote_margins) {
set_frame_margins({.footnote = footnote_margins});
}
struct FrameMargins {
std::optional<gfx::Insets> contents;
std::optional<gfx::Insets> title;
std::optional<gfx::Insets> footnote;
};
const FrameMargins& frame_margins() const { return margins_; }
void set_frame_margins(const FrameMargins& margins);
void set_fixed_width(int fixed_width) { fixed_width_ = fixed_width; }
int fixed_width() const { return fixed_width_; }
template <typename T = View>
T* SetExtraView(std::unique_ptr<T> extra_view) {
T* view = extra_view.get();
extra_view_ = std::move(extra_view);
return view;
}
template <typename T>
T* SetFootnoteView(std::unique_ptr<T> footnote_view) {
T* view = footnote_view.get();
footnote_view_ = std::move(footnote_view);
return view;
}
BubbleFrameView* GetBubbleFrameView() const;
const DialogClientView* GetDialogClientView() const;
DialogClientView* GetDialogClientView();
views::MdTextButton* GetOkButton() const;
views::MdTextButton* GetCancelButton() const;
views::View* GetExtraView() const;
views::View* GetFootnoteViewForTesting() const;
void AddObserver(DialogObserver* observer);
void RemoveObserver(DialogObserver* observer);
void DialogModelChanged();
void TriggerInputProtection(bool force_early = false);
void set_use_round_corners(bool round) { params_.round_corners = round; }
void set_corner_radius(int corner_radius) {
params_.corner_radius = corner_radius;
}
const std::optional<int> corner_radius() const {
return params_.corner_radius;
}
void set_draggable(bool draggable) { params_.draggable = draggable; }
bool draggable() const { return params_.draggable; }
void set_use_custom_frame(bool use) { params_.custom_frame = use; }
bool use_custom_frame() const { return params_.custom_frame; }
void SetDefaultButton(int button);
void SetButtons(int buttons);
void SetButtonLabel(ui::mojom::DialogButton dialog_button,
std::u16string_view label);
void SetButtonStyle(ui::mojom::DialogButton button,
std::optional<ui::ButtonStyle> style);
void SetButtonEnabled(ui::mojom::DialogButton dialog_button, bool enabled);
void SetAcceptCallback(base::OnceClosure callback);
void SetAcceptCallbackWithClose(base::RepeatingCallback<bool()> callback);
void SetCancelCallback(base::OnceClosure callback);
void SetCancelCallbackWithClose(base::RepeatingCallback<bool()> callback);
void SetCloseCallback(base::OnceClosure callback);
void SetOwnershipOfNewWidget(Widget::InitParams::Ownership ownership);
std::optional<std::unique_ptr<View>> DisownExtraView();
void AcceptDialog();
void CancelDialog();
bool Close();
void ResetViewShownTimeStampForTesting();
void SetButtonRowInsets(const gfx::Insets& insets);
void WindowWillClose();
bool EscShouldCancelDialog() const;
void set_esc_should_cancel_dialog_override(
std::optional<bool> esc_should_cancel_dialog_override) {
esc_should_cancel_dialog_override_ = esc_should_cancel_dialog_override;
}
int GetCornerRadius() const;
bool allow_vertical_buttons() const { return allow_vertical_buttons_; }
void set_allow_vertical_buttons(bool allow) {
allow_vertical_buttons_ = allow;
}
protected:
ax::mojom::Role GetAccessibleWindowRole() override;
const Params& GetParams() const { return params_; }
std::unique_ptr<View> DisownFootnoteView();
private:
bool RunCloseCallback(
std::variant<base::OnceClosure, base::RepeatingCallback<bool()>>&
callback);
FrameMargins margins_;
int fixed_width_ = 0;
Params params_;
std::optional<std::unique_ptr<View>> extra_view_;
std::unique_ptr<View> footnote_view_;
base::ObserverList<DialogObserver>::UncheckedAndDanglingUntriaged
observer_list_;
std::variant<base::OnceClosure, base::RepeatingCallback<bool()>>
accept_callback_;
std::variant<base::OnceClosure, base::RepeatingCallback<bool()>>
cancel_callback_;
base::OnceClosure close_callback_;
bool already_started_close_ = false;
std::optional<bool> esc_should_cancel_dialog_override_;
Widget::InitParams::Ownership ownership_of_new_widget_ =
Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET;
bool allow_vertical_buttons_ = false;
};
class VIEWS_EXPORT DialogDelegateView : public DialogDelegate, public View {
METADATA_HEADER(DialogDelegateView, View)
public:
using DdvPassKey = base::PassKey<DialogDelegateView>;
explicit DialogDelegateView(DdvPassKey) {}
DialogDelegateView(const DialogDelegateView&) = delete;
DialogDelegateView& operator=(const DialogDelegateView&) = delete;
~DialogDelegateView() override;
Widget* GetWidget() override;
const Widget* GetWidget() const override;
View* GetContentsView() override;
private:
friend class ::AppInfoDialogViewsTest;
friend class ::AuthenticatorRequestDialogView;
friend class ::AutoSigninFirstRunDialogView;
friend class ::BatchUploadDialogView;
friend class ::BluetoothDeviceCredentialsView;
friend class ::BluetoothDevicePairConfirmView;
friend class ::BookmarkEditorView;
friend class ::BruschettaInstallerView;
friend class ::CaretBrowsingDialogDelegate;
friend class ::CertificateSelector;
friend class ::ChooserDialogView;
friend class ::ConfirmBubbleViews;
friend class ::ConstrainedWindowTestDialog;
friend class ::CreateChromeApplicationShortcutView;
friend class ::CreateShortcutConfirmationView;
friend class ::CredentialLeakDialogView;
friend class ::CryptoModulePasswordDialogView;
friend class ::DeprecatedAppsDialogView;
friend class ::DesktopMediaPickerDialogView;
friend class ::DownloadDangerPromptViews;
friend class ::DownloadInProgressDialogView;
friend class ::ExtensionPopupInteractiveUiTest;
friend class ::ExternalProtocolDialog;
friend class ::FirstRunDialog;
friend class ::HungRendererDialogView;
friend class ::ImportLockDialogView;
friend class ::InteractiveBrowserTestDialog;
friend class ::JavaScriptTabModalDialogViewViews;
friend class ::NativeDialogContainer;
friend class ::OneClickSigninDialogView;
friend class ::ParentPermissionDialogView;
friend class ::RelaunchRequiredDialogView;
friend class ::RequestPinView;
friend class ::SelectAudioOutputDialog;
friend class ::ShareThisTabDialogView;
friend class ::SigninViewControllerDelegateViews;
friend class ::TabDragControllerTestDialog;
friend class ::TestWebModalDialog;
friend class ::UninstallView;
friend class ::WebAppIdentityUpdateConfirmationView;
friend class ::WebAppUninstallDialogDelegateView;
FRIEND_TEST_ALL_PREFIXES(::ExtensionPopupInteractiveUiTest,
ExtensionPopupClosesOnShowingWebDialog);
friend class ::arc::ArcAppDialogView;
friend class ::arc::DataRemovalConfirmationDialog;
friend class ::ash::AccessibilityConfirmationDialog;
friend class ::ash::AccessibilityFeatureDisableDialog;
friend class ::ash::CancelCastingDialog;
friend class ::ash::ChildModalDialogDelegate;
friend class ::ash::ConfirmSignoutDialog;
friend class ::ash::DisplayChangeDialog;
friend class ::ash::EchoDialogView;
friend class ::ash::IdleActionWarningDialogView;
friend class ::ash::LocalAuthenticationRequestView;
friend class ::ash::LogoutConfirmationDialog;
friend class ::ash::ManagementDisclosureDialog;
friend class ::ash::MultiprofilesIntroDialog;
friend class ::ash::PinRequestView;
friend class ::ash::PublicAccountMonitoringInfoDialog;
friend class ::ash::RequestSystemProxyCredentialsView;
friend class ::ash::SessionAbortedDialog;
friend class ::ash::ShutdownConfirmationDialog;
friend class ::ash::TeleportWarningDialog;
FRIEND_TEST_ALL_PREFIXES(::ash::SnapGroupDividerTest,
DividerStackingOrderWithDialogTransientUndoStacking);
FRIEND_TEST_ALL_PREFIXES(::ash::SnapGroupDividerTest,
DividerStackingWhenResizingWithDialogTransient);
friend class ::ash::enrollment::EnrollmentDialogView;
friend class ::ash::printing::oauth2::SigninDialog;
friend class ::autofill::AutofillErrorDialogViewNativeViews;
friend class ::autofill::AutofillProgressDialogViews;
friend class ::autofill::BnplTosDialog;
friend class ::autofill::CardUnmaskOtpInputDialogViews;
friend class ::autofill::EditAddressProfileView;
friend class ::autofill::SaveAndFillDialog;
friend class ::autofill::WebauthnDialogView;
friend class ::autofill::payments::PaymentsWindowUserConsentDialogView;
friend class ::autofill::payments::SelectBnplIssuerDialog;
friend class ::borealis::BorealisSplashScreenView;
friend class ::extensions::SecurityDialogTrackerTest;
friend class ::glic::GlicFreDialogView;
friend class ::payments::PaymentRequestDialogView;
friend class ::payments::SecurePaymentConfirmationDialogView;
friend class ::payments::SecurePaymentConfirmationNoCredsDialogView;
friend class ::policy::EnterpriseStartupDialogView;
friend class ::policy::IdleDialogView;
friend class ::policy::PolicyDialogBase;
friend class ::remoting::MessageBoxCore;
friend class ::safe_browsing::PasswordReuseModalWarningDialog;
friend class ::safe_browsing::PromptForScanningModalDialog;
friend class ::safe_browsing::TailoredSecurityUnconsentedModal;
friend class ::task_manager::TaskManagerView;
friend class DialogClientViewTestDelegate;
friend class InitialFocusTestDialog;
friend class MakeCloseSynchronousTest;
friend class TestDialog;
friend class TestDialogDelegateView;
FRIEND_TEST_ALL_PREFIXES(DesktopScreenPositionClientTest, PositionDialog);
FRIEND_TEST_ALL_PREFIXES(DialogDelegateCloseTest,
AnyCallbackInhibitsDefaultClose);
FRIEND_TEST_ALL_PREFIXES(DialogDelegateCloseTest,
CloseParentWidgetDoesNotInvokeCloseCallback);
FRIEND_TEST_ALL_PREFIXES(
DialogDelegateCloseTest,
RecursiveCloseFromAcceptCallbackDoesNotTriggerSecondCallback);
FRIEND_TEST_ALL_PREFIXES(DialogTest, AcceptCallbackWithCloseDoesClose);
FRIEND_TEST_ALL_PREFIXES(DialogTest, AcceptCallbackWithCloseDoesNotClose);
FRIEND_TEST_ALL_PREFIXES(DialogTest, CancelCallbackWithCloseDoesClose);
FRIEND_TEST_ALL_PREFIXES(DialogTest, CancelCallbackWithCloseDoesNotClose);
FRIEND_TEST_ALL_PREFIXES(DialogTest, ButtonEnableUpdatesState);
FRIEND_TEST_ALL_PREFIXES(DialogTest, UnfocusableInitialFocus);
friend class examples::ColoredDialog;
friend class examples::DialogExampleDelegate<DialogDelegateView>;
friend class examples::WidgetExample;
friend class test::NativeWidgetMacTest;
friend class test::RootViewTestDialogDelegate;
FRIEND_TEST_ALL_PREFIXES(test::DesktopNativeWidgetAuraTest,
WindowModalityActivationTest);
FRIEND_TEST_ALL_PREFIXES(test::DesktopNativeWidgetAuraTest,
WindowMouseModalityTest);
FRIEND_TEST_ALL_PREFIXES(test::DesktopWidgetTestInteractive,
DesktopNativeWidgetWithModalTransientChild);
FRIEND_TEST_ALL_PREFIXES(test::DesktopWidgetTestInteractive,
WindowModalWindowDestroyedActivationTest);
FRIEND_TEST_ALL_PREFIXES(test::WidgetCaptureTest,
SystemModalWindowReleasesCapture);
friend class ::web_app::LaunchAppUserChoiceDialogView;
friend class ::webid::AccountSelectionModalView;
DialogDelegateView();
static DdvPassKey CreatePassKey() { return DdvPassKey(); }
};
template View* DialogDelegate::SetExtraView<View>(std::unique_ptr<View>);
template View* DialogDelegate::SetFootnoteView<View>(std::unique_ptr<View>);
BEGIN_VIEW_BUILDER(VIEWS_EXPORT, DialogDelegateView, 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::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 DialogDelegateView::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_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, DialogDelegateView)
#endif