// third_party/blink/public/mojom/choosers/popup_menu.mojom-send-validation.h is auto generated by mojom_bindings_generator.py, do not edit

// Copyright 2025 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_PUBLIC_MOJOM_CHOOSERS_POPUP_MENU_MOJOM_SEND_VALIDATION_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_CHOOSERS_POPUP_MENU_MOJOM_SEND_VALIDATION_H_

#include "third_party/blink/public/mojom/choosers/popup_menu.mojom-shared-internal.h"
#include "mojo/public/mojom/base/text_direction.mojom-shared.h"

#include "third_party/blink/public/mojom/choosers/popup_menu.mojom-data-view.h"

#include "mojo/public/cpp/bindings/lib/send_validation_type.h"
#include "mojo/public/cpp/bindings/lib/send_validation.h"
#include "mojo/public/cpp/bindings/lib/interface_serialization_send_validation.h"

namespace mojo::internal {

template <typename MaybeConstUserType, mojo::internal::SendValidation send_validation>
struct SendValidationSerializer<::blink::mojom::MenuItemDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::blink::mojom::MenuItemDataView, UserType>;
  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::blink::mojom::internal::MenuItem_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

      decltype(Traits::label(input)) in_label = Traits::label(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->label)::BaseType> label_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_label,
        label_fragment);

      fragment->label.Set(
          label_fragment.is_null() ? nullptr : label_fragment.data());

      decltype(Traits::tool_tip(input)) in_tool_tip = Traits::tool_tip(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->tool_tip)::BaseType> tool_tip_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_tool_tip,
        tool_tip_fragment);

      fragment->tool_tip.Set(
          tool_tip_fragment.is_null() ? nullptr : tool_tip_fragment.data());

      
      mojo::internal::Serialize<::blink::mojom::MenuItem_Type>(
        Traits::type(input),
        &fragment->type);

      fragment->action = Traits::action(input);

      
      mojo::internal::Serialize<::mojo_base::mojom::TextDirection>(
        Traits::text_direction(input),
        &fragment->text_direction);

      fragment->has_text_direction_override = Traits::has_text_direction_override(input);

      fragment->enabled = Traits::enabled(input);

      fragment->checked = Traits::checked(input);
  }
};

}  // namespace mojo::internal

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_CHOOSERS_POPUP_MENU_MOJOM_SEND_VALIDATION_H_