#include "chrome/browser/ui/views/web_apps/web_app_uninstall_dialog_view.h"
#include "base/functional/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/web_apps/web_app_info_image_source.h"
#include "chrome/browser/ui/web_applications/web_app_dialogs.h"
#include "chrome/browser/web_applications/web_app_command_scheduler.h"
#include "chrome/browser/web_applications/web_app_icon_manager.h"
#include "chrome/browser/web_applications/web_app_provider.h"
#include "chrome/browser/web_applications/web_app_registrar.h"
#include "chrome/browser/web_applications/web_app_uninstall_dialog_user_options.h"
#include "chrome/grit/branded_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/constrained_window/constrained_window_views.h"
#include "components/url_formatter/elide_url.h"
#include "components/webapps/browser/installable/installable_metrics.h"
#include "extensions/browser/extension_dialog_auto_confirm.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.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/gfx/geometry/insets.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/views/controls/button/checkbox.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_delegate.h"
namespace {
constexpr int kIconSizeInDip = …;
enum HistogramCloseAction { … };
}
WebAppUninstallDialogDelegateView::WebAppUninstallDialogDelegateView(
Profile* profile,
webapps::AppId app_id,
webapps::WebappUninstallSource uninstall_source,
std::map<web_app::SquareSizePx, SkBitmap> icon_bitmaps,
web_app::UninstallDialogCallback uninstall_choice_callback)
: … { … }
WebAppUninstallDialogDelegateView::~WebAppUninstallDialogDelegateView() { … }
void WebAppUninstallDialogDelegateView::OnDialogAccepted() { … }
void WebAppUninstallDialogDelegateView::OnDialogCanceled() { … }
void WebAppUninstallDialogDelegateView::OnWebAppInstallManagerDestroyed() { … }
ui::ImageModel WebAppUninstallDialogDelegateView::GetWindowIcon() { … }
void WebAppUninstallDialogDelegateView::OnWebAppWillBeUninstalled(
const webapps::AppId& app_id) { … }
void WebAppUninstallDialogDelegateView::Uninstall(bool clear_site_data) { … }
void WebAppUninstallDialogDelegateView::ProcessAutoConfirmValue() { … }
BEGIN_METADATA(…)
namespace web_app {
void ShowWebAppUninstallDialog(
Profile* profile,
const webapps::AppId& app_id,
webapps::WebappUninstallSource uninstall_source,
gfx::NativeWindow parent,
std::map<web_app::SquareSizePx, SkBitmap> icon_bitmaps,
web_app::UninstallDialogCallback uninstall_dialog_result_callback) { … }
}