// chrome/browser/geic/geic.mojom.h is auto generated by mojom_bindings_generator.py, do not edit

// Copyright 2013 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_GEIC_GEIC_MOJOM_H_
#define CHROME_BROWSER_GEIC_GEIC_MOJOM_H_

#include <stdint.h>

#include <limits>
#include <optional>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/clone_traits.h"
#include "mojo/public/cpp/bindings/equals_traits.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 "mojo/public/cpp/bindings/lib/serialization.h"

#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"

#include "chrome/browser/geic/geic.mojom-features.h"  // IWYU pragma: export
#include "chrome/browser/geic/geic.mojom-shared.h"  // IWYU pragma: export
#include "chrome/browser/geic/geic.mojom-forward.h"  // IWYU pragma: export
#include "chrome/browser/pwc/pwc_features.mojom-forward.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/raw_ptr_impl_ref_traits.h"


#include "base/types/expected.h"




namespace geic::mojom {

class GeicApiProxy;

template <typename ImplRefTraits>
class GeicApiStub;

class GeicApiRequestValidator;


class GeicApi
    : public GeicApiInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "geic.mojom.GeicApi";
  static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message);
  static const char* MessageToMethodName_(mojo::Message& message);
  static bool RuntimeFeature_IsEnabled_(bool expected);
  static constexpr uint32_t Version_ = 0;
  static constexpr bool PassesAssociatedKinds_ = false;
  static constexpr bool HasUninterruptableMethods_ = false;

  using Base_ = GeicApiInterfaceBase;
  using Proxy_ = GeicApiProxy;

  template <typename ImplRefTraits>
  using Stub_ = GeicApiStub<ImplRefTraits>;

  using RequestValidator_ = GeicApiRequestValidator;
  using ResponseValidator_ = mojo::PassThroughFilter;
  enum MethodMinVersions : uint32_t {
  };

// crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK
// with not having this data in traces there.
#if !BUILDFLAG(IS_FUCHSIA)
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~GeicApi() = default;
};

class GeicBrowserHostProxy;

template <typename ImplRefTraits>
class GeicBrowserHostStub;

class GeicBrowserHostRequestValidator;
class GeicBrowserHostResponseValidator;


class GeicBrowserHost
    : public GeicBrowserHostInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "geic.mojom.GeicBrowserHost";
  static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message);
  static const char* MessageToMethodName_(mojo::Message& message);
  static constexpr uint32_t Version_ = 0;
  static constexpr bool PassesAssociatedKinds_ = false;
  static constexpr bool HasUninterruptableMethods_ = false;

  using Base_ = GeicBrowserHostInterfaceBase;
  using Proxy_ = GeicBrowserHostProxy;

  template <typename ImplRefTraits>
  using Stub_ = GeicBrowserHostStub<ImplRefTraits>;

  using RequestValidator_ = GeicBrowserHostRequestValidator;
  using ResponseValidator_ = GeicBrowserHostResponseValidator;
  enum MethodMinVersions : uint32_t {
    kRegisterClientMinVersion = 0,
    kGetFocusedTabMinVersion = 0,
    kGetContextFromFocusedTabMinVersion = 0,
    kClosePanelMinVersion = 0,
  };

// crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK
// with not having this data in traces there.
#if !BUILDFLAG(IS_FUCHSIA)
  struct RegisterClient_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct GetFocusedTab_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct GetContextFromFocusedTab_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct ClosePanel_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~GeicBrowserHost() = default;

  using RegisterClientCallback = base::OnceCallback<void(GeicInitialStatePtr)>;
  using RegisterClientMojoCallback = base::OnceCallback<void(GeicInitialStatePtr)>;

  virtual void RegisterClient(::mojo::PendingRemote<GeicClient> client, RegisterClientCallback callback) = 0;

  using GetFocusedTabCallback = base::OnceCallback<void(FocusedTabDataPtr)>;
  using GetFocusedTabMojoCallback = base::OnceCallback<void(FocusedTabDataPtr)>;

  virtual void GetFocusedTab(GetFocusedTabCallback callback) = 0;

  using GetContextFromFocusedTabCallback = base::OnceCallback<void(base::expected<
  TabContextDataPtr,
  GetTabContextError>)>;
  using GetContextFromFocusedTabResult = base::expected<
  TabContextDataPtr,
  GetTabContextError>;
  using GetContextFromFocusedTabMojoCallback = base::OnceCallback<void(GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr)>;

  virtual void GetContextFromFocusedTab(TabContextOptionsPtr options, GetContextFromFocusedTabCallback callback) = 0;

  virtual void ClosePanel() = 0;
};

class GeicClientProxy;

template <typename ImplRefTraits>
class GeicClientStub;

class GeicClientRequestValidator;


