// components/omnibox/browser/searchbox.mojom-shared.cc is auto generated by mojom_bindings_generator.py, do not edit

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

#include "components/omnibox/browser/searchbox.mojom-shared.h"
#include <ostream>
#include <utility>
#include "base/strings/stringprintf.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/lib/validation_util.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"

#include "components/omnibox/browser/searchbox.mojom-params-data.h"
namespace searchbox {
namespace mojom {

NOINLINE static const char* KeywordTypeToStringHelper(KeywordType value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case KeywordType::kChip:
      return "kChip";
    case KeywordType::kInKeyword:
      return "kInKeyword";
    case KeywordType::kInstant:
      return "kInstant";
    default:
      return nullptr;
  }
}

std::string KeywordTypeToString(KeywordType value) {
  const char *str = KeywordTypeToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown KeywordType value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, KeywordType value) {
  return os << KeywordTypeToString(value);
}

NOINLINE static const char* TabAttachmentSourceToStringHelper(TabAttachmentSource value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case TabAttachmentSource::kOther:
      return "kOther";
    case TabAttachmentSource::kContextMenu:
      return "kContextMenu";
    case TabAttachmentSource::kCurrentTabChip:
      return "kCurrentTabChip";
    case TabAttachmentSource::kActionChip:
      return "kActionChip";
    case TabAttachmentSource::kAutoActive:
      return "kAutoActive";
    case TabAttachmentSource::kAutoAdded:
      return "kAutoAdded";
    default:
      return nullptr;
  }
}

std::string TabAttachmentSourceToString(TabAttachmentSource value) {
  const char *str = TabAttachmentSourceToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown TabAttachmentSource value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, TabAttachmentSource value) {
  return os << TabAttachmentSourceToString(value);
}

NOINLINE static const char* SideTypeToStringHelper(SideType value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case SideType::kDefaultPrimary:
      return "kDefaultPrimary";
    case SideType::kSecondary:
      return "kSecondary";
    default:
      return nullptr;
  }
}

std::string SideTypeToString(SideType value) {
  const char *str = SideTypeToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown SideType value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, SideType value) {
  return os << SideTypeToString(value);
}

NOINLINE static const char* RenderTypeToStringHelper(RenderType value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case RenderType::kDefaultVertical:
      return "kDefaultVertical";
    case RenderType::kHorizontal:
      return "kHorizontal";
    case RenderType::kGrid:
      return "kGrid";
    default:
      return nullptr;
  }
}

std::string RenderTypeToString(RenderType value) {
  const char *str = RenderTypeToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown RenderType value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, RenderType value) {
  return os << RenderTypeToString(value);
}

NOINLINE static const char* SelectionLineStateToStringHelper(SelectionLineState value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case SelectionLineState::kNormal:
      return "kNormal";
    case SelectionLineState::kKeywordMode:
      return "kKeywordMode";
    case SelectionLineState::kFocusedButtonAction:
      return "kFocusedButtonAction";
    case SelectionLineState::kFocusedButtonRemoveSuggestion:
      return "kFocusedButtonRemoveSuggestion";
    case SelectionLineState::kFocusedButtonAim:
      return "kFocusedButtonAim";
    case SelectionLineState::kFocusedButtonContextEntrypoint:
      return "kFocusedButtonContextEntrypoint";
    case SelectionLineState::kCtrlEnter:
      return "kCtrlEnter";
    default:
      return nullptr;
  }
}

std::string SelectionLineStateToString(SelectionLineState value) {
  const char *str = SelectionLineStateToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown SelectionLineState value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, SelectionLineState value) {
  return os << SelectionLineStateToString(value);
}

NOINLINE static const char* SelectionDirectionToStringHelper(SelectionDirection value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case SelectionDirection::kForward:
      return "kForward";
    case SelectionDirection::kBackward:
      return "kBackward";
    default:
      return nullptr;
  }
}

std::string SelectionDirectionToString(SelectionDirection value) {
  const char *str = SelectionDirectionToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown SelectionDirection value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, SelectionDirection value) {
  return os << SelectionDirectionToString(value);
}

NOINLINE static const char* SelectionStepToStringHelper(SelectionStep value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case SelectionStep::kWholeLine:
      return "kWholeLine";
    case SelectionStep::kStateOrLine:
      return "kStateOrLine";
    case SelectionStep::kAllLines:
      return "kAllLines";
    default:
      return nullptr;
  }
}

std::string SelectionStepToString(SelectionStep value) {
  const char *str = SelectionStepToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown SelectionStep value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, SelectionStep value) {
  return os << SelectionStepToString(value);
}

NOINLINE static const char* DriveUploadErrorToStringHelper(DriveUploadError value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case DriveUploadError::kSizeLimitExceeded:
      return "kSizeLimitExceeded";
    case DriveUploadError::kMaxFilesExceeded:
      return "kMaxFilesExceeded";
    default:
      return nullptr;
  }
}

std::string DriveUploadErrorToString(DriveUploadError value) {
  const char *str = DriveUploadErrorToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown DriveUploadError value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, DriveUploadError value) {
  return os << DriveUploadErrorToString(value);
}

NOINLINE static const char* DriveDisclaimerStatusToStringHelper(DriveDisclaimerStatus value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case DriveDisclaimerStatus::kNotAccepted:
      return "kNotAccepted";
    case DriveDisclaimerStatus::kAccepted:
      return "kAccepted";
    case DriveDisclaimerStatus::kRestricted:
      return "kRestricted";
    default:
      return nullptr;
  }
}

std::string DriveDisclaimerStatusToString(DriveDisclaimerStatus value) {
  const char *str = DriveDisclaimerStatusToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown DriveDisclaimerStatus value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, DriveDisclaimerStatus value) {
  return os << DriveDisclaimerStatusToString(value);
}

NOINLINE static const char* InputMethodToStringHelper(InputMethod value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case InputMethod::kKeyboard:
      return "kKeyboard";
    case InputMethod::kPaste:
      return "kPaste";
    case InputMethod::kSpeech:
      return "kSpeech";
    case InputMethod::kTab:
      return "kTab";
    case InputMethod::kLensCamera:
      return "kLensCamera";
    case InputMethod::kSmartCompose:
      return "kSmartCompose";
    default:
      return nullptr;
  }
}

