Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(996)

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 1953053002: Add private PPAPI interfaces for PDFium accessibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor based on feedback from Raymes Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 5ee7e623ac43e20b3098cb3097ff2bec45443f99..38cd58d34032f929780695141518597461e9ef5b 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -2270,6 +2270,10 @@ pp::Rect PDFiumEngine::GetPageRect(int index) {
return rc;
}
+pp::Rect PDFiumEngine::GetPageBoundsRect(int index) {
+ return pages_[index]->rect();
+}
+
pp::Rect PDFiumEngine::GetPageContentsRect(int index) {
return GetScreenRect(pages_[index]->rect());
}
@@ -2303,6 +2307,31 @@ std::string PDFiumEngine::GetPageAsJSON(int index) {
return page_json;
}
+int PDFiumEngine::GetCharCount(int page_index) {
+ CHECK(page_index >= 0 && page_index < static_cast<int>(pages_.size()));
raymes 2016/05/30 04:17:37 nit: DCHECK?
dmazzoni 2016/05/31 21:45:01 Done.
+ return pages_[page_index]->GetCharCount();
+}
+
+double PDFiumEngine::GetCharWidth(int page_index, int char_index) {
+ CHECK(page_index >= 0 && page_index < static_cast<int>(pages_.size()));
+ return pages_[page_index]->GetCharWidth(char_index);
+}
+
+uint32_t PDFiumEngine::GetCharUnicode(int page_index, int char_index) {
+ CHECK(page_index >= 0 && page_index < static_cast<int>(pages_.size()));
+ return pages_[page_index]->GetCharUnicode(char_index);
+}
+
+void PDFiumEngine::GetTextRunInfo(int page_index,
+ int start_char_index,
+ uint32_t* out_len,
+ double* out_font_size,
+ pp::FloatRect* out_bounds) {
+ CHECK(page_index >= 0 && page_index < static_cast<int>(pages_.size()));
+ return pages_[page_index]->GetTextRunInfo(
+ start_char_index, out_len, out_font_size, out_bounds);
+}
+
bool PDFiumEngine::GetPrintScaling() {
return !!FPDF_VIEWERREF_GetPrintScaling(doc_);
}

Powered by Google App Engine
This is Rietveld 408576698