class GeicClient
    : public GeicClientInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "geic.mojom.GeicClient";
  static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message);
  static const char* MessageToMethodName_(mojo::Message& message);
  static constexpr uint32_t Version_ = 0;
  static constexpr bool PassesAssociatedKinds_ = false;
  static constexpr bool HasUninterruptableMethods_ = false;

  using Base_ = GeicClientInterfaceBase;
  using Proxy_ = GeicClientProxy;

  template <typename ImplRefTraits>
  using Stub_ = GeicClientStub<ImplRefTraits>;

  using RequestValidator_ = GeicClientRequestValidator;
  using ResponseValidator_ = mojo::PassThroughFilter;
  enum MethodMinVersions : uint32_t {
    kOnFocusedTabChangedMinVersion = 0,
  };

// crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK
// with not having this data in traces there.
#if !BUILDFLAG(IS_FUCHSIA)
  struct OnFocusedTabChanged_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~GeicClient() = default;

  virtual void OnFocusedTabChanged(FocusedTabDataPtr data) = 0;
};



class  GeicApiProxy
    : public GeicApi {
 public:
  using InterfaceType = GeicApi;

  explicit GeicApiProxy(mojo::MessageReceiverWithResponder* receiver);

 private:
  mojo::MessageReceiverWithResponder* receiver_;
};



class  GeicBrowserHostProxy
    : public GeicBrowserHost {
 public:
  using InterfaceType = GeicBrowserHost;

  explicit GeicBrowserHostProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void RegisterClient(::mojo::PendingRemote<GeicClient> client, RegisterClientCallback callback) final;
  
  void GetFocusedTab(GetFocusedTabCallback callback) final;
  
  void GetContextFromFocusedTab(TabContextOptionsPtr options, GetContextFromFocusedTabCallback callback) final;
  
  void ClosePanel() final;

 private:
  mojo::MessageReceiverWithResponder* receiver_;
};



