#ifndef COMPONENTS_TRANSLATE_CONTENT_COMMON_TRANSLATE_MOJOM_H_
#define COMPONENTS_TRANSLATE_CONTENT_COMMON_TRANSLATE_MOJOM_H_
#include <stdint.h>
#include <limits>
#include <optional>
#include <type_traits>
#include <utility>
#include "base/types/cxx23_to_underlying.h"
#include "mojo/public/cpp/bindings/clone_traits.h"
#include "mojo/public/cpp/bindings/equals_traits.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/cpp/bindings/union_traits.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"
#include "components/translate/content/common/translate.mojom-features.h"
#include "components/translate/content/common/translate.mojom-shared.h"
#include "components/translate/content/common/translate.mojom-forward.h"
#include "mojo/public/mojom/base/file.mojom-forward.h"
#include "mojo/public/mojom/base/time.mojom.h"
#include "mojo/public/mojom/base/string16.mojom.h"
#include "url/mojom/url.mojom.h"
#include <string>
#include <vector>
#include "mojo/public/cpp/bindings/lib/control_message_handler.h"
#include "mojo/public/cpp/bindings/lib/message_size_estimator.h"
#include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h"
#include "components/translate/content/common/translate_mojom_traits.h"
namespace translate::mojom {
class TranslateAgentProxy;
template <typename ImplRefTraits>
class TranslateAgentStub;
class TranslateAgentRequestValidator;
class TranslateAgentResponseValidator;
class TranslateAgent
: public TranslateAgentInterfaceBase { … };
class ContentTranslateDriverProxy;
template <typename ImplRefTraits>
class ContentTranslateDriverStub;
class ContentTranslateDriverRequestValidator;
class ContentTranslateDriver
: public ContentTranslateDriverInterfaceBase { … };
class TranslateAgentProxy
: public TranslateAgent { … };
class ContentTranslateDriverProxy
: public ContentTranslateDriver { … };
class TranslateAgentStubDispatch { … };
template <typename ImplRefTraits =
mojo::RawPtrImplRefTraits<TranslateAgent>>
class TranslateAgentStub
: public mojo::MessageReceiverWithResponderStatus {
public:
using ImplPointerType = typename ImplRefTraits::PointerType;
TranslateAgentStub() = default;
~TranslateAgentStub() override = default;
void set_sink(ImplPointerType sink) { … }
ImplPointerType& sink() { … }
bool Accept(mojo::Message* message) override { … }
bool AcceptWithResponder(
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override { … }
private:
ImplPointerType sink_;
};
class ContentTranslateDriverStubDispatch { … };
template <typename ImplRefTraits =
mojo::RawPtrImplRefTraits<ContentTranslateDriver>>
class ContentTranslateDriverStub
: public mojo::MessageReceiverWithResponderStatus {
public:
using ImplPointerType = typename ImplRefTraits::PointerType;
ContentTranslateDriverStub() = default;
~ContentTranslateDriverStub() override = default;
void set_sink(ImplPointerType sink) { … }
ImplPointerType& sink() { … }
bool Accept(mojo::Message* message) override { … }
bool AcceptWithResponder(
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override { … }
private:
ImplPointerType sink_;
};
class TranslateAgentRequestValidator : public mojo::MessageReceiver { … };
class ContentTranslateDriverRequestValidator : public mojo::MessageReceiver { … };
class TranslateAgentResponseValidator : public mojo::MessageReceiver { … };
class LanguageDetectionDetails { … };
template <typename T, LanguageDetectionDetails::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);
template <typename T, LanguageDetectionDetails::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) { … }
template <typename T, LanguageDetectionDetails::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) { … }
template <typename T, LanguageDetectionDetails::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) { … }
template <typename StructPtrType>
LanguageDetectionDetailsPtr LanguageDetectionDetails::Clone() const { … }
template <typename T, LanguageDetectionDetails::EnableIfSame<T>*>
bool LanguageDetectionDetails::Equals(const T& other_struct) const { … }
template <typename T, LanguageDetectionDetails::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) { … }
}
namespace mojo {
template <>
struct StructTraits<::translate::mojom::LanguageDetectionDetails::DataView,
::translate::mojom::LanguageDetectionDetailsPtr> { … };
}
#endif