// third_party/blink/public/mojom/frame/fullscreen.mojom.cc 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.

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif

#include "third_party/blink/public/mojom/frame/fullscreen.mojom.h"
#include <stdint.h>
#include <utility>
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"

#include "third_party/blink/public/mojom/frame/fullscreen.mojom-params-data.h"
#include "third_party/blink/public/mojom/frame/fullscreen.mojom-shared-message-ids.h"

#include "third_party/blink/public/mojom/frame/fullscreen.mojom-import-headers.h"
#include "third_party/blink/public/mojom/frame/fullscreen.mojom-test-utils.h"


namespace blink::mojom {
FullscreenOptions::FullscreenOptions()
    : prefers_navigation_bar(false),
      prefers_status_bar(false),
      display_id(-1),
      is_prefixed(false),
      is_xr_overlay(false) {}

FullscreenOptions::FullscreenOptions(
    bool prefers_navigation_bar_in,
    bool prefers_status_bar_in,
    int64_t display_id_in,
    bool is_prefixed_in,
    bool is_xr_overlay_in)
    : prefers_navigation_bar(std::move(prefers_navigation_bar_in)),
      prefers_status_bar(std::move(prefers_status_bar_in)),
      display_id(std::move(display_id_in)),
      is_prefixed(std::move(is_prefixed_in)),
      is_xr_overlay(std::move(is_xr_overlay_in)) {}

FullscreenOptions::~FullscreenOptions() = default;
size_t FullscreenOptions::Hash(size_t seed) const {
  seed = mojo::internal::Hash(seed, this->prefers_navigation_bar);
  seed = mojo::internal::Hash(seed, this->prefers_status_bar);
  seed = mojo::internal::Hash(seed, this->display_id);
  seed = mojo::internal::Hash(seed, this->is_prefixed);
  seed = mojo::internal::Hash(seed, this->is_xr_overlay);
  return seed;
}

void FullscreenOptions::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "prefers_navigation_bar"), this->prefers_navigation_bar,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "prefers_status_bar"), this->prefers_status_bar,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "display_id"), this->display_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type int64_t>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "is_prefixed"), this->is_prefixed,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "is_xr_overlay"), this->is_xr_overlay,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool FullscreenOptions::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}


}  // blink::mojom


namespace mojo {


// static
bool StructTraits<::blink::mojom::FullscreenOptions::DataView, ::blink::mojom::FullscreenOptionsPtr>::Read(
    ::blink::mojom::FullscreenOptions::DataView input,
    ::blink::mojom::FullscreenOptionsPtr* output) {
  bool success = true;
  ::blink::mojom::FullscreenOptionsPtr result(::blink::mojom::FullscreenOptions::New());
  
      if (success)
        result->prefers_navigation_bar = input.prefers_navigation_bar();
      if (success)
        result->prefers_status_bar = input.prefers_status_bar();
      if (success)
        result->display_id = input.display_id();
      if (success)
        result->is_prefixed = input.is_prefixed();
      if (success)
        result->is_xr_overlay = input.is_xr_overlay();
  *output = std::move(result);
  return success;
}

}  // namespace mojo


// Symbols declared in the -test-utils.h header are defined here instead of a
// separate .cc file to save compile time.


namespace blink::mojom {




}  // blink::mojom


#if defined(__clang__)
#pragma clang diagnostic pop
#endif