class  GeicClientProxy
    : public GeicClient {
 public:
  using InterfaceType = GeicClient;

  explicit GeicClientProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void OnFocusedTabChanged(FocusedTabDataPtr data) final;

 private:
  mojo::MessageReceiverWithResponder* receiver_;
};
class  GeicApiStubDispatch {
 public:
  static bool Accept(GeicApi* impl, mojo::Message* message);
  static bool AcceptWithResponder(
      GeicApi* impl,
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};

template <typename ImplRefTraits =
              mojo::RawPtrImplRefTraits<GeicApi>>
class GeicApiStub
    : public mojo::MessageReceiverWithResponderStatus {
 public:
  using ImplPointerType = typename ImplRefTraits::PointerType;

  GeicApiStub() = default;
  ~GeicApiStub() override = default;

  void set_sink(ImplPointerType sink) { sink_ = std::move(sink); }
  ImplPointerType& sink() { return sink_; }

  bool Accept(mojo::Message* message) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return GeicApiStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

  bool AcceptWithResponder(
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return GeicApiStubDispatch::AcceptWithResponder(
        ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
  }

 private:
  ImplPointerType sink_;
};
class  GeicBrowserHostStubDispatch {
 public:
  static bool Accept(GeicBrowserHost* impl, mojo::Message* message);
  static bool AcceptWithResponder(
      GeicBrowserHost* impl,
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};

template <typename ImplRefTraits =
              mojo::RawPtrImplRefTraits<GeicBrowserHost>>
class GeicBrowserHostStub
    : public mojo::MessageReceiverWithResponderStatus {
 public:
  using ImplPointerType = typename ImplRefTraits::PointerType;

  GeicBrowserHostStub() = default;
  ~GeicBrowserHostStub() override = default;

  void set_sink(ImplPointerType sink) { sink_ = std::move(sink); }
  ImplPointerType& sink() { return sink_; }

  bool Accept(mojo::Message* message) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return GeicBrowserHostStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

  bool AcceptWithResponder(
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return GeicBrowserHostStubDispatch::AcceptWithResponder(
        ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
  }

 private:
  ImplPointerType sink_;
};
class  GeicClientStubDispatch {
 public:
  static bool Accept(GeicClient* impl, mojo::Message* message);
  static bool AcceptWithResponder(
      GeicClient* impl,
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};

template <typename ImplRefTraits =
              mojo::RawPtrImplRefTraits<GeicClient>>
class GeicClientStub
    : public mojo::MessageReceiverWithResponderStatus {
 public:
  using ImplPointerType = typename ImplRefTraits::PointerType;

  GeicClientStub() = default;
  ~GeicClientStub() override = default;

  void set_sink(ImplPointerType sink) { sink_ = std::move(sink); }
  ImplPointerType& sink() { return sink_; }

  bool Accept(mojo::Message* message) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return GeicClientStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

  bool AcceptWithResponder(
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return GeicClientStubDispatch::AcceptWithResponder(
        ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
  }

 private:
  ImplPointerType sink_;
};
class  GeicApiRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class  GeicBrowserHostRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class  GeicClientRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class  GeicBrowserHostResponseValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};






class  NoFocusedTabData {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<NoFocusedTabData, T>::value>;
  using DataView = NoFocusedTabDataDataView;
  using Data_ = internal::NoFocusedTabData_Data;

  template <typename... Args>
  static NoFocusedTabDataPtr New(Args&&... args) {
    return NoFocusedTabDataPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static NoFocusedTabDataPtr From(const U& u) {
    return mojo::TypeConverter<NoFocusedTabDataPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, NoFocusedTabData>::Convert(*this);
  }


  NoFocusedTabData();

  explicit NoFocusedTabData(
      const std::string& no_focus_reason);


  ~NoFocusedTabData();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = NoFocusedTabDataPtr>
  NoFocusedTabDataPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, NoFocusedTabData::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, NoFocusedTabData::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, NoFocusedTabData::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }
  size_t Hash(size_t seed) const;

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        NoFocusedTabData::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        NoFocusedTabData::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        NoFocusedTabData::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::NoFocusedTabData_UnserializedMessageContext<
            UserType, NoFocusedTabData::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<NoFocusedTabData::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return NoFocusedTabData::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::NoFocusedTabData_UnserializedMessageContext<
            UserType, NoFocusedTabData::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<NoFocusedTabData::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string no_focus_reason;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, NoFocusedTabData::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, NoFocusedTabData::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, NoFocusedTabData::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, NoFocusedTabData::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}








class  FocusedTabData {
 public:
  using DataView = FocusedTabDataDataView;
  using Data_ = internal::FocusedTabData_Data;
  using Tag = Data_::FocusedTabData_Tag;

  template <typename... Args>
  static FocusedTabDataPtr New(Args&&... args) {
    static_assert(
        sizeof...(args) < 0,
        "Do not use Union::New(); to create a union of a given subtype, use "
        "New<SubType>(), not New() followed by set_<sub_type>(). To represent "
        "an empty union, mark the field or parameter as nullable in the mojom "
        "definition.");
    return nullptr;
  }

  // Construct an instance holding |focused_tab|.
  static FocusedTabDataPtr NewFocusedTab(
      TabMetadataPtr value);
  // Construct an instance holding |no_focused_tab_data|.
  static FocusedTabDataPtr NewNoFocusedTabData(
      NoFocusedTabDataPtr value);

  template <typename U>
  static FocusedTabDataPtr From(const U& u) {
    return mojo::TypeConverter<FocusedTabDataPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, FocusedTabData>::Convert(*this);
  }
  ~FocusedTabData();

  // Delete the copy constructor and copy assignment operators because `data_`
  // contains raw pointers that must not be copied.
  FocusedTabData(const FocusedTabData& other) = delete;
  FocusedTabData& operator=(const FocusedTabData& other) = delete;

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename UnionPtrType = FocusedTabDataPtr>
  FocusedTabDataPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T,
            typename std::enable_if<std::is_same<
                T, FocusedTabData>::value>::type* = nullptr>
  bool Equals(const T& other) const;

  template <typename T,
            typename std::enable_if<std::is_same<
                T, FocusedTabData>::value>::type* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  Tag which() const {
    return tag_;
  }

  bool is_focused_tab() const { return tag_ == Tag::kFocusedTab; }
  const TabMetadataPtr& get_focused_tab() const {
    CHECK(tag_ == Tag::kFocusedTab);
    return data_.focused_tab;
  }
  TabMetadataPtr& get_focused_tab() {
    CHECK(tag_ == Tag::kFocusedTab);
    return data_.focused_tab;
  }
  void set_focused_tab(TabMetadataPtr focused_tab);

  bool is_no_focused_tab_data() const { return tag_ == Tag::kNoFocusedTabData; }
  const NoFocusedTabDataPtr& get_no_focused_tab_data() const {
    CHECK(tag_ == Tag::kNoFocusedTabData);
    return data_.no_focused_tab_data;
  }
  NoFocusedTabDataPtr& get_no_focused_tab_data() {
    CHECK(tag_ == Tag::kNoFocusedTabData);
    return data_.no_focused_tab_data;
  }
  void set_no_focused_tab_data(NoFocusedTabDataPtr no_focused_tab_data);

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        FocusedTabData::DataView>(input);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    return mojo::internal::DeserializeImpl<FocusedTabData::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

 private:
  template <typename T>
  friend class ::mojo::InlinedStructPtr;
  template <typename T>
  friend class ::mojo::StructPtr;

  union Union_ {
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kFocusedTab)>,
        TabMetadataPtr value);
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kNoFocusedTabData)>,
        NoFocusedTabDataPtr value);
    // The contents of the union are explicitly destroyed by `DestroyActive()`.
    ~Union_() {}

    TabMetadataPtr focused_tab;
    NoFocusedTabDataPtr no_focused_tab_data;
  };

  FocusedTabData(
      std::in_place_index_t<static_cast<size_t>(Tag::kFocusedTab)>,
      TabMetadataPtr value);
  FocusedTabData(
      std::in_place_index_t<static_cast<size_t>(Tag::kNoFocusedTabData)>,
      NoFocusedTabDataPtr value);

  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  void DestroyActive();
  Tag tag_;
  Union_ data_;
};



class  GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result {
 public:
  using DataView = GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultDataView;
  using Data_ = internal::GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result_Data;
  using Tag = Data_::GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result_Tag;

