mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Delete ax_platform_text_boundary as it is not required for Windows
This commit is contained in:
parent
b4a3dd5c60
commit
fa1a5c2f1f
@ -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",
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
@ -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 <oleacc.h>
|
||||
#include <uiautomation.h>
|
||||
|
||||
#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_
|
||||
Loading…
x
Reference in New Issue
Block a user