std::string InputMethodToString(InputMethod value) {
  const char *str = InputMethodToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown InputMethod value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, InputMethod value) {
  return os << InputMethodToString(value);
}

namespace internal {
// static
bool SearchContextAttachment_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context,
    bool inlined) {
  if (!data) {
    DCHECK(!inlined);
    return true;
  }

  // If it is inlined, the alignment is already enforced by its enclosing
  // object. We don't have to validate that.
  DCHECK(!inlined || mojo::internal::IsAligned(data));

  if (!inlined &&
      !mojo::internal::ValidateNonInlinedUnionHeaderAndClaimMemory(
          data, validation_context)) {
    return false;
  }

  const SearchContextAttachment_Data* object = static_cast<const SearchContextAttachment_Data*>(data);

  if (inlined && object->is_null())
    return true;

  switch (object->tag) {

    case SearchContextAttachment_Tag::kFileAttachment: {

      if (!mojo::internal::ValidatePointerNonNullable(
              object->data.f_file_attachment, 1, validation_context)) {
        return false;
      }
      if (!mojo::internal::ValidateStruct(object->data.f_file_attachment, validation_context))
        return false;
      return true;
    }
    case SearchContextAttachment_Tag::kTabAttachment: {

      if (!mojo::internal::ValidatePointerNonNullable(
              object->data.f_tab_attachment, 2, validation_context)) {
        return false;
      }
      if (!mojo::internal::ValidateStruct(object->data.f_tab_attachment, validation_context))
        return false;
      return true;
    }
    default: {

      ReportValidationError(
          validation_context,
          mojo::internal::VALIDATION_ERROR_UNKNOWN_UNION_TAG,
          "unknown tag in SearchContextAttachment");
      return false;
    }
  }
}
// static
bool PageHandler_AddFileContext_ResponseParam_Result_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context,
    bool inlined) {
  if (!data) {
    DCHECK(!inlined);
    return true;
  }

  // If it is inlined, the alignment is already enforced by its enclosing
  // object. We don't have to validate that.
  DCHECK(!inlined || mojo::internal::IsAligned(data));

  if (!inlined &&
      !mojo::internal::ValidateNonInlinedUnionHeaderAndClaimMemory(
          data, validation_context)) {
    return false;
  }

  const PageHandler_AddFileContext_ResponseParam_Result_Data* object = static_cast<const PageHandler_AddFileContext_ResponseParam_Result_Data*>(data);

  if (inlined && object->is_null())
    return true;

  switch (object->tag) {

    case PageHandler_AddFileContext_ResponseParam_Result_Tag::kSuccess: {

      if (!mojo::internal::ValidatePointerNonNullable(
              object->data.f_success, 1, validation_context)) {
        return false;
      }
      if (!mojo::internal::ValidateStruct(object->data.f_success, validation_context))
        return false;
      return true;
    }
    case PageHandler_AddFileContext_ResponseParam_Result_Tag::kFailure: {


      if (!::composebox_query::mojom::internal::ContextUploadErrorType_Data
            ::Validate(object->data.f_failure, validation_context))
        return false;
      return true;
    }
    default: {

      ReportValidationError(
          validation_context,
          mojo::internal::VALIDATION_ERROR_UNKNOWN_UNION_TAG,
          "unknown tag in PageHandler_AddFileContext_ResponseParam_Result");
      return false;
    }
  }
}
// static
bool PageHandler_AddTabContext_ResponseParam_Result_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context,
    bool inlined) {
  if (!data) {
    DCHECK(!inlined);
    return true;
  }

  // If it is inlined, the alignment is already enforced by its enclosing
  // object. We don't have to validate that.
  DCHECK(!inlined || mojo::internal::IsAligned(data));

  if (!inlined &&
      !mojo::internal::ValidateNonInlinedUnionHeaderAndClaimMemory(
          data, validation_context)) {
    return false;
  }

  const PageHandler_AddTabContext_ResponseParam_Result_Data* object = static_cast<const PageHandler_AddTabContext_ResponseParam_Result_Data*>(data);

  if (inlined && object->is_null())
    return true;

  switch (object->tag) {

    case PageHandler_AddTabContext_ResponseParam_Result_Tag::kSuccess: {

      if (!mojo::internal::ValidatePointerNonNullable(
              object->data.f_success, 1, validation_context)) {
        return false;
      }
      if (!mojo::internal::ValidateStruct(object->data.f_success, validation_context))
        return false;
      return true;
    }
    case PageHandler_AddTabContext_ResponseParam_Result_Tag::kFailure: {


      if (!::composebox_query::mojom::internal::ContextUploadErrorType_Data
            ::Validate(object->data.f_failure, validation_context))
        return false;
      return true;
    }
    default: {

      ReportValidationError(
          validation_context,
          mojo::internal::VALIDATION_ERROR_UNKNOWN_UNION_TAG,
          "unknown tag in PageHandler_AddTabContext_ResponseParam_Result");
      return false;
    }
  }
}


// static
bool ACMatchClassification_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const ACMatchClassification_Data* object =
      static_cast<const ACMatchClassification_Data*>(data);

  return true;
}

ACMatchClassification_Data::ACMatchClassification_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Action_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 40, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Action_Data* object =
      static_cast<const Action_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->hint, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& hint_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->hint, validation_context,
                                         &hint_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->suggestion_contents, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& suggestion_contents_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->suggestion_contents, validation_context,
                                         &suggestion_contents_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->icon_path, 3, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& icon_path_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->icon_path, validation_context,
                                         &icon_path_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->a11y_label, 4, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& a11y_label_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->a11y_label, validation_context,
                                         &a11y_label_validate_params)) {
    return false;
  }

  return true;
}

Action_Data::Action_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool SuggestionAnswer_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const SuggestionAnswer_Data* object =
      static_cast<const SuggestionAnswer_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->first_line, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->first_line, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->second_line, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->second_line, validation_context))
    return false;

  return true;
}

