From fa1a5c2f1fbcfe08d34dbc7b36e3c6df446c5152 Mon Sep 17 00:00:00 2001 From: George Wright Date: Mon, 1 Feb 2021 10:30:38 -0800 Subject: [PATCH] Delete ax_platform_text_boundary as it is not required for Windows --- .../third_party/accessibility/ax/BUILD.gn | 2 - .../ax/platform/ax_platform_node_base.h | 1 - .../ax/platform/ax_platform_text_boundary.cc | 52 ------------------- .../ax/platform/ax_platform_text_boundary.h | 32 ------------ 4 files changed, 87 deletions(-) delete mode 100644 engine/src/flutter/third_party/accessibility/ax/platform/ax_platform_text_boundary.cc delete mode 100644 engine/src/flutter/third_party/accessibility/ax/platform/ax_platform_text_boundary.h diff --git a/engine/src/flutter/third_party/accessibility/ax/BUILD.gn b/engine/src/flutter/third_party/accessibility/ax/BUILD.gn index e3f07613948..bc85cbbc370 100644 --- a/engine/src/flutter/third_party/accessibility/ax/BUILD.gn +++ b/engine/src/flutter/third_party/accessibility/ax/BUILD.gn @@ -16,8 +16,6 @@ source_set("ax") { "platform/ax_platform_node_delegate.h", "platform/ax_platform_node_delegate_base.cc", "platform/ax_platform_node_delegate_base.h", - "platform/ax_platform_text_boundary.cc", - "platform/ax_platform_text_boundary.h", "platform/ax_unique_id.cc", "platform/ax_unique_id.h", "platform/compute_attributes.cc", diff --git a/engine/src/flutter/third_party/accessibility/ax/platform/ax_platform_node_base.h b/engine/src/flutter/third_party/accessibility/ax/platform/ax_platform_node_base.h index a76af955bf1..f19c6215411 100644 --- a/engine/src/flutter/third_party/accessibility/ax/platform/ax_platform_node_base.h +++ b/engine/src/flutter/third_party/accessibility/ax/platform/ax_platform_node_base.h @@ -14,7 +14,6 @@ #include "ax_build/build_config.h" #include "ax_platform_node.h" #include "ax_platform_node_delegate.h" -#include "ax_platform_text_boundary.h" #include "base/macros.h" #include "gfx/geometry/point.h" #include "gfx/native_widget_types.h" diff --git a/engine/src/flutter/third_party/accessibility/ax/platform/ax_platform_text_boundary.cc b/engine/src/flutter/third_party/accessibility/ax/platform/ax_platform_text_boundary.cc deleted file mode 100644 index bd5dc764235..00000000000 --- a/engine/src/flutter/third_party/accessibility/ax/platform/ax_platform_text_boundary.cc +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ax_platform_text_boundary.h" - -#include "ax/ax_enums.h" - -namespace ui { - -#ifdef OS_WIN -ax::mojom::TextBoundary FromIA2TextBoundary(IA2TextBoundaryType boundary) { - switch (boundary) { - case IA2_TEXT_BOUNDARY_CHAR: - return ax::mojom::TextBoundary::kCharacter; - case IA2_TEXT_BOUNDARY_WORD: - return ax::mojom::TextBoundary::kWordStart; - case IA2_TEXT_BOUNDARY_LINE: - return ax::mojom::TextBoundary::kLineStart; - case IA2_TEXT_BOUNDARY_SENTENCE: - return ax::mojom::TextBoundary::kSentenceStart; - case IA2_TEXT_BOUNDARY_PARAGRAPH: - return ax::mojom::TextBoundary::kParagraphStart; - case IA2_TEXT_BOUNDARY_ALL: - return ax::mojom::TextBoundary::kObject; - } -} - -ax::mojom::TextBoundary FromUIATextUnit(TextUnit unit) { - // These are listed in order of their definition in the Microsoft - // documentation. - switch (unit) { - case TextUnit_Character: - return ax::mojom::TextBoundary::kCharacter; - case TextUnit_Format: - return ax::mojom::TextBoundary::kFormat; - case TextUnit_Word: - return ax::mojom::TextBoundary::kWordStart; - case TextUnit_Line: - return ax::mojom::TextBoundary::kLineStart; - case TextUnit_Paragraph: - return ax::mojom::TextBoundary::kParagraphStart; - case TextUnit_Page: - // UI Automation's TextUnit_Page cannot be reliably supported in a Web - // document. We return kWebPage which is the next best thing. - case TextUnit_Document: - return ax::mojom::TextBoundary::kWebPage; - } -} -#endif // OS_WIN - -} // namespace ui diff --git a/engine/src/flutter/third_party/accessibility/ax/platform/ax_platform_text_boundary.h b/engine/src/flutter/third_party/accessibility/ax/platform/ax_platform_text_boundary.h deleted file mode 100644 index ac30dc99081..00000000000 --- a/engine/src/flutter/third_party/accessibility/ax/platform/ax_platform_text_boundary.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_TEXT_BOUNDARY_H_ -#define UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_TEXT_BOUNDARY_H_ - -#include "ax/ax_enums.h" -#include "ax/ax_export.h" -#include "ax_build/build_config.h" - -#ifdef OS_WIN -#include -#include - -#include "third_party/iaccessible2/ia2_api_all.h" -#endif // OS_WIN - -namespace ui { - -#ifdef OS_WIN -// Converts from an IAccessible2 text boundary to an ax::mojom::TextBoundary. -AX_EXPORT ax::mojom::TextBoundary FromIA2TextBoundary( - IA2TextBoundaryType boundary); - -// Converts from a UI Automation text unit to an ax::mojom::TextBoundary. -AX_EXPORT ax::mojom::TextBoundary FromUIATextUnit(TextUnit unit); -#endif // OS_WIN - -} // namespace ui - -#endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_TEXT_BOUNDARY_H_