chromium/ui/views/bubble/bubble_dialog_model_host.cc

// 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.

#include "ui/views/bubble/bubble_dialog_model_host.h"

#include <utility>

#include "base/memory/raw_ptr.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/base/class_property.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/models/combobox_model.h"
#include "ui/base/models/dialog_model.h"
#include "ui/base/models/dialog_model_field.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/color_utils.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/border.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h"
#include "ui/views/bubble/bubble_dialog_utils.h"
#include "ui/views/controls/button/checkbox.h"
#include "ui/views/controls/button/label_button_border.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/controls/combobox/combobox.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/controls/separator.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/controls/theme_tracking_image_view.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/box_layout_view.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/style/typography.h"
#include "ui/views/view_class_properties.h"

namespace views {
namespace {

// Extra margin to be added to contents view when it's inside a scroll view.
constexpr int kScrollViewVerticalMargin =;

BubbleDialogModelHost::FieldType GetFieldTypeForField(
    ui::DialogModelField* field) {}

int GetFieldTopMargin(LayoutProvider* layout_provider,
                      const BubbleDialogModelHost::FieldType& field_type,
                      const BubbleDialogModelHost::FieldType& last_field_type) {}

int GetDialogTopMargins(LayoutProvider* layout_provider,
                        ui::DialogModelField* first_field) {}

int GetDialogBottomMargins(LayoutProvider* layout_provider,
                           ui::DialogModelField* last_field,
                           bool has_buttons) {}

// A subclass of Checkbox that allows using an external Label/StyledLabel view
// instead of LabelButton's internal label. This is required for the
// Label/StyledLabel to be clickable, while supporting Links which requires a
// StyledLabel.
class CheckboxControl : public Checkbox {};

BEGIN_METADATA()

struct DialogModelHostField {};

View* GetTargetView(const DialogModelHostField& field_view_info) {}

// TODO(pbos): Consider externalizing this functionality into a different
// format that could feasibly be adopted by LayoutManagers. This is used for
// BoxLayouts (but could be others) to agree on columns' preferred width as a
// replacement for using GridLayout.
class LayoutConsensusGroup {};

class LayoutConsensusView : public View {};

BEGIN_METADATA()

}  // namespace

BubbleDialogModelHost::CustomView::CustomView(std::unique_ptr<View> view,
                                              FieldType field_type,
                                              View* focusable_view)
    :{}

BubbleDialogModelHost::CustomView::~CustomView() = default;

std::unique_ptr<View> BubbleDialogModelHost::CustomView::TransferView() {}

class BubbleDialogModelHostContentsView final : public DialogModelSectionHost {};

BEGIN_METADATA()

std::unique_ptr<DialogModelSectionHost> DialogModelSectionHost::Create(
    ui::DialogModelSection* section,
    ui::ElementIdentifier initially_focused_field_id) {}

BEGIN_METADATA()

BubbleDialogModelHost::ThemeChangedObserver::ThemeChangedObserver(
    BubbleDialogModelHost* parent,
    BubbleDialogModelHostContentsView* contents_view)
    :{}
BubbleDialogModelHost::ThemeChangedObserver::~ThemeChangedObserver() = default;

void BubbleDialogModelHost::ThemeChangedObserver::OnViewThemeChanged(View*) {}

BubbleDialogModelHost::BubbleDialogModelHost(
    std::unique_ptr<ui::DialogModel> model,
    View* anchor_view,
    BubbleBorder::Arrow arrow,
    bool autosize)
    :{}

BubbleDialogModelHost::BubbleDialogModelHost(
    base::PassKey<BubbleDialogModelHost>,
    std::unique_ptr<ui::DialogModel> model,
    View* anchor_view,
    BubbleBorder::Arrow arrow,
    ui::mojom::ModalType modal_type,
    bool autosize)
    :{}

BubbleDialogModelHost::~BubbleDialogModelHost() {}

std::unique_ptr<BubbleDialogModelHost> BubbleDialogModelHost::CreateModal(
    std::unique_ptr<ui::DialogModel> model,
    ui::mojom::ModalType modal_type,
    bool autosize) {}

View* BubbleDialogModelHost::GetInitiallyFocusedView() {}

void BubbleDialogModelHost::OnWidgetInitialized() {}

void BubbleDialogModelHost::Close() {}

BubbleDialogModelHostContentsView* BubbleDialogModelHost::InitContentsView(
    ui::DialogModelSection* contents) {}

void BubbleDialogModelHost::OnContentsViewChanged() {}

void BubbleDialogModelHost::OnDialogButtonChanged() {}

void BubbleDialogModelHost::UpdateWindowIcon() {}

void BubbleDialogModelHost::UpdateSpacingAndMargins() {}

void BubbleDialogModelHost::OnWindowClosing() {}

void BubbleDialogModelHost::UpdateDialogButtons() {}

bool BubbleDialogModelHost::IsModalDialog() const {}

}  // namespace views