1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_UPDATER_CONFIGURATOR_H_
#define CHROME_UPDATER_CONFIGURATOR_H_
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "base/containers/flat_map.h"
#include "base/memory/scoped_refptr.h"
#include "base/sequence_checker.h"
#include "base/time/time.h"
#include "chrome/updater/event_logger.h"
#include "components/update_client/configurator.h"
class GURL;
class PrefService;
namespace base {
class Version;
} // namespace base
namespace crx_file {
enum class VerifierFormat;
}
namespace update_client {
class NetworkFetcherFactory;
class CrxCache;
class CrxDownloaderFactory;
class ProtocolHandlerFactory;
} // namespace update_client
namespace updater {
class ExternalConstants;
class PersistedData;
class PolicyService;
class UpdaterPrefs;
enum class UpdaterScope;
class Configurator : public update_client::Configurator {
public:
Configurator(scoped_refptr<UpdaterPrefs> prefs,
scoped_refptr<ExternalConstants> external_constants,
UpdaterScope scope);
Configurator(const Configurator&) = delete;
Configurator& operator=(const Configurator&) = delete;
// Overrides for update_client::Configurator.
base::TimeDelta InitialDelay() const override;
base::TimeDelta NextCheckDelay() const override;
base::TimeDelta OnDemandDelay() const override;
base::TimeDelta UpdateDelay() const override;
std::vector<GURL> UpdateUrl() const override;
std::vector<GURL> PingUrl() const override;
std::string GetProdId() const override;
base::Version GetBrowserVersion() const override;
std::string GetChannel() const override;
std::string GetLang() const override;
std::string GetOSLongName() const override;
base::flat_map<std::string, std::string> ExtraRequestParams() const override;
std::string GetDownloadPreference() const override;
scoped_refptr<update_client::NetworkFetcherFactory> GetNetworkFetcherFactory()
override;
scoped_refptr<update_client::CrxDownloaderFactory> GetCrxDownloaderFactory()
override;
scoped_refptr<update_client::UnzipperFactory> GetUnzipperFactory() override;
scoped_refptr<update_client::PatcherFactory> GetPatcherFactory() override;
bool EnabledBackgroundDownloader() const override;
bool EnabledCupSigning() const override;
PrefService* GetPrefService() const override;
update_client::PersistedData* GetPersistedData() const override;
bool IsPerUserInstall() const override;
std::unique_ptr<update_client::ProtocolHandlerFactory>
GetProtocolHandlerFactory() const override;
std::optional<bool> IsMachineExternallyManaged() const override;
update_client::UpdaterStateProvider GetUpdaterStateProvider() const override;
scoped_refptr<update_client::CrxCache> GetCrxCache() const override;
bool IsConnectionMetered() const override;
scoped_refptr<PersistedData> GetUpdaterPersistedData() const;
scoped_refptr<UpdaterEventLogger> GetEventLogger() const;
virtual GURL CrashUploadURL() const;
base::TimeDelta ServerKeepAliveTime() const;
scoped_refptr<PolicyService> GetPolicyService() const;
crx_file::VerifierFormat GetCrxVerifierFormat() const;
base::TimeDelta MinimumEventLoggingCooldown() const;
private:
friend class base::RefCountedThreadSafe<Configurator>;
~Configurator() override;
SEQUENCE_CHECKER(sequence_checker_);
scoped_refptr<UpdaterPrefs> prefs_;
scoped_refptr<ExternalConstants> external_constants_;
scoped_refptr<PersistedData> persisted_data_;
scoped_refptr<PolicyService> policy_service_;
scoped_refptr<update_client::NetworkFetcherFactory> network_fetcher_factory_;
scoped_refptr<update_client::CrxDownloaderFactory> crx_downloader_factory_;
scoped_refptr<update_client::UnzipperFactory> unzip_factory_;
scoped_refptr<update_client::PatcherFactory> patch_factory_;
scoped_refptr<update_client::CrxCache> crx_cache_;
scoped_refptr<UpdaterEventLogger> event_logger_;
const std::optional<bool> is_managed_device_;
};
} // namespace updater
#endif // CHROME_UPDATER_CONFIGURATOR_H_
|