  template <typename... Args>
  static GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr New(Args&&... args) {
    static_assert(
        sizeof...(args) < 0,
        "Do not use Union::New(); to create a union of a given subtype, use "
        "New<SubType>(), not New() followed by set_<sub_type>(). To represent "
        "an empty union, mark the field or parameter as nullable in the mojom "
        "definition.");
    return nullptr;
  }

  // Construct an instance holding |success|.
  static GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr NewSuccess(
      TabContextDataPtr value);
  // Construct an instance holding |failure|.
  static GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr NewFailure(
      GetTabContextError value);

  template <typename U>
  static GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr From(const U& u) {
    return mojo::TypeConverter<GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result>::Convert(*this);
  }
  ~GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result();

  // Delete the copy constructor and copy assignment operators because `data_`
  // contains raw pointers that must not be copied.
  GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result(const GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result& other) = delete;
  GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result& operator=(const GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result& other) = delete;

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename UnionPtrType = GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr>
  GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T,
            typename std::enable_if<std::is_same<
                T, GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result>::value>::type* = nullptr>
  bool Equals(const T& other) const;

  template <typename T,
            typename std::enable_if<std::is_same<
                T, GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result>::value>::type* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  Tag which() const {
    return tag_;
  }

  bool is_success() const { return tag_ == Tag::kSuccess; }
  const TabContextDataPtr& get_success() const {
    CHECK(tag_ == Tag::kSuccess);
    return data_.success;
  }
  TabContextDataPtr& get_success() {
    CHECK(tag_ == Tag::kSuccess);
    return data_.success;
  }
  void set_success(TabContextDataPtr success);

  bool is_failure() const { return tag_ == Tag::kFailure; }
  GetTabContextError get_failure() const {
    CHECK(tag_ == Tag::kFailure);
    return data_.failure;
  }
  void set_failure(GetTabContextError failure);

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result::DataView>(input);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    return mojo::internal::DeserializeImpl<GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

 private:
  template <typename T>
  friend class ::mojo::InlinedStructPtr;
  template <typename T>
  friend class ::mojo::StructPtr;

  union Union_ {
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kSuccess)>,
        TabContextDataPtr value);
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
        GetTabContextError value);
    // The contents of the union are explicitly destroyed by `DestroyActive()`.
    ~Union_() {}

    TabContextDataPtr success;
    GetTabContextError failure;
  };

  GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result(
      std::in_place_index_t<static_cast<size_t>(Tag::kSuccess)>,
      TabContextDataPtr value);
  GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result(
      std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
      GetTabContextError value);

  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  void DestroyActive();
  Tag tag_;
  Union_ data_;
};





class  TabMetadata {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<TabMetadata, T>::value>;
  using DataView = TabMetadataDataView;
  using Data_ = internal::TabMetadata_Data;

  template <typename... Args>
  static TabMetadataPtr New(Args&&... args) {
    return TabMetadataPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static TabMetadataPtr From(const U& u) {
    return mojo::TypeConverter<TabMetadataPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, TabMetadata>::Convert(*this);
  }


  TabMetadata();

  TabMetadata(
      int32_t tab_id,
      int32_t window_id,
      const ::GURL& url,
      const ::std::u16string& title,
      std::optional<std::vector<uint8_t>> favicon,
      bool is_active_in_window);


  ~TabMetadata();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = TabMetadataPtr>
  TabMetadataPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, TabMetadata::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, TabMetadata::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, TabMetadata::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        TabMetadata::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        TabMetadata::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        TabMetadata::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::TabMetadata_UnserializedMessageContext<
            UserType, TabMetadata::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<TabMetadata::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return TabMetadata::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::TabMetadata_UnserializedMessageContext<
            UserType, TabMetadata::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<TabMetadata::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  int32_t tab_id;
  
  int32_t window_id;
  
  ::GURL url;
  
  ::std::u16string title;
  
  std::optional<std::vector<uint8_t>> favicon;
  
  bool is_active_in_window;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, TabMetadata::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, TabMetadata::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, TabMetadata::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, TabMetadata::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}






class  GeicInitialState {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<GeicInitialState, T>::value>;
  using DataView = GeicInitialStateDataView;
  using Data_ = internal::GeicInitialState_Data;

