#include "chrome/browser/web_applications/web_app_provider.h"
#include <map>
#include <memory>
#include <optional>
#include <ostream>
#include <utility>
#include "base/check.h"
#include "base/check_is_test.h"
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "base/functional/callback_helpers.h"
#include "base/functional/concurrent_closures.h"
#include "base/location.h"
#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/types/pass_key.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/web_applications/commands/web_app_command.h"
#include "chrome/browser/web_applications/extensions_manager.h"
#include "chrome/browser/web_applications/externally_managed_app_manager.h"
#include "chrome/browser/web_applications/file_utils_wrapper.h"
#include "chrome/browser/web_applications/generated_icon_fix_manager.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_installation_manager.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_manager.h"
#include "chrome/browser/web_applications/manifest_update_manager.h"
#include "chrome/browser/web_applications/os_integration/os_integration_manager.h"
#include "chrome/browser/web_applications/os_integration/web_app_file_handler_manager.h"
#include "chrome/browser/web_applications/os_integration/web_app_protocol_handler_manager.h"
#include "chrome/browser/web_applications/policy/web_app_policy_manager.h"
#include "chrome/browser/web_applications/preinstalled_web_app_manager.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/browser/web_applications/web_app_audio_focus_id_map.h"
#include "chrome/browser/web_applications/web_app_command_manager.h"
#include "chrome/browser/web_applications/web_app_command_scheduler.h"
#include "chrome/browser/web_applications/web_app_database_factory.h"
#include "chrome/browser/web_applications/web_app_icon_manager.h"
#include "chrome/browser/web_applications/web_app_install_finalizer.h"
#include "chrome/browser/web_applications/web_app_install_manager.h"
#include "chrome/browser/web_applications/web_app_origin_association_manager.h"
#include "chrome/browser/web_applications/web_app_provider_factory.h"
#include "chrome/browser/web_applications/web_app_registrar.h"
#include "chrome/browser/web_applications/web_app_sync_bridge.h"
#include "chrome/browser/web_applications/web_app_translation_manager.h"
#include "chrome/browser/web_applications/web_app_ui_manager.h"
#include "chrome/browser/web_applications/web_app_utils.h"
#include "chrome/browser/web_applications/web_contents/web_contents_manager.h"
#include "components/webapps/common/web_app_id.h"
#include "content/public/browser/web_contents.h"
#if BUILDFLAG(IS_CHROMEOS)
#include "base/feature_list.h"
#include "chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager.h"
#include "chrome/browser/web_applications/migrations/adobe_express_oem_to_default_migration.h"
#include "chrome/browser/web_applications/migrations/migrate_preinstalls_to_aps.h"
#include "chrome/browser/web_applications/web_app_run_on_os_login_manager.h"
#include "chromeos/constants/chromeos_features.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_features.h"
#include "chromeos/ash/components/browser_context_helper/browser_context_types.h"
#endif
namespace webapps {
enum class WebappInstallSource;
}
namespace web_app {
WebAppProvider* WebAppProvider::GetDeprecated(Profile* profile) { … }
WebAppProvider* WebAppProvider::GetForWebApps(Profile* profile) { … }
WebAppProvider* WebAppProvider::GetForLocalAppsUnchecked(Profile* profile) { … }
WebAppProvider* WebAppProvider::GetForTest(Profile* profile) { … }
WebAppProvider* WebAppProvider::GetForWebContents(
content::WebContents* web_contents) { … }
WebAppProvider::WebAppProvider(Profile* profile) : … { … }
WebAppProvider::~WebAppProvider() = default;
void WebAppProvider::Start() { … }
WebAppCommandScheduler& WebAppProvider::scheduler() { … }
WebAppCommandManager& WebAppProvider::command_manager() { … }
WebAppRegistrar& WebAppProvider::registrar_unsafe() { … }
const WebAppRegistrar& WebAppProvider::registrar_unsafe() const { … }
WebAppRegistrarMutable& WebAppProvider::registrar_mutable(
base::PassKey<WebAppSyncBridge>) { … }
WebAppSyncBridge& WebAppProvider::sync_bridge_unsafe() { … }
WebAppInstallManager& WebAppProvider::install_manager() { … }
WebAppInstallFinalizer& WebAppProvider::install_finalizer() { … }
ManifestUpdateManager& WebAppProvider::manifest_update_manager() { … }
ExternallyManagedAppManager& WebAppProvider::externally_managed_app_manager() { … }
WebAppPolicyManager& WebAppProvider::policy_manager() { … }
IsolatedWebAppInstallationManager&
WebAppProvider::isolated_web_app_installation_manager() { … }
IsolatedWebAppUpdateManager& WebAppProvider::iwa_update_manager() { … }
#if BUILDFLAG(IS_CHROMEOS)
WebAppRunOnOsLoginManager& WebAppProvider::run_on_os_login_manager() {
CheckIsConnected();
return *web_app_run_on_os_login_manager_;
}
IsolatedWebAppPolicyManager& WebAppProvider::iwa_policy_manager() {
CheckIsConnected();
return *isolated_web_app_policy_manager_;
}
#endif
WebAppUiManager& WebAppProvider::ui_manager() { … }
WebAppAudioFocusIdMap& WebAppProvider::audio_focus_id_map() { … }
scoped_refptr<FileUtilsWrapper> WebAppProvider::file_utils() { … }
WebAppIconManager& WebAppProvider::icon_manager() { … }
WebAppTranslationManager& WebAppProvider::translation_manager() { … }
OsIntegrationManager& WebAppProvider::os_integration_manager() { … }
const OsIntegrationManager& WebAppProvider::os_integration_manager() const { … }
WebAppOriginAssociationManager& WebAppProvider::origin_association_manager() { … }
WebContentsManager& WebAppProvider::web_contents_manager() { … }
PreinstalledWebAppManager& WebAppProvider::preinstalled_web_app_manager() { … }
ExtensionsManager& WebAppProvider::extensions_manager() { … }
GeneratedIconFixManager& WebAppProvider::generated_icon_fix_manager() { … }
AbstractWebAppDatabaseFactory& WebAppProvider::database_factory() { … }
void WebAppProvider::Shutdown() { … }
base::WeakPtr<WebAppProvider> WebAppProvider::AsWeakPtr() { … }
FakeWebAppProvider* WebAppProvider::AsFakeWebAppProviderForTesting() { … }
void WebAppProvider::StartImpl() { … }
void WebAppProvider::CreateSubsystems(Profile* profile) { … }
void WebAppProvider::ConnectSubsystems() { … }
void WebAppProvider::StartSyncBridge() { … }
void WebAppProvider::OnSyncBridgeReady() { … }
void WebAppProvider::CheckIsConnected() const { … }
}