SuggestionAnswer_Data::SuggestionAnswer_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool InputKeywordModel_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const InputKeywordModel_Data* object =
      static_cast<const InputKeywordModel_Data*>(data);


  if (!::searchbox::mojom::internal::KeywordType_Data
        ::Validate(object->type, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->keyword, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& keyword_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->keyword, validation_context,
                                         &keyword_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->display_text, 3, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& display_text_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->display_text, validation_context,
                                         &display_text_validate_params)) {
    return false;
  }

  return true;
}

InputKeywordModel_Data::InputKeywordModel_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool MatchKeywordModel_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 48, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const MatchKeywordModel_Data* object =
      static_cast<const MatchKeywordModel_Data*>(data);


  if (!::searchbox::mojom::internal::KeywordType_Data
        ::Validate(object->type, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->chip_hint, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& chip_hint_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->chip_hint, validation_context,
                                         &chip_hint_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->chip_a11y, 3, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& chip_a11y_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->chip_a11y, validation_context,
                                         &chip_a11y_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->placeholder, 4, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& placeholder_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->placeholder, validation_context,
                                         &placeholder_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->keyword, 5, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& keyword_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->keyword, validation_context,
                                         &keyword_validate_params)) {
    return false;
  }

  return true;
}

MatchKeywordModel_Data::MatchKeywordModel_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool AutocompleteMatch_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 168, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const AutocompleteMatch_Data* object =
      static_cast<const AutocompleteMatch_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->a11y_label, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->a11y_label, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->actions, 4, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& actions_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->actions, validation_context,
                                         &actions_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidateStruct(object->answer, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->contents, 6, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->contents, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->contents_class, 7, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& contents_class_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->contents_class, validation_context,
                                         &contents_class_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->description, 8, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->description, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->description_class, 9, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& description_class_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->description_class, validation_context,
                                         &description_class_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->destination_url, 10, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->destination_url, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->inline_autocompletion, 11, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->inline_autocompletion, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->fill_into_edit, 12, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->fill_into_edit, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->icon_path, 15, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& icon_path_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->icon_path, validation_context,
                                         &icon_path_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->icon_url, 16, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->icon_url, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->image_dominant_color, 17, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& image_dominant_color_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->image_dominant_color, validation_context,
                                         &image_dominant_color_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->image_url, 18, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& image_url_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->image_url, validation_context,
                                         &image_url_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->type, 24, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& type_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->type, validation_context,
                                         &type_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->remove_button_a11y_label, 25, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->remove_button_a11y_label, validation_context))
    return false;

  if (!mojo::internal::ValidateStruct(object->tail_suggest_common_prefix, validation_context))
    return false;

  if (!mojo::internal::ValidateStruct(object->keyword_model, validation_context))
    return false;

  if (!mojo::internal::ValidateStruct(object->fusebox_action, validation_context))
    return false;

  return true;
}

AutocompleteMatch_Data::AutocompleteMatch_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool TabInfo_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 40, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const TabInfo_Data* object =
      static_cast<const TabInfo_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->title, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& title_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->title, validation_context,
                                         &title_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->url, 3, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->url, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->last_active, 6, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->last_active, validation_context))
    return false;

  return true;
}

TabInfo_Data::TabInfo_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool FileAttachment_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 64, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const FileAttachment_Data* object =
      static_cast<const FileAttachment_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->uuid, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->uuid, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->name, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& name_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->name, validation_context,
                                         &name_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->mime_type, 3, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& mime_type_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->mime_type, validation_context,
                                         &mime_type_validate_params)) {
    return false;
  }

  constexpr const mojo::internal::ContainerValidateParams& image_data_url_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->image_data_url, validation_context,
                                         &image_data_url_validate_params)) {
    return false;
  }


  if (!::composebox_query::mojom::internal::ContextUploadErrorType_Data
        ::Validate(object->error_type_$value, validation_context))
    return false;

  if (!mojo::internal::ValidateStruct(object->icon_url, validation_context))
    return false;

  if (!mojo::internal::ValidateStruct(object->thumbnail_url, validation_context))
    return false;

  return true;
}

FileAttachment_Data::FileAttachment_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool TabAttachment_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const TabAttachment_Data* object =
      static_cast<const TabAttachment_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->title, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& title_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->title, validation_context,
                                         &title_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->url, 3, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->url, validation_context))
    return false;


  if (!::searchbox::mojom::internal::TabAttachmentSource_Data
        ::Validate(object->source, validation_context))
    return false;

  return true;
}

TabAttachment_Data::TabAttachment_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool SearchContext_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const SearchContext_Data* object =
      static_cast<const SearchContext_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->input, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& input_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->input, validation_context,
                                         &input_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->attachments, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& attachments_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->attachments, validation_context,
                                         &attachments_validate_params)) {
    return false;
  }


  if (!::composebox_query::mojom::internal::ToolMode_Data
        ::Validate(object->tool_mode, validation_context))
    return false;

  return true;
}

SearchContext_Data::SearchContext_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool SelectedFileInfo_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 56, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const SelectedFileInfo_Data* object =
      static_cast<const SelectedFileInfo_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->file_name, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& file_name_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->file_name, validation_context,
                                         &file_name_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->mime_type, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& mime_type_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->mime_type, validation_context,
                                         &mime_type_validate_params)) {
    return false;
  }

  constexpr const mojo::internal::ContainerValidateParams& image_data_url_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->image_data_url, validation_context,
                                         &image_data_url_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->selection_time, 5, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->selection_time, validation_context))
    return false;

  if (!mojo::internal::ValidateStruct(object->thumbnail_url, validation_context))
    return false;

  return true;
}

SelectedFileInfo_Data::SelectedFileInfo_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool SuggestionGroup_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const SuggestionGroup_Data* object =
      static_cast<const SuggestionGroup_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->header, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->header, validation_context))
    return false;


  if (!::searchbox::mojom::internal::RenderType_Data
        ::Validate(object->render_type, validation_context))
    return false;


  if (!::searchbox::mojom::internal::SideType_Data
        ::Validate(object->side_type, validation_context))
    return false;

  return true;
}

SuggestionGroup_Data::SuggestionGroup_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool SmartComposeStats_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const SmartComposeStats_Data* object =
      static_cast<const SmartComposeStats_Data*>(data);

  return true;
}

