#include "chrome/browser/component_updater/chrome_component_updater_configurator.h"
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "base/check.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/path_service.h"
#include "base/sequence_checker.h"
#include "base/strings/sys_string_conversions.h"
#include "base/time/time.h"
#include "base/version.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/component_updater/component_updater_utils.h"
#include "chrome/browser/component_updater/updater_state.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/update_client/chrome_update_query_params_delegate.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_paths.h"
#include "components/component_updater/component_updater_command_line_config_policy.h"
#include "components/component_updater/configurator_impl.h"
#include "components/prefs/pref_service.h"
#include "components/services/patch/content/patch_service.h"
#include "components/services/unzip/content/unzip_service.h"
#include "components/update_client/activity_data_service.h"
#include "components/update_client/crx_downloader_factory.h"
#include "components/update_client/net/network_chromium.h"
#include "components/update_client/patch/patch_impl.h"
#include "components/update_client/persisted_data.h"
#include "components/update_client/protocol_handler.h"
#include "components/update_client/unzip/unzip_impl.h"
#include "components/update_client/unzipper.h"
#include "components/update_client/update_query_params.h"
#include "content/public/browser/browser_thread.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#if BUILDFLAG(IS_WIN)
#include "base/enterprise_util.h"
#include "chrome/installer/util/google_update_settings.h"
#endif
namespace component_updater {
namespace {
class ChromeConfigurator : public update_client::Configurator { … };
ChromeConfigurator::ChromeConfigurator(const base::CommandLine* cmdline,
PrefService* pref_service)
: … { … }
base::TimeDelta ChromeConfigurator::InitialDelay() const { … }
base::TimeDelta ChromeConfigurator::NextCheckDelay() const { … }
base::TimeDelta ChromeConfigurator::OnDemandDelay() const { … }
base::TimeDelta ChromeConfigurator::UpdateDelay() const { … }
std::vector<GURL> ChromeConfigurator::UpdateUrl() const { … }
std::vector<GURL> ChromeConfigurator::PingUrl() const { … }
std::string ChromeConfigurator::GetProdId() const { … }
base::Version ChromeConfigurator::GetBrowserVersion() const { … }
std::string ChromeConfigurator::GetChannel() const { … }
std::string ChromeConfigurator::GetLang() const { … }
std::string ChromeConfigurator::GetOSLongName() const { … }
base::flat_map<std::string, std::string>
ChromeConfigurator::ExtraRequestParams() const { … }
std::string ChromeConfigurator::GetDownloadPreference() const { … }
scoped_refptr<update_client::NetworkFetcherFactory>
ChromeConfigurator::GetNetworkFetcherFactory() { … }
scoped_refptr<update_client::CrxDownloaderFactory>
ChromeConfigurator::GetCrxDownloaderFactory() { … }
scoped_refptr<update_client::UnzipperFactory>
ChromeConfigurator::GetUnzipperFactory() { … }
scoped_refptr<update_client::PatcherFactory>
ChromeConfigurator::GetPatcherFactory() { … }
bool ChromeConfigurator::EnabledDeltas() const { … }
bool ChromeConfigurator::EnabledBackgroundDownloader() const { … }
bool ChromeConfigurator::EnabledCupSigning() const { … }
PrefService* ChromeConfigurator::GetPrefService() const { … }
update_client::PersistedData* ChromeConfigurator::GetPersistedData() const { … }
bool ChromeConfigurator::IsPerUserInstall() const { … }
std::unique_ptr<update_client::ProtocolHandlerFactory>
ChromeConfigurator::GetProtocolHandlerFactory() const { … }
std::optional<bool> ChromeConfigurator::IsMachineExternallyManaged() const { … }
update_client::UpdaterStateProvider
ChromeConfigurator::GetUpdaterStateProvider() const { … }
std::optional<base::FilePath> ChromeConfigurator::GetCrxCachePath() const { … }
std::optional<base::FilePath> ChromeConfigurator::GetBackgroundDownloaderCache()
const { … }
bool ChromeConfigurator::IsConnectionMetered() const { … }
}
scoped_refptr<update_client::Configurator>
MakeChromeComponentUpdaterConfigurator(const base::CommandLine* cmdline,
PrefService* pref_service) { … }
}