  template <typename... Args>
  static GeicInitialStatePtr New(Args&&... args) {
    return GeicInitialStatePtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static GeicInitialStatePtr From(const U& u) {
    return mojo::TypeConverter<GeicInitialStatePtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, GeicInitialState>::Convert(*this);
  }


  GeicInitialState();

  explicit GeicInitialState(
      FocusedTabDataPtr focused_tab_data);

GeicInitialState(const GeicInitialState&) = delete;
GeicInitialState& operator=(const GeicInitialState&) = delete;

  ~GeicInitialState();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = GeicInitialStatePtr>
  GeicInitialStatePtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, GeicInitialState::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, GeicInitialState::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, GeicInitialState::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        GeicInitialState::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        GeicInitialState::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        GeicInitialState::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::GeicInitialState_UnserializedMessageContext<
            UserType, GeicInitialState::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<GeicInitialState::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return GeicInitialState::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::GeicInitialState_UnserializedMessageContext<
            UserType, GeicInitialState::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<GeicInitialState::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  FocusedTabDataPtr focused_tab_data;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, GeicInitialState::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, GeicInitialState::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, GeicInitialState::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, GeicInitialState::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class  TabContextOptions {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<TabContextOptions, T>::value>;
  using DataView = TabContextOptionsDataView;
  using Data_ = internal::TabContextOptions_Data;

  template <typename... Args>
  static TabContextOptionsPtr New(Args&&... args) {
    return TabContextOptionsPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static TabContextOptionsPtr From(const U& u) {
    return mojo::TypeConverter<TabContextOptionsPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, TabContextOptions>::Convert(*this);
  }


  TabContextOptions();

  TabContextOptions(
      bool include_inner_text,
      uint32_t inner_text_bytes_limit,
      bool include_screenshot,
      uint32_t screenshot_max_width,
      uint32_t screenshot_max_height);


  ~TabContextOptions();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = TabContextOptionsPtr>
  TabContextOptionsPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, TabContextOptions::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, TabContextOptions::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, TabContextOptions::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }
  size_t Hash(size_t seed) const;

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        TabContextOptions::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        TabContextOptions::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        TabContextOptions::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::TabContextOptions_UnserializedMessageContext<
            UserType, TabContextOptions::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<TabContextOptions::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return TabContextOptions::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::TabContextOptions_UnserializedMessageContext<
            UserType, TabContextOptions::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<TabContextOptions::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  bool include_inner_text;
  
  uint32_t inner_text_bytes_limit;
  
  bool include_screenshot;
  
  uint32_t screenshot_max_width;
  
  uint32_t screenshot_max_height;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, TabContextOptions::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, TabContextOptions::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, TabContextOptions::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, TabContextOptions::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class  TabContextData {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<TabContextData, T>::value>;
  using DataView = TabContextDataDataView;
  using Data_ = internal::TabContextData_Data;

  template <typename... Args>
  static TabContextDataPtr New(Args&&... args) {
    return TabContextDataPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static TabContextDataPtr From(const U& u) {
    return mojo::TypeConverter<TabContextDataPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, TabContextData>::Convert(*this);
  }


  TabContextData();

  TabContextData(
      TabMetadataPtr metadata,
      const std::optional<std::string>& inner_text,
      std::optional<std::vector<uint8_t>> screenshot_data,
      const std::optional<std::string>& screenshot_mime_type);

TabContextData(const TabContextData&) = delete;
TabContextData& operator=(const TabContextData&) = delete;

  ~TabContextData();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = TabContextDataPtr>
  TabContextDataPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, TabContextData::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, TabContextData::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, TabContextData::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        TabContextData::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        TabContextData::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        TabContextData::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::TabContextData_UnserializedMessageContext<
            UserType, TabContextData::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<TabContextData::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return TabContextData::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::TabContextData_UnserializedMessageContext<
            UserType, TabContextData::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<TabContextData::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  TabMetadataPtr metadata;
  
  std::optional<std::string> inner_text;
  
  std::optional<std::vector<uint8_t>> screenshot_data;
  
  std::optional<std::string> screenshot_mime_type;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, TabContextData::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, TabContextData::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, TabContextData::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, TabContextData::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}

template <typename UnionPtrType>
FocusedTabDataPtr FocusedTabData::Clone() const {
  switch (tag_) {
    case Tag::kFocusedTab:
      return NewFocusedTab(
          mojo::Clone(data_.focused_tab));
    case Tag::kNoFocusedTabData:
      return NewNoFocusedTabData(
          mojo::Clone(data_.no_focused_tab_data));
  }
  return nullptr;
}

template <typename T,
          typename std::enable_if<std::is_same<
              T, FocusedTabData>::value>::type*>
bool FocusedTabData::Equals(const T& other) const {
  if (tag_ != other.which())
    return false;

  switch (tag_) {
    case Tag::kFocusedTab:
      return mojo::Equals(data_.focused_tab, other.data_.focused_tab);
    case Tag::kNoFocusedTabData:
      return mojo::Equals(data_.no_focused_tab_data, other.data_.no_focused_tab_data);
  }

  return false;
}
template <typename UnionPtrType>
GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result::Clone() const {
  switch (tag_) {
    case Tag::kSuccess:
      return NewSuccess(
          mojo::Clone(data_.success));
    case Tag::kFailure:
      return NewFailure(
          mojo::Clone(data_.failure));
  }
  return nullptr;
}

template <typename T,
          typename std::enable_if<std::is_same<
              T, GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result>::value>::type*>
bool GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result::Equals(const T& other) const {
  if (tag_ != other.which())
    return false;

  switch (tag_) {
    case Tag::kSuccess:
      return mojo::Equals(data_.success, other.data_.success);
    case Tag::kFailure:
      return mojo::Equals(data_.failure, other.data_.failure);
  }

  return false;
}
template <typename StructPtrType>
TabMetadataPtr TabMetadata::Clone() const {
  return New(
      mojo::Clone(tab_id),
      mojo::Clone(window_id),
      mojo::Clone(url),
      mojo::Clone(title),
      mojo::Clone(favicon),
      mojo::Clone(is_active_in_window)
  );
}

template <typename T, TabMetadata::EnableIfSame<T>*>
bool TabMetadata::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->tab_id, other_struct.tab_id))
    return false;
  if (!mojo::Equals(this->window_id, other_struct.window_id))
    return false;
  if (!mojo::Equals(this->url, other_struct.url))
    return false;
  if (!mojo::Equals(this->title, other_struct.title))
    return false;
  if (!mojo::Equals(this->favicon, other_struct.favicon))
    return false;
  if (!mojo::Equals(this->is_active_in_window, other_struct.is_active_in_window))
    return false;
  return true;
}

template <typename T, TabMetadata::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.tab_id < rhs.tab_id)
    return true;
  if (rhs.tab_id < lhs.tab_id)
    return false;
  if (lhs.window_id < rhs.window_id)
    return true;
  if (rhs.window_id < lhs.window_id)
    return false;
  if (lhs.url < rhs.url)
    return true;
  if (rhs.url < lhs.url)
    return false;
  if (lhs.title < rhs.title)
    return true;
  if (rhs.title < lhs.title)
    return false;
  if (lhs.favicon < rhs.favicon)
    return true;
  if (rhs.favicon < lhs.favicon)
    return false;
  if (lhs.is_active_in_window < rhs.is_active_in_window)
    return true;
  if (rhs.is_active_in_window < lhs.is_active_in_window)
    return false;
  return false;
}
template <typename StructPtrType>
NoFocusedTabDataPtr NoFocusedTabData::Clone() const {
  return New(
      mojo::Clone(no_focus_reason)
  );
}