SmartComposeStats_Data::SmartComposeStats_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool AutocompleteResult_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 48, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const AutocompleteResult_Data* object =
      static_cast<const AutocompleteResult_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->input, 3, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->input, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->suggestion_groups_map, 4, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& suggestion_groups_map_validate_params =
      mojo::internal::GetMapValidator<*&mojo::internal::GetArrayValidator<0, false, nullptr>(), *&mojo::internal::GetArrayValidator<0, false, nullptr>()>();
  if (!mojo::internal::ValidateContainer(object->suggestion_groups_map, validation_context,
                                         &suggestion_groups_map_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->matches, 5, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& matches_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->matches, validation_context,
                                         &matches_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidateStruct(object->smart_compose_inline_hint, validation_context))
    return false;

  return true;
}

AutocompleteResult_Data::AutocompleteResult_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool OmniboxPopupSelection_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const OmniboxPopupSelection_Data* object =
      static_cast<const OmniboxPopupSelection_Data*>(data);


  if (!::searchbox::mojom::internal::SelectionLineState_Data
        ::Validate(object->state, validation_context))
    return false;

  return true;
}

OmniboxPopupSelection_Data::OmniboxPopupSelection_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool ActionModifiers_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const ActionModifiers_Data* object =
      static_cast<const ActionModifiers_Data*>(data);

  return true;
}

ActionModifiers_Data::ActionModifiers_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PlaceholderConfig_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PlaceholderConfig_Data* object =
      static_cast<const PlaceholderConfig_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->texts, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& texts_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->texts, validation_context,
                                         &texts_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->change_text_animation_interval, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->change_text_animation_interval, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->fade_text_animation_duration, 3, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->fade_text_animation_duration, validation_context))
    return false;

  return true;
}

PlaceholderConfig_Data::PlaceholderConfig_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DriveFile_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 48, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DriveFile_Data* object =
      static_cast<const DriveFile_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->token, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->token, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->mime_type, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& mime_type_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->mime_type, validation_context,
                                         &mime_type_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->file_name, 3, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& file_name_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->file_name, validation_context,
                                         &file_name_validate_params)) {
    return false;
  }

  constexpr const mojo::internal::ContainerValidateParams& thumbnail_url_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->thumbnail_url, validation_context,
                                         &thumbnail_url_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidateStruct(object->icon_url, validation_context))
    return false;

  return true;
}

DriveFile_Data::DriveFile_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool DriveUploadResponse_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const DriveUploadResponse_Data* object =
      static_cast<const DriveUploadResponse_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->files, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& files_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->files, validation_context,
                                         &files_validate_params)) {
    return false;
  }


  if (!::searchbox::mojom::internal::DriveUploadError_Data
        ::Validate(object->error_$value, validation_context))
    return false;

  return true;
}

DriveUploadResponse_Data::DriveUploadResponse_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandlerFactory_CreatePageHandler_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandlerFactory_CreatePageHandler_Params_Data* object =
      static_cast<const PageHandlerFactory_CreatePageHandler_Params_Data*>(data);

  if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
          object->page, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateHandleOrInterface(object->page,
                                                 validation_context)) {
    return false;
  }

  if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
          object->handler, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateHandleOrInterface(object->handler,
                                                 validation_context)) {
    return false;
  }

  return true;
}

PageHandlerFactory_CreatePageHandler_Params_Data::PageHandlerFactory_CreatePageHandler_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_OnFocusChanged_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_OnFocusChanged_Params_Data* object =
      static_cast<const PageHandler_OnFocusChanged_Params_Data*>(data);

  return true;
}

PageHandler_OnFocusChanged_Params_Data::PageHandler_OnFocusChanged_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_QueryAutocomplete_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 48, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_QueryAutocomplete_Params_Data* object =
      static_cast<const PageHandler_QueryAutocomplete_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->input, 4, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->input, validation_context))
    return false;


  if (!::fusebox_action::mojom::internal::SuggestInventory_Data
        ::Validate(object->suggest_inventory, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->keyword, 9, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& keyword_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->keyword, validation_context,
                                         &keyword_validate_params)) {
    return false;
  }


  if (!::searchbox::mojom::internal::InputMethod_Data
        ::Validate(object->input_method, validation_context))
    return false;

  return true;
}

PageHandler_QueryAutocomplete_Params_Data::PageHandler_QueryAutocomplete_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_StopAutocomplete_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_StopAutocomplete_Params_Data* object =
      static_cast<const PageHandler_StopAutocomplete_Params_Data*>(data);

  return true;
}

PageHandler_StopAutocomplete_Params_Data::PageHandler_StopAutocomplete_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_OpenAutocompleteMatch_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_OpenAutocompleteMatch_Params_Data* object =
      static_cast<const PageHandler_OpenAutocompleteMatch_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->url, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->url, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->modifiers, 5, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->modifiers, validation_context))
    return false;

  return true;
}

PageHandler_OpenAutocompleteMatch_Params_Data::PageHandler_OpenAutocompleteMatch_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_SetSmartComposeStats_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_SetSmartComposeStats_Params_Data* object =
      static_cast<const PageHandler_SetSmartComposeStats_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->smart_compose_stats, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->smart_compose_stats, validation_context))
    return false;

  return true;
}

PageHandler_SetSmartComposeStats_Params_Data::PageHandler_SetSmartComposeStats_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_SetPopupSelection_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_SetPopupSelection_Params_Data* object =
      static_cast<const PageHandler_SetPopupSelection_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->selection, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->selection, validation_context))
    return false;

  return true;
}

PageHandler_SetPopupSelection_Params_Data::PageHandler_SetPopupSelection_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_OpenPopupSelection_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_OpenPopupSelection_Params_Data* object =
      static_cast<const PageHandler_OpenPopupSelection_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->selection, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->selection, validation_context))
    return false;


  if (!::ui::mojom::internal::WindowOpenDisposition_Data
        ::Validate(object->disposition, validation_context))
    return false;

  return true;
}

PageHandler_OpenPopupSelection_Params_Data::PageHandler_OpenPopupSelection_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_OnNavigationLikely_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_OnNavigationLikely_Params_Data* object =
      static_cast<const PageHandler_OnNavigationLikely_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->url, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->url, validation_context))
    return false;


  if (!::omnibox::mojom::internal::NavigationPredictor_Data
        ::Validate(object->navigation_predictor, validation_context))
    return false;

  return true;
}

