chromium/chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view_impl.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view_impl.h"

#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>

#include "base/functional/callback.h"
#include "base/functional/overloaded.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/ui/views/accessibility/non_accessible_image_view.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_model.h"
#include "chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view.h"
#include "chrome/browser/ui/views/web_apps/web_app_info_image_source.h"
#include "chrome/browser/web_applications/isolated_web_apps/signed_web_bundle_metadata.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/theme_resources.h"
#include "components/vector_icons/vector_icons.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/dialog_model.h"
#include "ui/base/models/dialog_model_field.h"
#include "ui/base/models/image_model.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/color/color_id.h"
#include "ui/compositor/layer.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/range/range.h"
#include "ui/gfx/vector_icon_types.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/background.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h"
#include "ui/views/bubble/bubble_dialog_model_host.h"
#include "ui/views/controls/progress_bar.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/box_layout_view.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/style/typography.h"
#include "ui/views/view.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/view_observer.h"

namespace web_app {
namespace {

constexpr int kIconSize =;
constexpr int kNestedDialogIconSize =;
constexpr int kInfoPaneCornerRadius =;
constexpr int kProgressViewHorizontalPadding =;

views::View* GetRootView(views::View* view) {}

gfx::Insets BottomPadding(views::DistanceMetric distance) {}

std::unique_ptr<views::StyledLabel> CreateLabelWithContextAndStyle(
    views::style::TextContext text_context,
    views::style::TextStyle text_style,
    std::optional<std::u16string> text = std::nullopt) {}

ui::ImageModel CreateImageModelFromVector(const gfx::VectorIcon& vector_icon,
                                          ui::ColorId color_id) {}

ui::ImageModel CreateImageModelFromBundleMetadata(
    const SignedWebBundleMetadata& metadata) {}

// Implicitly converts an id or raw string to a string. Used as an argument to
// functions that need a string, but want to accept either ids or raw strings.
class ToU16String {};

// A View containing a progress bar and a description string below it.
class AnnotatedProgressBar : public views::BoxLayoutView {};
BEGIN_METADATA()

// A View that displays key/value entries in a pane with a different
// background color and a rounded border.
class InfoPane : public views::BoxLayoutView {};
BEGIN_METADATA()

// The contents view used for all installer screens. This will handle rendering
// common UI elements like icon, title, subtitle, and an optional View for the
// body of the dialog.
class InstallerDialogView : public views::BoxLayoutView {};

BEGIN_METADATA()

}  // namespace

class DisabledView : public InstallerDialogView {};

BEGIN_METADATA()

class GetMetadataView : public InstallerDialogView {};

BEGIN_METADATA()

class ShowMetadataView : public InstallerDialogView {};

BEGIN_METADATA()

class InstallView : public InstallerDialogView {};

BEGIN_METADATA()

class InstallSuccessView : public InstallerDialogView {};

BEGIN_METADATA()

class DimOverlayView : public views::View {};

BEGIN_METADATA()

void IsolatedWebAppInstallerViewImpl::Dim(bool dim) {}

// static
void IsolatedWebAppInstallerView::SetDialogButtons(
    views::DialogDelegate* dialog_delegate,
    int close_button_label_id,
    std::optional<int> accept_button_label_id) {}

// static
std::unique_ptr<IsolatedWebAppInstallerView>
IsolatedWebAppInstallerView::Create(Delegate* delegate) {}

IsolatedWebAppInstallerViewImpl::IsolatedWebAppInstallerViewImpl(
    Delegate* delegate)
    :{}

IsolatedWebAppInstallerViewImpl::~IsolatedWebAppInstallerViewImpl() = default;

void IsolatedWebAppInstallerViewImpl::ShowDisabledScreen() {}

void IsolatedWebAppInstallerViewImpl::ShowGetMetadataScreen() {}

void IsolatedWebAppInstallerViewImpl::UpdateGetMetadataProgress(
    double percent) {}

void IsolatedWebAppInstallerViewImpl::ShowMetadataScreen(
    const SignedWebBundleMetadata& bundle_metadata) {}

void IsolatedWebAppInstallerViewImpl::ShowInstallScreen(
    const SignedWebBundleMetadata& bundle_metadata) {}

void IsolatedWebAppInstallerViewImpl::UpdateInstallProgress(double percent) {}

void IsolatedWebAppInstallerViewImpl::ShowInstallSuccessScreen(
    const SignedWebBundleMetadata& bundle_metadata) {}

views::Widget* IsolatedWebAppInstallerViewImpl::ShowDialog(
    const IsolatedWebAppInstallerModel::Dialog& dialog) {}

gfx::Size IsolatedWebAppInstallerViewImpl::GetMaximumSize() const {}

views::Widget* IsolatedWebAppInstallerViewImpl::ShowChildDialog(
    int title,
    const ui::DialogModelLabel& subtitle,
    const ui::ImageModel& icon_model,
    std::optional<int> ok_label) {}

views::Widget* IsolatedWebAppInstallerViewImpl::ShowChildDialog(
    const std::u16string& title,
    const ui::DialogModelLabel& subtitle,
    const ui::ImageModel& icon_model,
    std::optional<int> ok_label) {}

void IsolatedWebAppInstallerViewImpl::ShowChildView(views::View* view) {}

void IsolatedWebAppInstallerViewImpl::OnChildDialogDestroying() {}

BEGIN_METADATA()

}  // namespace web_app