#include "chrome/renderer/accessibility/read_aloud_traversal_utils.h"
#include "ui/accessibility/ax_text_utils.h"
namespace a11y {
ReadAloudCurrentGranularity::ReadAloudCurrentGranularity() = default;
ReadAloudCurrentGranularity::ReadAloudCurrentGranularity(
const ReadAloudCurrentGranularity& other) = default;
ReadAloudCurrentGranularity::~ReadAloudCurrentGranularity() = default;
void ReadAloudCurrentGranularity::AddText(ui::AXNodeID id,
int text_start,
int text_end,
const std::u16string& text_to_add) { … }
std::vector<ReadAloudTextSegment>
ReadAloudCurrentGranularity::GetSegmentsForRange(int start_index,
int end_index) { … }
}
namespace {
int GetNextGranularity(const std::u16string& text,
ax::mojom::TextBoundary boundary) { … }
}
int GetNextSentence(const std::u16string& text, bool is_pdf) { … }
int GetNextWord(const std::u16string& text) { … }
bool ArePositionsEqual(const ui::AXNodePosition::AXPositionInstance& position,
const ui::AXNodePosition::AXPositionInstance& other) { … }
ui::AXNode* GetAnchorNode(
const ui::AXNodePosition::AXPositionInstance& position) { … }
ui::AXNode* GetNextNodeFromPosition(
const ui::AXNodePosition::AXPositionInstance& ax_position) { … }
bool IsOpeningPunctuation(char& c) { … }
bool ShouldSplitAtParagraph(
const ui::AXNodePosition::AXPositionInstance& position,
const a11y::ReadAloudCurrentGranularity current_granularity) { … }