chromium/chrome/updater/update_service_impl_impl.h

// Copyright 2020 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_UPDATE_SERVICE_IMPL_IMPL_H_
#define CHROME_UPDATER_UPDATE_SERVICE_IMPL_IMPL_H_

#include <map>
#include <optional>
#include <string>
#include <vector>

#include "base/containers/flat_map.h"
#include "base/containers/queue.h"
#include "base/functional/callback_forward.h"
#include "base/memory/scoped_refptr.h"
#include "base/sequence_checker.h"
#include "base/values.h"
#include "chrome/updater/update_service.h"

namespace base {
class FilePath;
class SequencedTaskRunner;
class Version;
}  // namespace base

namespace update_client {
class UpdateClient;
}  // namespace update_client

namespace updater {
class Configurator;
class PersistedData;
class PolicyService;
struct RegistrationRequest;

// All functions and callbacks must be called on the same sequence.
class UpdateServiceImplImpl : public UpdateService {};

namespace internal {
UpdateService::Result ToResult(update_client::Error error);

void GetComponents(
    scoped_refptr<PolicyService> policy_service,
    crx_file::VerifierFormat verifier_format,
    scoped_refptr<PersistedData> persisted_data,
    const base::flat_map<std::string, std::string>& app_client_install_data,
    const base::flat_map<std::string, std::string>& app_install_data_index,
    const std::string& install_source,
    UpdateService::Priority priority,
    bool update_blocked,
    UpdateService::PolicySameVersionUpdate policy_same_version_update,
    const std::vector<std::string>& ids,
    base::OnceCallback<
        void(const std::vector<std::optional<update_client::CrxComponent>>&)>
        callback);

#if BUILDFLAG(IS_WIN)
std::string GetInstallerText(UpdateService::ErrorCategory error_category,
                             int error_code,
                             int extra_code);
#endif  // BUILDFLAG(IS_WIN)
}  // namespace internal

}  // namespace updater

#endif  // CHROME_UPDATER_UPDATE_SERVICE_IMPL_IMPL_H_