PageHandler_OnNavigationLikely_Params_Data::PageHandler_OnNavigationLikely_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_DeleteAutocompleteMatch_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_DeleteAutocompleteMatch_Params_Data* object =
      static_cast<const PageHandler_DeleteAutocompleteMatch_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->url, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->url, validation_context))
    return false;

  return true;
}

PageHandler_DeleteAutocompleteMatch_Params_Data::PageHandler_DeleteAutocompleteMatch_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_ActivateKeyword_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_ActivateKeyword_Params_Data* object =
      static_cast<const PageHandler_ActivateKeyword_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->url, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->url, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->match_selection_timestamp, 3, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->match_selection_timestamp, validation_context))
    return false;

  return true;
}

PageHandler_ActivateKeyword_Params_Data::PageHandler_ActivateKeyword_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_ExecuteAction_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_ExecuteAction_Params_Data* object =
      static_cast<const PageHandler_ExecuteAction_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->url, 3, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->url, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->match_selection_timestamp, 4, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->match_selection_timestamp, validation_context))
    return false;

  return true;
}

PageHandler_ExecuteAction_Params_Data::PageHandler_ExecuteAction_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_OnThumbnailRemoved_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_OnThumbnailRemoved_Params_Data* object =
      static_cast<const PageHandler_OnThumbnailRemoved_Params_Data*>(data);

  return true;
}

PageHandler_OnThumbnailRemoved_Params_Data::PageHandler_OnThumbnailRemoved_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_GetCyclingPlaceholderConfig_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_GetCyclingPlaceholderConfig_Params_Data* object =
      static_cast<const PageHandler_GetCyclingPlaceholderConfig_Params_Data*>(data);

  return true;
}

PageHandler_GetCyclingPlaceholderConfig_Params_Data::PageHandler_GetCyclingPlaceholderConfig_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_GetCyclingPlaceholderConfig_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_GetCyclingPlaceholderConfig_ResponseParams_Data* object =
      static_cast<const PageHandler_GetCyclingPlaceholderConfig_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->config, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->config, validation_context))
    return false;

  return true;
}

PageHandler_GetCyclingPlaceholderConfig_ResponseParams_Data::PageHandler_GetCyclingPlaceholderConfig_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_GetRecentTabs_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_GetRecentTabs_Params_Data* object =
      static_cast<const PageHandler_GetRecentTabs_Params_Data*>(data);

  return true;
}

PageHandler_GetRecentTabs_Params_Data::PageHandler_GetRecentTabs_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_GetRecentTabs_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_GetRecentTabs_ResponseParams_Data* object =
      static_cast<const PageHandler_GetRecentTabs_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->tabs, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& tabs_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->tabs, validation_context,
                                         &tabs_validate_params)) {
    return false;
  }

  return true;
}

PageHandler_GetRecentTabs_ResponseParams_Data::PageHandler_GetRecentTabs_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_GetTabPreview_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_GetTabPreview_Params_Data* object =
      static_cast<const PageHandler_GetTabPreview_Params_Data*>(data);

  return true;
}

PageHandler_GetTabPreview_Params_Data::PageHandler_GetTabPreview_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_GetTabPreview_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_GetTabPreview_ResponseParams_Data* object =
      static_cast<const PageHandler_GetTabPreview_ResponseParams_Data*>(data);

  constexpr const mojo::internal::ContainerValidateParams& preview_data_url_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->preview_data_url, validation_context,
                                         &preview_data_url_validate_params)) {
    return false;
  }

  return true;
}

PageHandler_GetTabPreview_ResponseParams_Data::PageHandler_GetTabPreview_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_WaitForTabFaviconLoad_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_WaitForTabFaviconLoad_Params_Data* object =
      static_cast<const PageHandler_WaitForTabFaviconLoad_Params_Data*>(data);

  return true;
}

PageHandler_WaitForTabFaviconLoad_Params_Data::PageHandler_WaitForTabFaviconLoad_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_WaitForTabFaviconLoad_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_WaitForTabFaviconLoad_ResponseParams_Data* object =
      static_cast<const PageHandler_WaitForTabFaviconLoad_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidateStruct(object->favicon_data_url, validation_context))
    return false;

  return true;
}

PageHandler_WaitForTabFaviconLoad_ResponseParams_Data::PageHandler_WaitForTabFaviconLoad_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_GetInputState_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_GetInputState_Params_Data* object =
      static_cast<const PageHandler_GetInputState_Params_Data*>(data);

  return true;
}

PageHandler_GetInputState_Params_Data::PageHandler_GetInputState_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_GetInputState_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_GetInputState_ResponseParams_Data* object =
      static_cast<const PageHandler_GetInputState_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidateStruct(object->state, validation_context))
    return false;

  return true;
}

PageHandler_GetInputState_ResponseParams_Data::PageHandler_GetInputState_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_NotifySessionStarted_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_NotifySessionStarted_Params_Data* object =
      static_cast<const PageHandler_NotifySessionStarted_Params_Data*>(data);

  return true;
}

PageHandler_NotifySessionStarted_Params_Data::PageHandler_NotifySessionStarted_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_NotifySessionAbandoned_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_NotifySessionAbandoned_Params_Data* object =
      static_cast<const PageHandler_NotifySessionAbandoned_Params_Data*>(data);

  return true;
}

PageHandler_NotifySessionAbandoned_Params_Data::PageHandler_NotifySessionAbandoned_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_AddFileContext_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_AddFileContext_Params_Data* object =
      static_cast<const PageHandler_AddFileContext_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->file_info, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->file_info, validation_context))
    return false;

  if (!mojo::internal::ValidateInlinedUnionNonNullable(
          object->file_bytes, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateInlinedUnion(object->file_bytes, validation_context))
    return false;

  return true;
}

PageHandler_AddFileContext_Params_Data::PageHandler_AddFileContext_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_AddFileContext_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_AddFileContext_ResponseParams_Data* object =
      static_cast<const PageHandler_AddFileContext_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidateInlinedUnionNonNullable(
          object->result, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateInlinedUnion(object->result, validation_context))
    return false;

  return true;
}