template <typename T, NoFocusedTabData::EnableIfSame<T>*>
bool NoFocusedTabData::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->no_focus_reason, other_struct.no_focus_reason))
    return false;
  return true;
}

template <typename T, NoFocusedTabData::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.no_focus_reason < rhs.no_focus_reason)
    return true;
  if (rhs.no_focus_reason < lhs.no_focus_reason)
    return false;
  return false;
}
template <typename StructPtrType>
GeicInitialStatePtr GeicInitialState::Clone() const {
  return New(
      mojo::Clone(focused_tab_data)
  );
}

template <typename T, GeicInitialState::EnableIfSame<T>*>
bool GeicInitialState::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->focused_tab_data, other_struct.focused_tab_data))
    return false;
  return true;
}

template <typename T, GeicInitialState::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.focused_tab_data < rhs.focused_tab_data)
    return true;
  if (rhs.focused_tab_data < lhs.focused_tab_data)
    return false;
  return false;
}
template <typename StructPtrType>
TabContextOptionsPtr TabContextOptions::Clone() const {
  return New(
      mojo::Clone(include_inner_text),
      mojo::Clone(inner_text_bytes_limit),
      mojo::Clone(include_screenshot),
      mojo::Clone(screenshot_max_width),
      mojo::Clone(screenshot_max_height)
  );
}

template <typename T, TabContextOptions::EnableIfSame<T>*>
bool TabContextOptions::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->include_inner_text, other_struct.include_inner_text))
    return false;
  if (!mojo::Equals(this->inner_text_bytes_limit, other_struct.inner_text_bytes_limit))
    return false;
  if (!mojo::Equals(this->include_screenshot, other_struct.include_screenshot))
    return false;
  if (!mojo::Equals(this->screenshot_max_width, other_struct.screenshot_max_width))
    return false;
  if (!mojo::Equals(this->screenshot_max_height, other_struct.screenshot_max_height))
    return false;
  return true;
}

template <typename T, TabContextOptions::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.include_inner_text < rhs.include_inner_text)
    return true;
  if (rhs.include_inner_text < lhs.include_inner_text)
    return false;
  if (lhs.inner_text_bytes_limit < rhs.inner_text_bytes_limit)
    return true;
  if (rhs.inner_text_bytes_limit < lhs.inner_text_bytes_limit)
    return false;
  if (lhs.include_screenshot < rhs.include_screenshot)
    return true;
  if (rhs.include_screenshot < lhs.include_screenshot)
    return false;
  if (lhs.screenshot_max_width < rhs.screenshot_max_width)
    return true;
  if (rhs.screenshot_max_width < lhs.screenshot_max_width)
    return false;
  if (lhs.screenshot_max_height < rhs.screenshot_max_height)
    return true;
  if (rhs.screenshot_max_height < lhs.screenshot_max_height)
    return false;
  return false;
}
template <typename StructPtrType>
TabContextDataPtr TabContextData::Clone() const {
  return New(
      mojo::Clone(metadata),
      mojo::Clone(inner_text),
      mojo::Clone(screenshot_data),
      mojo::Clone(screenshot_mime_type)
  );
}

