#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) { … }
class ToU16String { … };
class AnnotatedProgressBar : public views::BoxLayoutView { … };
BEGIN_METADATA(…)
class InfoPane : public views::BoxLayoutView { … };
BEGIN_METADATA(…)
class InstallerDialogView : public views::BoxLayoutView { … };
BEGIN_METADATA(…)
}
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) { … }
void IsolatedWebAppInstallerView::SetDialogButtons(
views::DialogDelegate* dialog_delegate,
int close_button_label_id,
std::optional<int> accept_button_label_id) { … }
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(…)
}