#include "chrome/services/on_device_translation/translate_kit_translator.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "chrome/services/on_device_translation/public/mojom/translator.mojom.h"
#include "chrome/services/on_device_translation/translate_kit_wrapper.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
namespace on_device_translation {
TranslateKitTranslator::TranslateKitTranslator(const std::string& source_lang,
const std::string& target_lang)
: … { … }
TranslateKitTranslator::~TranslateKitTranslator() = default;
void TranslateKitTranslator::CanTranslateAfterGettingTranslateKitWrapper(
const std::string& source_lang,
const std::string& target_lang,
base::OnceCallback<void(bool)> can_create_callback,
TranslateKitWrapper* wrapper) { … }
void TranslateKitTranslator::CanTranslate(
const std::string& source_lang,
const std::string& target_lang,
on_device_translation::mojom::OnDeviceTranslationService::
CanTranslateCallback can_create_callback) { … }
void TranslateKitTranslator::CreateTranslatorAfterGettingTranslateKitWrapper(
const std::string& source_lang,
const std::string& target_lang,
mojo::PendingReceiver<on_device_translation::mojom::Translator> receiver,
base::OnceCallback<void(bool)> create_translator_callback,
TranslateKitWrapper* wrapper) { … }
void TranslateKitTranslator::Create(
const std::string& source_lang,
const std::string& target_lang,
mojo::PendingReceiver<on_device_translation::mojom::Translator> receiver,
on_device_translation::mojom::OnDeviceTranslationService::
CreateTranslatorCallback create_translator_callback) { … }
void TranslateKitTranslator::Translate(const std::string& input,
TranslateCallback translate_callback) { … }
}