template <typename T, TabContextData::EnableIfSame<T>*>
bool TabContextData::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->metadata, other_struct.metadata))
    return false;
  if (!mojo::Equals(this->inner_text, other_struct.inner_text))
    return false;
  if (!mojo::Equals(this->screenshot_data, other_struct.screenshot_data))
    return false;
  if (!mojo::Equals(this->screenshot_mime_type, other_struct.screenshot_mime_type))
    return false;
  return true;
}

template <typename T, TabContextData::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.metadata < rhs.metadata)
    return true;
  if (rhs.metadata < lhs.metadata)
    return false;
  if (lhs.inner_text < rhs.inner_text)
    return true;
  if (rhs.inner_text < lhs.inner_text)
    return false;
  if (lhs.screenshot_data < rhs.screenshot_data)
    return true;
  if (rhs.screenshot_data < lhs.screenshot_data)
    return false;
  if (lhs.screenshot_mime_type < rhs.screenshot_mime_type)
    return true;
  if (rhs.screenshot_mime_type < lhs.screenshot_mime_type)
    return false;
  return false;
}


}  // geic::mojom

namespace mojo {


template <>
struct  StructTraits<::geic::mojom::TabMetadata::DataView,
                                         ::geic::mojom::TabMetadataPtr> {
  static bool IsNull(const ::geic::mojom::TabMetadataPtr& input) { return !input; }
  static void SetToNull(::geic::mojom::TabMetadataPtr* output) { output->reset(); }

  static decltype(::geic::mojom::TabMetadata::tab_id) tab_id(
      const ::geic::mojom::TabMetadataPtr& input) {
    return input->tab_id;
  }

  static decltype(::geic::mojom::TabMetadata::window_id) window_id(
      const ::geic::mojom::TabMetadataPtr& input) {
    return input->window_id;
  }

  static const decltype(::geic::mojom::TabMetadata::url)& url(
      const ::geic::mojom::TabMetadataPtr& input) {
    return input->url;
  }

  static const decltype(::geic::mojom::TabMetadata::title)& title(
      const ::geic::mojom::TabMetadataPtr& input) {
    return input->title;
  }

  static const decltype(::geic::mojom::TabMetadata::favicon)& favicon(
      const ::geic::mojom::TabMetadataPtr& input) {
    return input->favicon;
  }

  static decltype(::geic::mojom::TabMetadata::is_active_in_window) is_active_in_window(
      const ::geic::mojom::TabMetadataPtr& input) {
    return input->is_active_in_window;
  }

  static bool Read(::geic::mojom::TabMetadata::DataView input, ::geic::mojom::TabMetadataPtr* output);
};


template <>
struct  StructTraits<::geic::mojom::NoFocusedTabData::DataView,
                                         ::geic::mojom::NoFocusedTabDataPtr> {
  static bool IsNull(const ::geic::mojom::NoFocusedTabDataPtr& input) { return !input; }
  static void SetToNull(::geic::mojom::NoFocusedTabDataPtr* output) { output->reset(); }

  static const decltype(::geic::mojom::NoFocusedTabData::no_focus_reason)& no_focus_reason(
      const ::geic::mojom::NoFocusedTabDataPtr& input) {
    return input->no_focus_reason;
  }

  static bool Read(::geic::mojom::NoFocusedTabData::DataView input, ::geic::mojom::NoFocusedTabDataPtr* output);
};


template <>
struct  StructTraits<::geic::mojom::GeicInitialState::DataView,
                                         ::geic::mojom::GeicInitialStatePtr> {
  static bool IsNull(const ::geic::mojom::GeicInitialStatePtr& input) { return !input; }
  static void SetToNull(::geic::mojom::GeicInitialStatePtr* output) { output->reset(); }

  static const decltype(::geic::mojom::GeicInitialState::focused_tab_data)& focused_tab_data(
      const ::geic::mojom::GeicInitialStatePtr& input) {
    return input->focused_tab_data;
  }

  static bool Read(::geic::mojom::GeicInitialState::DataView input, ::geic::mojom::GeicInitialStatePtr* output);
};


template <>
struct  StructTraits<::geic::mojom::TabContextOptions::DataView,
                                         ::geic::mojom::TabContextOptionsPtr> {
  static bool IsNull(const ::geic::mojom::TabContextOptionsPtr& input) { return !input; }
  static void SetToNull(::geic::mojom::TabContextOptionsPtr* output) { output->reset(); }

  static decltype(::geic::mojom::TabContextOptions::include_inner_text) include_inner_text(
      const ::geic::mojom::TabContextOptionsPtr& input) {
    return input->include_inner_text;
  }

  static decltype(::geic::mojom::TabContextOptions::inner_text_bytes_limit) inner_text_bytes_limit(
      const ::geic::mojom::TabContextOptionsPtr& input) {
    return input->inner_text_bytes_limit;
  }

  static decltype(::geic::mojom::TabContextOptions::include_screenshot) include_screenshot(
      const ::geic::mojom::TabContextOptionsPtr& input) {
    return input->include_screenshot;
  }

  static decltype(::geic::mojom::TabContextOptions::screenshot_max_width) screenshot_max_width(
      const ::geic::mojom::TabContextOptionsPtr& input) {
    return input->screenshot_max_width;
  }

  static decltype(::geic::mojom::TabContextOptions::screenshot_max_height) screenshot_max_height(
      const ::geic::mojom::TabContextOptionsPtr& input) {
    return input->screenshot_max_height;
  }

  static bool Read(::geic::mojom::TabContextOptions::DataView input, ::geic::mojom::TabContextOptionsPtr* output);
};


template <>
struct  StructTraits<::geic::mojom::TabContextData::DataView,
                                         ::geic::mojom::TabContextDataPtr> {
  static bool IsNull(const ::geic::mojom::TabContextDataPtr& input) { return !input; }
  static void SetToNull(::geic::mojom::TabContextDataPtr* output) { output->reset(); }

  static const decltype(::geic::mojom::TabContextData::metadata)& metadata(
      const ::geic::mojom::TabContextDataPtr& input) {
    return input->metadata;
  }

  static const decltype(::geic::mojom::TabContextData::inner_text)& inner_text(
      const ::geic::mojom::TabContextDataPtr& input) {
    return input->inner_text;
  }

  static const decltype(::geic::mojom::TabContextData::screenshot_data)& screenshot_data(
      const ::geic::mojom::TabContextDataPtr& input) {
    return input->screenshot_data;
  }

  static const decltype(::geic::mojom::TabContextData::screenshot_mime_type)& screenshot_mime_type(
      const ::geic::mojom::TabContextDataPtr& input) {
    return input->screenshot_mime_type;
  }

  static bool Read(::geic::mojom::TabContextData::DataView input, ::geic::mojom::TabContextDataPtr* output);
};


template <>
struct  UnionTraits<::geic::mojom::FocusedTabData::DataView,
                                        ::geic::mojom::FocusedTabDataPtr> {
  static bool IsNull(const ::geic::mojom::FocusedTabDataPtr& input) { return !input; }
  static void SetToNull(::geic::mojom::FocusedTabDataPtr* output) { output->reset(); }

  static ::geic::mojom::FocusedTabData::Tag GetTag(const ::geic::mojom::FocusedTabDataPtr& input) {
    return input->which();
  }

  static const ::geic::mojom::TabMetadataPtr& focused_tab(const ::geic::mojom::FocusedTabDataPtr& input) {
    return input->get_focused_tab();
  }

  static const ::geic::mojom::NoFocusedTabDataPtr& no_focused_tab_data(const ::geic::mojom::FocusedTabDataPtr& input) {
    return input->get_no_focused_tab_data();
  }

  static bool Read(::geic::mojom::FocusedTabData::DataView input, ::geic::mojom::FocusedTabDataPtr* output);
};


template <>
struct  UnionTraits<::geic::mojom::GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result::DataView,
                                        ::geic::mojom::GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr> {
  static bool IsNull(const ::geic::mojom::GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr& input) { return !input; }
  static void SetToNull(::geic::mojom::GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr* output) { output->reset(); }

  static ::geic::mojom::GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result::Tag GetTag(const ::geic::mojom::GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr& input) {
    return input->which();
  }

  static const ::geic::mojom::TabContextDataPtr& success(const ::geic::mojom::GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr& input) {
    return input->get_success();
  }

  static  ::geic::mojom::GetTabContextError failure(const ::geic::mojom::GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr& input) {
    return input->get_failure();
  }

  static bool Read(::geic::mojom::GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_Result::DataView input, ::geic::mojom::GeicBrowserHost_GetContextFromFocusedTab_ResponseParam_ResultPtr* output);
};
namespace internal {
template <>
inline bool GetRuntimeFeature_IsEnabled<::geic::mojom::GeicApi>() {
  return ::geic::mojom::GeicApi::RuntimeFeature_IsEnabled_(false);
}
template <>
inline bool GetRuntimeFeature_ExpectEnabled<::geic::mojom::GeicApi>() {
  return ::geic::mojom::GeicApi::RuntimeFeature_IsEnabled_(true);
}template <>
inline constexpr bool kIsRuntimeFeatureGuarded<::geic::mojom::GeicApi> = true;
}  // namespace internal

}  // namespace mojo

#endif  // CHROME_BROWSER_GEIC_GEIC_MOJOM_H_