PageHandler_AddFileContext_ResponseParams_Data::PageHandler_AddFileContext_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_AddTabContext_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_AddTabContext_Params_Data* object =
      static_cast<const PageHandler_AddTabContext_Params_Data*>(data);


  if (!::searchbox::mojom::internal::TabAttachmentSource_Data
        ::Validate(object->source, validation_context))
    return false;

  return true;
}

PageHandler_AddTabContext_Params_Data::PageHandler_AddTabContext_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_AddTabContext_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_AddTabContext_ResponseParams_Data* object =
      static_cast<const PageHandler_AddTabContext_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidateInlinedUnionNonNullable(
          object->result, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateInlinedUnion(object->result, validation_context))
    return false;

  return true;
}

PageHandler_AddTabContext_ResponseParams_Data::PageHandler_AddTabContext_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_DeleteContext_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_DeleteContext_Params_Data* object =
      static_cast<const PageHandler_DeleteContext_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->token, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->token, validation_context))
    return false;

  return true;
}

PageHandler_DeleteContext_Params_Data::PageHandler_DeleteContext_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_DeleteTabContext_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_DeleteTabContext_Params_Data* object =
      static_cast<const PageHandler_DeleteTabContext_Params_Data*>(data);

  return true;
}

PageHandler_DeleteTabContext_Params_Data::PageHandler_DeleteTabContext_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_ClearFiles_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_ClearFiles_Params_Data* object =
      static_cast<const PageHandler_ClearFiles_Params_Data*>(data);

  return true;
}

PageHandler_ClearFiles_Params_Data::PageHandler_ClearFiles_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_SubmitQuery_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_SubmitQuery_Params_Data* object =
      static_cast<const PageHandler_SubmitQuery_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->query_text, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& query_text_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->query_text, validation_context,
                                         &query_text_validate_params)) {
    return false;
  }

  return true;
}

PageHandler_SubmitQuery_Params_Data::PageHandler_SubmitQuery_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_OpenLensSearch_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_OpenLensSearch_Params_Data* object =
      static_cast<const PageHandler_OpenLensSearch_Params_Data*>(data);

  return true;
}

PageHandler_OpenLensSearch_Params_Data::PageHandler_OpenLensSearch_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_SetActiveToolMode_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_SetActiveToolMode_Params_Data* object =
      static_cast<const PageHandler_SetActiveToolMode_Params_Data*>(data);


  if (!::composebox_query::mojom::internal::ToolMode_Data
        ::Validate(object->tool, validation_context))
    return false;

  return true;
}

PageHandler_SetActiveToolMode_Params_Data::PageHandler_SetActiveToolMode_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_SetActiveModelMode_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_SetActiveModelMode_Params_Data* object =
      static_cast<const PageHandler_SetActiveModelMode_Params_Data*>(data);


  if (!::composebox_query::mojom::internal::ModelMode_Data
        ::Validate(object->model, validation_context))
    return false;

  return true;
}

PageHandler_SetActiveModelMode_Params_Data::PageHandler_SetActiveModelMode_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_ActivateMetricsFunnel_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_ActivateMetricsFunnel_Params_Data* object =
      static_cast<const PageHandler_ActivateMetricsFunnel_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->funnel_name, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& funnel_name_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->funnel_name, validation_context,
                                         &funnel_name_validate_params)) {
    return false;
  }

  return true;
}

PageHandler_ActivateMetricsFunnel_Params_Data::PageHandler_ActivateMetricsFunnel_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_RecordToolSelectionAction_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_RecordToolSelectionAction_Params_Data* object =
      static_cast<const PageHandler_RecordToolSelectionAction_Params_Data*>(data);


  if (!::composebox_query::mojom::internal::ToolMode_Data
        ::Validate(object->tool, validation_context))
    return false;

  return true;
}

PageHandler_RecordToolSelectionAction_Params_Data::PageHandler_RecordToolSelectionAction_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_RecordModelSelectionAction_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_RecordModelSelectionAction_Params_Data* object =
      static_cast<const PageHandler_RecordModelSelectionAction_Params_Data*>(data);


  if (!::composebox_query::mojom::internal::ModelMode_Data
        ::Validate(object->model, validation_context))
    return false;

  return true;
}

PageHandler_RecordModelSelectionAction_Params_Data::PageHandler_RecordModelSelectionAction_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_GetDriveDisclaimerStatus_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_GetDriveDisclaimerStatus_Params_Data* object =
      static_cast<const PageHandler_GetDriveDisclaimerStatus_Params_Data*>(data);

  return true;
}

PageHandler_GetDriveDisclaimerStatus_Params_Data::PageHandler_GetDriveDisclaimerStatus_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_GetDriveDisclaimerStatus_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_GetDriveDisclaimerStatus_ResponseParams_Data* object =
      static_cast<const PageHandler_GetDriveDisclaimerStatus_ResponseParams_Data*>(data);


  if (!::searchbox::mojom::internal::DriveDisclaimerStatus_Data
        ::Validate(object->status, validation_context))
    return false;

  return true;
}

PageHandler_GetDriveDisclaimerStatus_ResponseParams_Data::PageHandler_GetDriveDisclaimerStatus_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_OnDriveDisclaimerAccepted_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_OnDriveDisclaimerAccepted_Params_Data* object =
      static_cast<const PageHandler_OnDriveDisclaimerAccepted_Params_Data*>(data);

  return true;
}

PageHandler_OnDriveDisclaimerAccepted_Params_Data::PageHandler_OnDriveDisclaimerAccepted_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_OnDriveUploadClicked_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_OnDriveUploadClicked_Params_Data* object =
      static_cast<const PageHandler_OnDriveUploadClicked_Params_Data*>(data);

  return true;
}

PageHandler_OnDriveUploadClicked_Params_Data::PageHandler_OnDriveUploadClicked_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_OnDriveUploadClicked_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_OnDriveUploadClicked_ResponseParams_Data* object =
      static_cast<const PageHandler_OnDriveUploadClicked_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->response, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->response, validation_context))
    return false;

  return true;
}

PageHandler_OnDriveUploadClicked_ResponseParams_Data::PageHandler_OnDriveUploadClicked_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_OpenProfilePicker_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_OpenProfilePicker_Params_Data* object =
      static_cast<const PageHandler_OpenProfilePicker_Params_Data*>(data);

  return true;
}

