[go: nahoru, domu]

Migrate PrivateAccessibilityTextRunInfo to PDF specific struct

Add AccessibilityTextRunInfo in pdf/ to replace usage of
PrivateAccessibilityTextRunInfo.

PrivateAccessibilityTextRunInfo is a Pepper struct. The new struct
ensures that PrivateAccessibilityTextRunInfo is scoped to parts
specific to Pepper implementation.

Bug: 1144444
Change-Id: Id3efb8ba95a25b3955213f9ddf2ed0f5d5d55232
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2560092
Auto-Submit: Ankit Kumar 🌪️ <ankk@microsoft.com>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: K. Moon <kmoon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833319}
diff --git a/pdf/pdfium/pdfium_page.h b/pdf/pdfium/pdfium_page.h
index 2564f8d2..bf24393 100644
--- a/pdf/pdfium/pdfium_page.h
+++ b/pdf/pdfium/pdfium_page.h
@@ -34,6 +34,8 @@
 
 class PDFiumEngine;
 class Thumbnail;
+struct AccessibilityTextRunInfo;
+struct AccessibilityTextStyleInfo;
 
 // Wrapper around a page from the document.
 class PDFiumPage {
@@ -55,8 +57,7 @@
   // Log overlaps between annotations in the page.
   void LogOverlappingAnnotations();
   // See definition of PDFEngine::GetTextRunInfo().
-  base::Optional<pp::PDF::PrivateAccessibilityTextRunInfo> GetTextRunInfo(
-      int start_char_index);
+  base::Optional<AccessibilityTextRunInfo> GetTextRunInfo(int start_char_index);
   // Get a unicode character from the page.
   uint32_t GetCharUnicode(int char_index);
   // Get the bounds of a character in page pixels.
@@ -348,14 +349,12 @@
   // broken for page objects such as links and images.
   void CalculatePageObjectTextRunBreaks();
   // Set text run style information based on a character of the text run.
-  void CalculateTextRunStyleInfo(
-      int char_index,
-      pp::PDF::PrivateAccessibilityTextStyleInfo* style_info);
+  void CalculateTextRunStyleInfo(int char_index,
+                                 AccessibilityTextStyleInfo& style_info);
   // Returns a boolean indicating if the character at index |char_index| has the
   // same text style as the text run.
-  bool AreTextStyleEqual(
-      int char_index,
-      const pp::PDF::PrivateAccessibilityTextStyleInfo& style);
+  bool AreTextStyleEqual(int char_index,
+                         const AccessibilityTextStyleInfo& style);
 
   // Key    :  Marked content id for the image element as specified in the
   //           struct tree.