// third_party/blink/public/mojom/manifest/manifest_launch_handler.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_MANIFEST_MANIFEST_LAUNCH_HANDLER_MOJOM_DATA_VIEW_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_MANIFEST_MANIFEST_LAUNCH_HANDLER_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/manifest/manifest_launch_handler.mojom-shared-internal.h"


namespace blink::mojom {
class ManifestLaunchHandlerDataView;



}  // blink::mojom


namespace mojo {
namespace internal {

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

}  // namespace internal
}  // namespace mojo


namespace blink::mojom {


enum class ManifestLaunchHandler_ClientMode : int32_t {
  
  kAuto = 0,
  
  kNavigateNew = 1,
  
  kNavigateExisting = 2,
  
  kFocusExisting = 3,
  kMinValue = 0,
  kMaxValue = 3,
};

COMPONENT_EXPORT(MOJOM_SHARED_BLINK_COMMON_EXPORT) std::ostream& operator<<(std::ostream& os, ManifestLaunchHandler_ClientMode value);
inline bool IsKnownEnumValue(ManifestLaunchHandler_ClientMode value) {
  return internal::ManifestLaunchHandler_ClientMode_Data::IsKnownValue(
      static_cast<int32_t>(value));
}

// Returns true if the enum has an infallible conversion from the mojom enum.
consteval bool HasInfallibleConversion(ManifestLaunchHandler_ClientMode) {
  return true;
}


class ManifestLaunchHandlerDataView {
 public:
  ManifestLaunchHandlerDataView() = default;

  ManifestLaunchHandlerDataView(
      internal::ManifestLaunchHandler_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  [[nodiscard]] bool ReadClientMode(UserType* output) const {
    if (!data_->client_mode_$flag) {
      *output = std::nullopt;
      return true;
    }

    return mojo::internal::Deserialize<::blink::mojom::ManifestLaunchHandler_ClientMode>(
        data_->client_mode_$value, &output->emplace());
  }
  std::optional<ManifestLaunchHandler_ClientMode> client_mode() const {
    if (!data_->client_mode_$flag) {
      return std::nullopt;
    }
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::blink::mojom::ManifestLaunchHandler_ClientMode>(data_->client_mode_$value));
  }
 private:
  internal::ManifestLaunchHandler_Data* data_ = nullptr;
};


}  // blink::mojom

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_MANIFEST_MANIFEST_LAUNCH_HANDLER_MOJOM_DATA_VIEW_H_