// 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 UI_VIEWS_BUBBLE_BUBBLE_DIALOG_MODEL_HOST_H_ #define UI_VIEWS_BUBBLE_BUBBLE_DIALOG_MODEL_HOST_H_ #include <memory> #include <vector> #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/types/pass_key.h" #include "ui/base/models/dialog_model.h" #include "ui/base/mojom/ui_base_types.mojom-shared.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/view.h" namespace views { class VIEWS_EXPORT DialogModelSectionHost : public BoxLayoutView, public ui::DialogModelFieldHost { … }; // TODO(pbos): Find a better name and move to a file separate from // BubbleDialogModelHost. See if we can have BubbleDialogModelHost use // DialogModelSectionHost directly (by removing more calls into // BubbleDialogModelHostContentsView). class BubbleDialogModelHostContentsView; // BubbleDialogModelHost is a views implementation of ui::DialogModelHost which // hosts a ui::DialogModel as a BubbleDialogDelegate. This exposes such as // SetAnchorView(), SetArrow() and SetHighlightedButton(). For methods that are // reflected in ui::DialogModelHost (such as ::Close()), prefer using the // ui::DialogModelHost to avoid platform-specific code (GetWidget()->Close()) // where unnecessary. For those methods, note that this can be retrieved as a // ui::DialogModelHost through DialogModel::host(). This helps minimize // platform-specific code from platform-agnostic model-delegate code. class VIEWS_EXPORT BubbleDialogModelHost : public BubbleDialogDelegate, public ui::DialogModelHost, public ui::DialogModelFieldHost { … }; } // namespace views #endif // UI_VIEWS_BUBBLE_BUBBLE_DIALOG_MODEL_HOST_H_