#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_apply_update_command.h"
#include <memory>
#include <optional>
#include <ostream>
#include <sstream>
#include <string>
#include <string_view>
#include <utility>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_forward.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "base/sequence_checker.h"
#include "base/strings/strcat.h"
#include "base/types/expected.h"
#include "base/types/expected_macros.h"
#include "base/values.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/web_applications/callback_utils.h"
#include "chrome/browser/web_applications/commands/web_app_command.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_install_command_helper.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_storage_location.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_version.h"
#include "chrome/browser/web_applications/isolated_web_apps/pending_install_info.h"
#include "chrome/browser/web_applications/locks/app_lock.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/browser/web_applications/web_app_install_finalizer.h"
#include "chrome/browser/web_applications/web_app_install_info.h"
#include "chrome/browser/web_applications/web_app_install_utils.h"
#include "chrome/browser/web_applications/web_app_registry_update.h"
#include "chrome/browser/web_applications/web_app_sync_bridge.h"
#include "chrome/browser/web_applications/web_app_utils.h"
#include "chrome/browser/web_applications/web_contents/web_contents_manager.h"
#include "components/webapps/browser/install_result_code.h"
#include "components/webapps/browser/web_contents/web_app_url_loader.h"
#include "components/webapps/common/web_app_id.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
namespace web_app {
std::ostream& operator<<(std::ostream& os,
const IsolatedWebAppApplyUpdateCommandError& error) { … }
IsolatedWebAppApplyUpdateCommand::IsolatedWebAppApplyUpdateCommand(
IsolatedWebAppUrlInfo url_info,
std::unique_ptr<content::WebContents> web_contents,
std::unique_ptr<ScopedKeepAlive> optional_keep_alive,
std::unique_ptr<ScopedProfileKeepAlive> optional_profile_keep_alive,
base::OnceCallback<void(
base::expected<void, IsolatedWebAppApplyUpdateCommandError>)> callback,
std::unique_ptr<IsolatedWebAppInstallCommandHelper> command_helper)
: … { … }
IsolatedWebAppApplyUpdateCommand::~IsolatedWebAppApplyUpdateCommand() = default;
void IsolatedWebAppApplyUpdateCommand::StartWithLock(
std::unique_ptr<AppLock> lock) { … }
void IsolatedWebAppApplyUpdateCommand::CheckIfUpdateIsStillPending(
base::OnceClosure next_step_callback) { … }
void IsolatedWebAppApplyUpdateCommand::CheckTrustAndSignatures(
base::OnceClosure next_step_callback) { … }
void IsolatedWebAppApplyUpdateCommand::CreateStoragePartition(
base::OnceClosure next_step_callback) { … }
void IsolatedWebAppApplyUpdateCommand::LoadInstallUrl(
base::OnceClosure next_step_callback) { … }
void IsolatedWebAppApplyUpdateCommand::CheckInstallabilityAndRetrieveManifest(
base::OnceCallback<void(blink::mojom::ManifestPtr)> next_step_callback) { … }
void IsolatedWebAppApplyUpdateCommand::ValidateManifestAndCreateInstallInfo(
base::OnceCallback<void(WebAppInstallInfo)> next_step_callback,
blink::mojom::ManifestPtr manifest) { … }
void IsolatedWebAppApplyUpdateCommand::RetrieveIconsAndPopulateInstallInfo(
base::OnceCallback<void(WebAppInstallInfo)> next_step_callback,
WebAppInstallInfo install_info) { … }
void IsolatedWebAppApplyUpdateCommand::Finalize(WebAppInstallInfo info) { … }
void IsolatedWebAppApplyUpdateCommand::OnFinalized(
const webapps::AppId& app_id,
webapps::InstallResultCode update_result_code) { … }
void IsolatedWebAppApplyUpdateCommand::ReportFailure(std::string_view message) { … }
void IsolatedWebAppApplyUpdateCommand::CleanupOnFailure(
base::OnceClosure next_step_callback) { … }
void IsolatedWebAppApplyUpdateCommand::ReportSuccess() { … }
Profile& IsolatedWebAppApplyUpdateCommand::profile() { … }
}