PageHandler_OpenProfilePicker_Params_Data::PageHandler_OpenProfilePicker_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_ShowScreenshotMenu_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_ShowScreenshotMenu_Params_Data* object =
      static_cast<const PageHandler_ShowScreenshotMenu_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->anchor_rect, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->anchor_rect, validation_context))
    return false;

  return true;
}

PageHandler_ShowScreenshotMenu_Params_Data::PageHandler_ShowScreenshotMenu_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_StartScreenshare_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_StartScreenshare_Params_Data* object =
      static_cast<const PageHandler_StartScreenshare_Params_Data*>(data);

  return true;
}

PageHandler_StartScreenshare_Params_Data::PageHandler_StartScreenshare_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_StartScreenshare_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_StartScreenshare_ResponseParams_Data* object =
      static_cast<const PageHandler_StartScreenshare_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidateStruct(object->token, validation_context))
    return false;

  return true;
}

PageHandler_StartScreenshare_ResponseParams_Data::PageHandler_StartScreenshare_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_CaptureRegionScreenshot_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_CaptureRegionScreenshot_Params_Data* object =
      static_cast<const PageHandler_CaptureRegionScreenshot_Params_Data*>(data);

  return true;
}

PageHandler_CaptureRegionScreenshot_Params_Data::PageHandler_CaptureRegionScreenshot_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_CaptureRegionScreenshot_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_CaptureRegionScreenshot_ResponseParams_Data* object =
      static_cast<const PageHandler_CaptureRegionScreenshot_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidateStruct(object->token, validation_context))
    return false;

  return true;
}

PageHandler_CaptureRegionScreenshot_ResponseParams_Data::PageHandler_CaptureRegionScreenshot_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_GetPageClassification_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_GetPageClassification_Params_Data* object =
      static_cast<const PageHandler_GetPageClassification_Params_Data*>(data);

  return true;
}

PageHandler_GetPageClassification_Params_Data::PageHandler_GetPageClassification_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool PageHandler_GetPageClassification_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const PageHandler_GetPageClassification_ResponseParams_Data* object =
      static_cast<const PageHandler_GetPageClassification_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->metricSource, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& metricSource_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->metricSource, validation_context,
                                         &metricSource_validate_params)) {
    return false;
  }

  return true;
}

PageHandler_GetPageClassification_ResponseParams_Data::PageHandler_GetPageClassification_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_AutocompleteResultChanged_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_AutocompleteResultChanged_Params_Data* object =
      static_cast<const Page_AutocompleteResultChanged_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->result, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->result, validation_context))
    return false;

  return true;
}

Page_AutocompleteResultChanged_Params_Data::Page_AutocompleteResultChanged_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_UpdateSelection_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_UpdateSelection_Params_Data* object =
      static_cast<const Page_UpdateSelection_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->old_selection, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->old_selection, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->selection, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->selection, validation_context))
    return false;

  return true;
}

Page_UpdateSelection_Params_Data::Page_UpdateSelection_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_StepSelection_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_StepSelection_Params_Data* object =
      static_cast<const Page_StepSelection_Params_Data*>(data);


  if (!::searchbox::mojom::internal::SelectionDirection_Data
        ::Validate(object->direction, validation_context))
    return false;


  if (!::searchbox::mojom::internal::SelectionStep_Data
        ::Validate(object->step, validation_context))
    return false;

  return true;
}

Page_StepSelection_Params_Data::Page_StepSelection_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_OpenCurrentSelection_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_OpenCurrentSelection_Params_Data* object =
      static_cast<const Page_OpenCurrentSelection_Params_Data*>(data);


  if (!::ui::mojom::internal::WindowOpenDisposition_Data
        ::Validate(object->disposition, validation_context))
    return false;

  return true;
}

Page_OpenCurrentSelection_Params_Data::Page_OpenCurrentSelection_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_SetAimButtonVisible_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_SetAimButtonVisible_Params_Data* object =
      static_cast<const Page_SetAimButtonVisible_Params_Data*>(data);

  return true;
}

Page_SetAimButtonVisible_Params_Data::Page_SetAimButtonVisible_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_SetAimButtonConfig_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 40, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_SetAimButtonConfig_Params_Data* object =
      static_cast<const Page_SetAimButtonConfig_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->text, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& text_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->text, validation_context,
                                         &text_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->tooltip, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& tooltip_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->tooltip, validation_context,
                                         &tooltip_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->a11y_label, 3, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& a11y_label_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->a11y_label, validation_context,
                                         &a11y_label_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->icon_url, 4, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->icon_url, validation_context))
    return false;

  return true;
}

Page_SetAimButtonConfig_Params_Data::Page_SetAimButtonConfig_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_SetInputText_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_SetInputText_Params_Data* object =
      static_cast<const Page_SetInputText_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->input, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& input_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->input, validation_context,
                                         &input_validate_params)) {
    return false;
  }

  return true;
}

Page_SetInputText_Params_Data::Page_SetInputText_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_SetThumbnail_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_SetThumbnail_Params_Data* object =
      static_cast<const Page_SetThumbnail_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->thumbnail_url, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& thumbnail_url_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->thumbnail_url, validation_context,
                                         &thumbnail_url_validate_params)) {
    return false;
  }

  return true;
}

Page_SetThumbnail_Params_Data::Page_SetThumbnail_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_OnContextualInputStatusChanged_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_OnContextualInputStatusChanged_Params_Data* object =
      static_cast<const Page_OnContextualInputStatusChanged_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->token, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->token, validation_context))
    return false;


  if (!::composebox_query::mojom::internal::ContextUploadStatus_Data
        ::Validate(object->status, validation_context))
    return false;


  if (!::composebox_query::mojom::internal::ContextUploadErrorType_Data
        ::Validate(object->error_type_$value, validation_context))
    return false;

  return true;
}

Page_OnContextualInputStatusChanged_Params_Data::Page_OnContextualInputStatusChanged_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_OnTabStripChanged_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_OnTabStripChanged_Params_Data* object =
      static_cast<const Page_OnTabStripChanged_Params_Data*>(data);

  return true;
}

Page_OnTabStripChanged_Params_Data::Page_OnTabStripChanged_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_OnInputStateChanged_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_OnInputStateChanged_Params_Data* object =
      static_cast<const Page_OnInputStateChanged_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->input_state, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->input_state, validation_context))
    return false;

  return true;
}

Page_OnInputStateChanged_Params_Data::Page_OnInputStateChanged_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_AddFileContext_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_AddFileContext_Params_Data* object =
      static_cast<const Page_AddFileContext_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->token, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->token, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->file_info, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->file_info, validation_context))
    return false;

  return true;
}

Page_AddFileContext_Params_Data::Page_AddFileContext_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_UpdateAutoSuggestedTabContext_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_UpdateAutoSuggestedTabContext_Params_Data* object =
      static_cast<const Page_UpdateAutoSuggestedTabContext_Params_Data*>(data);

  if (!mojo::internal::ValidateStruct(object->tab, validation_context))
    return false;

  constexpr const mojo::internal::ContainerValidateParams& invocation_source_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->invocation_source, validation_context,
                                         &invocation_source_validate_params)) {
    return false;
  }

  return true;
}

Page_UpdateAutoSuggestedTabContext_Params_Data::Page_UpdateAutoSuggestedTabContext_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_UpdateLensSearchEligibility_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_UpdateLensSearchEligibility_Params_Data* object =
      static_cast<const Page_UpdateLensSearchEligibility_Params_Data*>(data);

  return true;
}

Page_UpdateLensSearchEligibility_Params_Data::Page_UpdateLensSearchEligibility_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_UpdateContentSharingPolicy_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_UpdateContentSharingPolicy_Params_Data* object =
      static_cast<const Page_UpdateContentSharingPolicy_Params_Data*>(data);

  return true;
}

Page_UpdateContentSharingPolicy_Params_Data::Page_UpdateContentSharingPolicy_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_UpdateAimPopupEligibility_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_UpdateAimPopupEligibility_Params_Data* object =
      static_cast<const Page_UpdateAimPopupEligibility_Params_Data*>(data);

  return true;
}

Page_UpdateAimPopupEligibility_Params_Data::Page_UpdateAimPopupEligibility_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_OnPermissionPromptChanged_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_OnPermissionPromptChanged_Params_Data* object =
      static_cast<const Page_OnPermissionPromptChanged_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->prompt_size, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->prompt_size, validation_context))
    return false;

  return true;
}

Page_OnPermissionPromptChanged_Params_Data::Page_OnPermissionPromptChanged_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_SetRestoredTabIds_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_SetRestoredTabIds_Params_Data* object =
      static_cast<const Page_SetRestoredTabIds_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->ids, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& ids_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->ids, validation_context,
                                         &ids_validate_params)) {
    return false;
  }

  return true;
}

Page_SetRestoredTabIds_Params_Data::Page_SetRestoredTabIds_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_SetAimThreadRestoredTabs_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_SetAimThreadRestoredTabs_Params_Data* object =
      static_cast<const Page_SetAimThreadRestoredTabs_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->tabs, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& tabs_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->tabs, validation_context,
                                         &tabs_validate_params)) {
    return false;
  }

  return true;
}

Page_SetAimThreadRestoredTabs_Params_Data::Page_SetAimThreadRestoredTabs_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Page_OnScreenshotMenuClosed_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Page_OnScreenshotMenuClosed_Params_Data* object =
      static_cast<const Page_OnScreenshotMenuClosed_Params_Data*>(data);

  return true;
}

Page_OnScreenshotMenuClosed_Params_Data::Page_OnScreenshotMenuClosed_Params_Data()
    : header_({sizeof(*this), 0}) {}

}  // namespace internal
}  // namespace mojom
}  // namespace searchbox

namespace perfetto {

// static
void TraceFormatTraits<::searchbox::mojom::KeywordType>::WriteIntoTrace(
   perfetto::TracedValue context, ::searchbox::mojom::KeywordType value) {
  return std::move(context).WriteString(::searchbox::mojom::KeywordTypeToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::searchbox::mojom::TabAttachmentSource>::WriteIntoTrace(
   perfetto::TracedValue context, ::searchbox::mojom::TabAttachmentSource value) {
  return std::move(context).WriteString(::searchbox::mojom::TabAttachmentSourceToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::searchbox::mojom::SideType>::WriteIntoTrace(
   perfetto::TracedValue context, ::searchbox::mojom::SideType value) {
  return std::move(context).WriteString(::searchbox::mojom::SideTypeToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::searchbox::mojom::RenderType>::WriteIntoTrace(
   perfetto::TracedValue context, ::searchbox::mojom::RenderType value) {
  return std::move(context).WriteString(::searchbox::mojom::RenderTypeToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::searchbox::mojom::SelectionLineState>::WriteIntoTrace(
   perfetto::TracedValue context, ::searchbox::mojom::SelectionLineState value) {
  return std::move(context).WriteString(::searchbox::mojom::SelectionLineStateToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::searchbox::mojom::SelectionDirection>::WriteIntoTrace(
   perfetto::TracedValue context, ::searchbox::mojom::SelectionDirection value) {
  return std::move(context).WriteString(::searchbox::mojom::SelectionDirectionToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::searchbox::mojom::SelectionStep>::WriteIntoTrace(
   perfetto::TracedValue context, ::searchbox::mojom::SelectionStep value) {
  return std::move(context).WriteString(::searchbox::mojom::SelectionStepToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::searchbox::mojom::DriveUploadError>::WriteIntoTrace(
   perfetto::TracedValue context, ::searchbox::mojom::DriveUploadError value) {
  return std::move(context).WriteString(::searchbox::mojom::DriveUploadErrorToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::searchbox::mojom::DriveDisclaimerStatus>::WriteIntoTrace(
   perfetto::TracedValue context, ::searchbox::mojom::DriveDisclaimerStatus value) {
  return std::move(context).WriteString(::searchbox::mojom::DriveDisclaimerStatusToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::searchbox::mojom::InputMethod>::WriteIntoTrace(
   perfetto::TracedValue context, ::searchbox::mojom::InputMethod value) {
  return std::move(context).WriteString(::searchbox::mojom::InputMethodToString(value));
}

} // namespace perfetto