#include "base/functional/callback.h"
#include "base/i18n/message_formatter.h"
#include "base/types/cxx23_to_underlying.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/web_apps/web_app_info_image_source.h"
#include "chrome/browser/ui/web_applications/sub_apps_install_dialog_controller.h"
#include "chrome/browser/ui/web_applications/web_app_dialogs.h"
#include "chrome/browser/web_applications/web_app_install_info.h"
#include "chrome/grit/generated_resources.h"
#include "components/constrained_window/constrained_window_views.h"
#include "components/omnibox/browser/vector_icons.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/mojom/ui_base_types.mojom-shared.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/views/bubble/bubble_dialog_model_host.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/layout/box_layout_view.h"
namespace web_app {
namespace {
constexpr int kSubAppIconSize = …;
int GetDistanceMetric(int metric) { … }
ui::ImageModel GetInstallAppIcon() { … }
std::u16string DialogTitle(int num_sub_apps) { … }
ui::DialogModelLabel DialogDescription(int num_sub_apps,
std::u16string parent_app_name) { … }
std::unique_ptr<views::BubbleDialogModelHost::CustomView>
PermissionsExplanation(int num_sub_apps,
std::u16string parent_app_name,
base::RepeatingClosure settings_page_callback) { … }
std::u16string AcceptButtonLabel() { … }
std::u16string CancelButtonLabel() { … }
std::unique_ptr<views::ScrollView> CreateSubAppsListView(
const std::vector<std::unique_ptr<WebAppInstallInfo>>& sub_apps) { … }
}
views::Widget* CreateSubAppsInstallDialogWidget(
const std::u16string parent_app_name,
const std::vector<std::unique_ptr<web_app::WebAppInstallInfo>>& sub_apps,
base::RepeatingClosure settings_page_callback,
gfx::NativeWindow window) { … }
}