#include "extensions/renderer/api/automation/automation_internal_custom_bindings.h"
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <memory>
#include <set>
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/task/single_thread_task_runner.h"
#include "base/values.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/worker_thread.h"
#include "extensions/common/api/automation.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_handlers/automation.h"
#include "extensions/common/manifest_handlers/background_info.h"
#include "extensions/common/mojom/event_dispatcher.mojom.h"
#include "extensions/renderer/api/automation/automation_api_converters.h"
#include "extensions/renderer/ipc_message_sender.h"
#include "extensions/renderer/native_extension_bindings_system.h"
#include "extensions/renderer/object_backed_native_handler.h"
#include "extensions/renderer/script_context.h"
#include "ipc/message_filter.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "ui/accessibility/ax_event.h"
#include "ui/accessibility/ax_event_generator.h"
#include "ui/accessibility/platform/automation/automation_api_util.h"
#include "ui/accessibility/platform/automation/automation_ax_tree_wrapper.h"
#include "ui/accessibility/platform/automation/automation_tree_manager_owner.h"
#include "ui/accessibility/platform/automation/automation_v8_bindings.h"
#include "ui/accessibility/platform/automation/automation_v8_router.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/strings/grit/auto_image_annotation_strings.h"
namespace extensions {
AutomationInternalCustomBindings::AutomationInternalCustomBindings(
ScriptContext* context,
NativeExtensionBindingsSystem* bindings_system)
: … { … }
AutomationInternalCustomBindings::~AutomationInternalCustomBindings() = default;
void AutomationInternalCustomBindings::AddRoutes() { … }
void AutomationInternalCustomBindings::Invalidate() { … }
ui::AutomationV8Bindings*
AutomationInternalCustomBindings::GetAutomationV8Bindings() const { … }
void AutomationInternalCustomBindings::IsInteractPermitted(
const v8::FunctionCallbackInfo<v8::Value>& args) const { … }
void AutomationInternalCustomBindings::StartCachingAccessibilityTrees() { … }
void AutomationInternalCustomBindings::StopCachingAccessibilityTrees() { … }
void AutomationInternalCustomBindings::ThrowInvalidArgumentsException(
bool is_fatal) const { … }
v8::Isolate* AutomationInternalCustomBindings::GetIsolate() const { … }
v8::Local<v8::Context> AutomationInternalCustomBindings::GetContext() const { … }
void AutomationInternalCustomBindings::RouteHandlerFunction(
const std::string& name,
scoped_refptr<ui::V8HandlerFunctionWrapper> handler_function_wrapper) { … }
ui::TreeChangeObserverFilter
AutomationInternalCustomBindings::ParseTreeChangeObserverFilter(
const std::string& filter) const { … }
std::string AutomationInternalCustomBindings::GetMarkerTypeString(
ax::mojom::MarkerType type) const { … }
std::string AutomationInternalCustomBindings::GetFocusedStateString() const { … }
std::string AutomationInternalCustomBindings::GetOffscreenStateString() const { … }
void AutomationInternalCustomBindings::DispatchEvent(
const std::string& event_name,
const base::Value::List& event_args) const { … }
std::string
AutomationInternalCustomBindings::GetLocalizedStringForImageAnnotationStatus(
ax::mojom::ImageAnnotationStatus status) const { … }
std::string AutomationInternalCustomBindings::GetTreeChangeTypeString(
ax::mojom::Mutation change_type) const { … }
std::string AutomationInternalCustomBindings::GetEventTypeString(
const std::tuple<ax::mojom::Event, ui::AXEventGenerator::Event>& event_type)
const { … }
void AutomationInternalCustomBindings::NotifyTreeEventListenersChanged() { … }
}