#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "chrome/common/accessibility/read_anything.mojom.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/features.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "chrome/common/accessibility/read_anything.mojom-params-data.h"
#include "chrome/common/accessibility/read_anything.mojom-shared-message-ids.h"
#include "chrome/common/accessibility/read_anything.mojom-import-headers.h"
#include "chrome/common/accessibility/read_anything.mojom-test-utils.h"
namespace read_anything::mojom {
VoicePackInfo::VoicePackInfo()
: … { … }
VoicePackInfo::VoicePackInfo(
VoicePackInstallationStatePtr pack_state_in,
const std::string& language_in)
: … { … }
VoicePackInfo::~VoicePackInfo() = default;
size_t VoicePackInfo::Hash(size_t seed) const { … }
void VoicePackInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool VoicePackInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
VoicePackInstallationState::VoicePackInstallationState() : … { … }
VoicePackInstallationState::~VoicePackInstallationState() { … }
void VoicePackInstallationState::set_installation_state(
InstallationState installation_state) { … }
void VoicePackInstallationState::set_error_code(
ErrorCode error_code) { … }
void VoicePackInstallationState::DestroyActive() { … }
size_t VoicePackInstallationState::Hash(size_t seed) const { … }
bool VoicePackInstallationState::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char UntrustedPageHandlerFactory::Name_[] = …;
UntrustedPageHandlerFactory::IPCStableHashFunction UntrustedPageHandlerFactory::MessageToMethodInfo_(mojo::Message& message) { … }
const char* UntrustedPageHandlerFactory::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t UntrustedPageHandlerFactory::CreateUntrustedPageHandler_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandlerFactory::ShouldShowUI_Sym::IPCStableHash() { … }
# endif
UntrustedPageHandlerFactoryProxy::UntrustedPageHandlerFactoryProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void UntrustedPageHandlerFactoryProxy::CreateUntrustedPageHandler(
::mojo::PendingRemote<UntrustedPage> in_page, ::mojo::PendingReceiver<UntrustedPageHandler> in_handler) { … }
void UntrustedPageHandlerFactoryProxy::ShouldShowUI(
) { … }
bool UntrustedPageHandlerFactoryStubDispatch::Accept(
UntrustedPageHandlerFactory* impl,
mojo::Message* message) { … }
bool UntrustedPageHandlerFactoryStubDispatch::AcceptWithResponder(
UntrustedPageHandlerFactory* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kUntrustedPageHandlerFactoryValidationInfo[] = …;
bool UntrustedPageHandlerFactoryRequestValidator::Accept(mojo::Message* message) { … }
const char UntrustedPageHandler::Name_[] = …;
UntrustedPageHandler::IPCStableHashFunction UntrustedPageHandler::MessageToMethodInfo_(mojo::Message& message) { … }
const char* UntrustedPageHandler::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t UntrustedPageHandler::GetVoicePackInfo_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::InstallVoicePack_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnCopy_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnLineSpaceChange_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnLetterSpaceChange_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnFontChange_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnFontSizeChange_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnLinksEnabledChanged_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnImagesEnabledChanged_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnColorChange_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnSpeechRateChange_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnVoiceChange_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnLanguagePrefChange_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnHighlightGranularityChanged_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnLinkClicked_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnImageDataRequested_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnSelectionChange_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnCollapseSelection_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::OnScreenshotRequested_Sym::IPCStableHash() { … }
uint32_t UntrustedPageHandler::ScrollToTargetNode_Sym::IPCStableHash() { … }
# endif
class UntrustedPageHandler_GetVoicePackInfo_ForwardToCallback
: public mojo::MessageReceiver { … };
class UntrustedPageHandler_InstallVoicePack_ForwardToCallback
: public mojo::MessageReceiver { … };
UntrustedPageHandlerProxy::UntrustedPageHandlerProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void UntrustedPageHandlerProxy::GetVoicePackInfo(
const std::string& in_language, GetVoicePackInfoCallback callback) { … }
void UntrustedPageHandlerProxy::InstallVoicePack(
const std::string& in_language, InstallVoicePackCallback callback) { … }
void UntrustedPageHandlerProxy::OnCopy(
) { … }
void UntrustedPageHandlerProxy::OnLineSpaceChange(
LineSpacing in_line_spacing) { … }
void UntrustedPageHandlerProxy::OnLetterSpaceChange(
LetterSpacing in_letter_spacing) { … }
void UntrustedPageHandlerProxy::OnFontChange(
const std::string& in_font) { … }
void UntrustedPageHandlerProxy::OnFontSizeChange(
double in_font_size) { … }
void UntrustedPageHandlerProxy::OnLinksEnabledChanged(
bool in_enabled) { … }
void UntrustedPageHandlerProxy::OnImagesEnabledChanged(
bool in_enabled) { … }
void UntrustedPageHandlerProxy::OnColorChange(
Colors in_color) { … }
void UntrustedPageHandlerProxy::OnSpeechRateChange(
double in_rate) { … }
void UntrustedPageHandlerProxy::OnVoiceChange(
const std::string& in_voice, const std::string& in_lang) { … }
void UntrustedPageHandlerProxy::OnLanguagePrefChange(
const std::string& in_lang, bool in_enabled) { … }
void UntrustedPageHandlerProxy::OnHighlightGranularityChanged(
HighlightGranularity in_granularity) { … }
void UntrustedPageHandlerProxy::OnLinkClicked(
const ::ui::AXTreeID& in_target_tree_id, int32_t in_target_node_id) { … }
void UntrustedPageHandlerProxy::OnImageDataRequested(
const ::ui::AXTreeID& in_target_tree_id, int32_t in_target_node_id) { … }
void UntrustedPageHandlerProxy::OnSelectionChange(
const ::ui::AXTreeID& in_target_tree_id, int32_t in_anchor_node_id, int32_t in_anchor_offset, int32_t in_focus_node_id, int32_t in_focus_offset) { … }
void UntrustedPageHandlerProxy::OnCollapseSelection(
) { … }
void UntrustedPageHandlerProxy::OnScreenshotRequested(
) { … }
void UntrustedPageHandlerProxy::ScrollToTargetNode(
const ::ui::AXTreeID& in_target_tree_id, int32_t in_target_node_id) { … }
class UntrustedPageHandler_GetVoicePackInfo_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool UntrustedPageHandler_GetVoicePackInfo_ForwardToCallback::Accept(
mojo::Message* message) { … }
void UntrustedPageHandler_GetVoicePackInfo_ProxyToResponder::Run(
VoicePackInfoPtr in_voice_pack_info) { … }
class UntrustedPageHandler_InstallVoicePack_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool UntrustedPageHandler_InstallVoicePack_ForwardToCallback::Accept(
mojo::Message* message) { … }
void UntrustedPageHandler_InstallVoicePack_ProxyToResponder::Run(
VoicePackInfoPtr in_voice_pack_info) { … }
bool UntrustedPageHandlerStubDispatch::Accept(
UntrustedPageHandler* impl,
mojo::Message* message) { … }
bool UntrustedPageHandlerStubDispatch::AcceptWithResponder(
UntrustedPageHandler* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kUntrustedPageHandlerValidationInfo[] = …;
bool UntrustedPageHandlerRequestValidator::Accept(mojo::Message* message) { … }
bool UntrustedPageHandlerResponseValidator::Accept(mojo::Message* message) { … }
const char UntrustedPage::Name_[] = …;
UntrustedPage::IPCStableHashFunction UntrustedPage::MessageToMethodInfo_(mojo::Message& message) { … }
const char* UntrustedPage::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t UntrustedPage::AccessibilityEventReceived_Sym::IPCStableHash() { … }
uint32_t UntrustedPage::OnActiveAXTreeIDChanged_Sym::IPCStableHash() { … }
uint32_t UntrustedPage::OnAXTreeDestroyed_Sym::IPCStableHash() { … }
uint32_t UntrustedPage::SetLanguageCode_Sym::IPCStableHash() { … }
uint32_t UntrustedPage::SetDefaultLanguageCode_Sym::IPCStableHash() { … }
uint32_t UntrustedPage::OnSettingsRestoredFromPrefs_Sym::IPCStableHash() { … }
uint32_t UntrustedPage::ScreenAIServiceReady_Sym::IPCStableHash() { … }
uint32_t UntrustedPage::OnImageDataDownloaded_Sym::IPCStableHash() { … }
# endif
UntrustedPageProxy::UntrustedPageProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void UntrustedPageProxy::AccessibilityEventReceived(
const ::ui::AXTreeID& in_tree_id, const std::vector<::ui::AXTreeUpdate>& in_updates, const std::vector<::ui::AXEvent>& in_events) { … }
void UntrustedPageProxy::OnActiveAXTreeIDChanged(
const ::ui::AXTreeID& in_tree_id, int64_t in_ukm_source_id, bool in_is_pdf) { … }
void UntrustedPageProxy::OnAXTreeDestroyed(
const ::ui::AXTreeID& in_tree_id) { … }
void UntrustedPageProxy::SetLanguageCode(
const std::string& in_code) { … }
void UntrustedPageProxy::SetDefaultLanguageCode(
const std::string& in_code) { … }
void UntrustedPageProxy::OnSettingsRestoredFromPrefs(
LineSpacing in_line_spacing, LetterSpacing in_letter_spacing, const std::string& in_font, double in_font_size, bool in_links_enabled, bool in_images_enabled, Colors in_color, double in_speech_rate, ::base::Value::Dict in_voices, ::base::Value::List in_languages_enabled_in_pref, HighlightGranularity in_granularity) { … }
void UntrustedPageProxy::ScreenAIServiceReady(
) { … }
void UntrustedPageProxy::OnImageDataDownloaded(
const ::ui::AXTreeID& in_tree_id, int32_t in_node_id, const ::SkBitmap& in_image) { … }
bool UntrustedPageStubDispatch::Accept(
UntrustedPage* impl,
mojo::Message* message) { … }
bool UntrustedPageStubDispatch::AcceptWithResponder(
UntrustedPage* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kUntrustedPageValidationInfo[] = …;
bool UntrustedPageRequestValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::read_anything::mojom::VoicePackInfo::DataView, ::read_anything::mojom::VoicePackInfoPtr>::Read(
::read_anything::mojom::VoicePackInfo::DataView input,
::read_anything::mojom::VoicePackInfoPtr* output) { … }
bool UnionTraits<::read_anything::mojom::VoicePackInstallationState::DataView, ::read_anything::mojom::VoicePackInstallationStatePtr>::Read(
::read_anything::mojom::VoicePackInstallationState::DataView input,
::read_anything::mojom::VoicePackInstallationStatePtr* output) { … }
}
namespace read_anything::mojom {
void UntrustedPageHandlerFactoryInterceptorForTesting::CreateUntrustedPageHandler(::mojo::PendingRemote<UntrustedPage> page, ::mojo::PendingReceiver<UntrustedPageHandler> handler) { … }
void UntrustedPageHandlerFactoryInterceptorForTesting::ShouldShowUI() { … }
UntrustedPageHandlerFactoryAsyncWaiter::UntrustedPageHandlerFactoryAsyncWaiter(
UntrustedPageHandlerFactory* proxy) : … { … }
UntrustedPageHandlerFactoryAsyncWaiter::~UntrustedPageHandlerFactoryAsyncWaiter() = default;
void UntrustedPageHandlerInterceptorForTesting::GetVoicePackInfo(const std::string& language, GetVoicePackInfoCallback callback) { … }
void UntrustedPageHandlerInterceptorForTesting::InstallVoicePack(const std::string& language, InstallVoicePackCallback callback) { … }
void UntrustedPageHandlerInterceptorForTesting::OnCopy() { … }
void UntrustedPageHandlerInterceptorForTesting::OnLineSpaceChange(LineSpacing line_spacing) { … }
void UntrustedPageHandlerInterceptorForTesting::OnLetterSpaceChange(LetterSpacing letter_spacing) { … }
void UntrustedPageHandlerInterceptorForTesting::OnFontChange(const std::string& font) { … }
void UntrustedPageHandlerInterceptorForTesting::OnFontSizeChange(double font_size) { … }
void UntrustedPageHandlerInterceptorForTesting::OnLinksEnabledChanged(bool enabled) { … }
void UntrustedPageHandlerInterceptorForTesting::OnImagesEnabledChanged(bool enabled) { … }
void UntrustedPageHandlerInterceptorForTesting::OnColorChange(Colors color) { … }
void UntrustedPageHandlerInterceptorForTesting::OnSpeechRateChange(double rate) { … }
void UntrustedPageHandlerInterceptorForTesting::OnVoiceChange(const std::string& voice, const std::string& lang) { … }
void UntrustedPageHandlerInterceptorForTesting::OnLanguagePrefChange(const std::string& lang, bool enabled) { … }
void UntrustedPageHandlerInterceptorForTesting::OnHighlightGranularityChanged(HighlightGranularity granularity) { … }
void UntrustedPageHandlerInterceptorForTesting::OnLinkClicked(const ::ui::AXTreeID& target_tree_id, int32_t target_node_id) { … }
void UntrustedPageHandlerInterceptorForTesting::OnImageDataRequested(const ::ui::AXTreeID& target_tree_id, int32_t target_node_id) { … }
void UntrustedPageHandlerInterceptorForTesting::OnSelectionChange(const ::ui::AXTreeID& target_tree_id, int32_t anchor_node_id, int32_t anchor_offset, int32_t focus_node_id, int32_t focus_offset) { … }
void UntrustedPageHandlerInterceptorForTesting::OnCollapseSelection() { … }
void UntrustedPageHandlerInterceptorForTesting::OnScreenshotRequested() { … }
void UntrustedPageHandlerInterceptorForTesting::ScrollToTargetNode(const ::ui::AXTreeID& target_tree_id, int32_t target_node_id) { … }
UntrustedPageHandlerAsyncWaiter::UntrustedPageHandlerAsyncWaiter(
UntrustedPageHandler* proxy) : … { … }
UntrustedPageHandlerAsyncWaiter::~UntrustedPageHandlerAsyncWaiter() = default;
void UntrustedPageHandlerAsyncWaiter::GetVoicePackInfo(
const std::string& language, VoicePackInfoPtr* out_voice_pack_info) { … }
VoicePackInfoPtr UntrustedPageHandlerAsyncWaiter::GetVoicePackInfo(
const std::string& language) { … }
void UntrustedPageHandlerAsyncWaiter::InstallVoicePack(
const std::string& language, VoicePackInfoPtr* out_voice_pack_info) { … }
VoicePackInfoPtr UntrustedPageHandlerAsyncWaiter::InstallVoicePack(
const std::string& language) { … }
void UntrustedPageInterceptorForTesting::AccessibilityEventReceived(const ::ui::AXTreeID& tree_id, const std::vector<::ui::AXTreeUpdate>& updates, const std::vector<::ui::AXEvent>& events) { … }
void UntrustedPageInterceptorForTesting::OnActiveAXTreeIDChanged(const ::ui::AXTreeID& tree_id, int64_t ukm_source_id, bool is_pdf) { … }
void UntrustedPageInterceptorForTesting::OnAXTreeDestroyed(const ::ui::AXTreeID& tree_id) { … }
void UntrustedPageInterceptorForTesting::SetLanguageCode(const std::string& code) { … }
void UntrustedPageInterceptorForTesting::SetDefaultLanguageCode(const std::string& code) { … }
void UntrustedPageInterceptorForTesting::OnSettingsRestoredFromPrefs(LineSpacing line_spacing, LetterSpacing letter_spacing, const std::string& font, double font_size, bool links_enabled, bool images_enabled, Colors color, double speech_rate, ::base::Value::Dict voices, ::base::Value::List languages_enabled_in_pref, HighlightGranularity granularity) { … }
void UntrustedPageInterceptorForTesting::ScreenAIServiceReady() { … }
void UntrustedPageInterceptorForTesting::OnImageDataDownloaded(const ::ui::AXTreeID& tree_id, int32_t node_id, const ::SkBitmap& image) { … }
UntrustedPageAsyncWaiter::UntrustedPageAsyncWaiter(
UntrustedPage* proxy) : … { … }
UntrustedPageAsyncWaiter::~UntrustedPageAsyncWaiter() = default;
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif