Index: pdf/pdfium/pdfium_engine.cc |
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc |
index de50c79ff5185b3015857693e3b2698f657eea48..b87ab7d7c49ce45faacb5fae25f77924dd8a347f 100644 |
--- a/pdf/pdfium/pdfium_engine.cc |
+++ b/pdf/pdfium/pdfium_engine.cc |
@@ -1188,6 +1188,29 @@ void PDFiumEngine::OnDocumentComplete() { |
FinishLoadingDocument(); |
} |
+unsigned long PDFiumEngine::GetNameDestCount() { |
+ return FPDF_CountNamedDests(doc_); |
+} |
+ |
+void PDFiumEngine::GetNameDests(std::vector<std::string>* name_dest) { |
+ unsigned long count = GetNameDestCount(); |
+ for (unsigned long i = 0; i < count; i++) { |
+ wchar_t* name = NULL; |
+ unsigned long len = 0; |
+ FPDF_DEST dest = NULL; |
+ dest = FPDF_GetNamedDest(doc_, i, name, len); |
+ if (dest) { |
+ name = new wchar_t[len]; |
+ FPDF_DEST dest = FPDF_GetNamedDest(doc_, i, name, len); |
+ if (dest) { |
+ name_dest->push_back( |
+ base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(name))); |
+ } |
+ delete[] name; |
+ } |
+ } |
+} |
+ |
void PDFiumEngine::FinishLoadingDocument() { |
DCHECK(doc_loader_.IsDocumentComplete() && doc_); |
if (called_do_document_action_) |