// third_party/blink/public/mojom/navigation/navigation_policy.mojom-data-view.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.

// This file defines XDataView for type traits and can be included in
// _mojom_traits.h definitions but otherwise please use .mojom-forward.h,
// .mojom-shared.h or .mojom.h.

// IWYU pragma: private
// IWYU pragma: friend "traits"

#ifndef THIRD_PARTY_BLINK_PUBLIC_MOJOM_NAVIGATION_NAVIGATION_POLICY_MOJOM_DATA_VIEW_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_NAVIGATION_NAVIGATION_POLICY_MOJOM_DATA_VIEW_H_

#include <stdint.h>

#include <functional>
#include <iosfwd>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"

#include "third_party/blink/public/mojom/navigation/navigation_policy.mojom-shared-internal.h"


namespace blink::mojom {
class NavigationDownloadTypesDataView;

class NavigationDownloadPolicyDataView;



}  // blink::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::blink::mojom::NavigationDownloadTypesDataView> {
  using Data = ::blink::mojom::internal::NavigationDownloadTypes_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::blink::mojom::NavigationDownloadPolicyDataView> {
  using Data = ::blink::mojom::internal::NavigationDownloadPolicy_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace blink::mojom {


class NavigationDownloadTypesDataView {
 public:
  NavigationDownloadTypesDataView() = default;

  NavigationDownloadTypesDataView(
      internal::NavigationDownloadTypes_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  bool view_source() const {
    return data_->view_source;
  }
  bool interstitial() const {
    return data_->interstitial;
  }
  bool opener_cross_origin() const {
    return data_->opener_cross_origin;
  }
  bool ad_frame_no_gesture() const {
    return data_->ad_frame_no_gesture;
  }
  bool ad_frame() const {
    return data_->ad_frame;
  }
  bool sandbox() const {
    return data_->sandbox;
  }
  bool no_gesture() const {
    return data_->no_gesture;
  }
  bool ad_script() const {
    return data_->ad_script;
  }
 private:
  internal::NavigationDownloadTypes_Data* data_ = nullptr;
};


class NavigationDownloadPolicyDataView {
 public:
  NavigationDownloadPolicyDataView() = default;

  NavigationDownloadPolicyDataView(
      internal::NavigationDownloadPolicy_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetObservedTypesDataView(
      NavigationDownloadTypesDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadObservedTypes(UserType* output) {
    
    auto* pointer = data_->observed_types.Get();
    return mojo::internal::Deserialize<::blink::mojom::NavigationDownloadTypesDataView>(
        pointer, output, message_);
  }
  inline void GetDisallowedTypesDataView(
      NavigationDownloadTypesDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadDisallowedTypes(UserType* output) {
    
    auto* pointer = data_->disallowed_types.Get();
    return mojo::internal::Deserialize<::blink::mojom::NavigationDownloadTypesDataView>(
        pointer, output, message_);
  }
 private:
  internal::NavigationDownloadPolicy_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


}  // blink::mojom

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_NAVIGATION_NAVIGATION_POLICY_MOJOM_DATA_VIEW_H_