chromium/chrome/browser/component_updater/soda_component_installer.h

// 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_BROWSER_COMPONENT_UPDATER_SODA_COMPONENT_INSTALLER_H_
#define CHROME_BROWSER_COMPONENT_UPDATER_SODA_COMPONENT_INSTALLER_H_

#include <string>

#include "base/gtest_prod_util.h"
#include "base/values.h"
#include "components/component_updater/component_installer.h"
#include "components/prefs/pref_service.h"
#include "components/soda/constants.h"
#include "components/update_client/update_client.h"

namespace component_updater {

// Success callback to be run after the component is downloaded.
OnSodaComponentInstalledCallback;

OnSodaComponentReadyCallback;
OnSodaLanguagePackComponentReadyCallback;

class SodaComponentInstallerPolicy : public ComponentInstallerPolicy {};

// Call once during startup to make the component update service aware of
// the File Type Policies component. Should only be called by SodaInstaller.
void RegisterSodaComponent(ComponentUpdateService* cus,
                           PrefService* global_prefs,
                           base::OnceClosure on_ready_callback,
                           base::OnceClosure on_registered_callback);

// Should only be called by SodaInstaller.
void RegisterSodaLanguageComponent(
    ComponentUpdateService* cus,
    const std::string& language,
    PrefService* global_prefs,
    OnSodaLanguagePackComponentReadyCallback on_ready_callback);

}  // namespace component_updater

#endif  // CHROME_BROWSER_COMPONENT_UPDATER_SODA_COMPONENT_INSTALLER_H_