#include "chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_coordinator.h"
#include <memory>
#include <optional>
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "base/task/sequenced_task_runner.h"
#include "chrome/browser/profiles/profile.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_controller.h"
#include "chrome/browser/ui/views/web_apps/isolated_web_apps/pref_observer.h"
#include "chrome/browser/ui/web_applications/web_app_dialogs.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_features.h"
#include "chrome/browser/web_applications/web_app_provider.h"
#include "components/webapps/common/web_app_id.h"
namespace web_app {
namespace {
void DeleteCoordinatorHelper(
std::unique_ptr<IsolatedWebAppInstallerCoordinator> coordinator) { … }
}
IsolatedWebAppInstallerCoordinator* LaunchIsolatedWebAppInstaller(
Profile* profile,
const base::FilePath& bundle_path,
base::OnceClosure on_closed_callback) { … }
IsolatedWebAppInstallerCoordinator*
IsolatedWebAppInstallerCoordinator::CreateAndStart(
Profile* profile,
const base::FilePath& bundle_path,
base::OnceClosure on_closed_callback,
std::unique_ptr<IsolatedWebAppsEnabledPrefObserver> pref_observer) { … }
void FocusIsolatedWebAppInstaller(
IsolatedWebAppInstallerCoordinator* coordinator) { … }
IsolatedWebAppInstallerCoordinator::IsolatedWebAppInstallerCoordinator(
Profile* profile,
const base::FilePath& bundle_path,
base::OnceClosure on_closed_callback,
std::unique_ptr<IsolatedWebAppsEnabledPrefObserver> pref_observer)
: … { … }
IsolatedWebAppInstallerCoordinator::~IsolatedWebAppInstallerCoordinator() =
default;
void IsolatedWebAppInstallerCoordinator::Start(
base::OnceCallback<void(std::optional<webapps::AppId>)> callback) { … }
void IsolatedWebAppInstallerCoordinator::FocusWindow() { … }
void IsolatedWebAppInstallerCoordinator::OnDialogClosed(
base::OnceCallback<void(std::optional<webapps::AppId>)> callback) { … }
IsolatedWebAppInstallerModel*
IsolatedWebAppInstallerCoordinator::GetModelForTesting() { … }
IsolatedWebAppInstallerViewController*
IsolatedWebAppInstallerCoordinator::GetControllerForTesting() { … }
}