Index: pdf/pdfium/pdfium_page.cc |
diff --git a/pdf/pdfium/pdfium_page.cc b/pdf/pdfium/pdfium_page.cc |
index 01a5fb6ad1a3ff5f54749d6beb49ad30940c5aa1..48d0f5c9fa3e26bbf58f729fa0211a73685c233b 100644 |
--- a/pdf/pdfium/pdfium_page.cc |
+++ b/pdf/pdfium/pdfium_page.cc |
@@ -336,8 +336,9 @@ PDFiumPage::Area PDFiumPage::GetLinkTarget(FPDF_LINK link, |
} |
case PDFACTION_URI: |
return GetURITarget(action, target); |
- // TODO(thestig): Support remaining types for https://crbug.com/55776 |
case PDFACTION_LAUNCH: |
+ return GetLaunchTarget(action, target); |
+ // TODO(thestig): Support remaining types for https://crbug.com/55776 |
case PDFACTION_REMOTEGOTO: |
default: |
return NONSELECTABLE_AREA; |
@@ -368,6 +369,22 @@ PDFiumPage::Area PDFiumPage::GetURITarget(FPDF_ACTION uri_action, |
return WEBLINK_AREA; |
} |
+PDFiumPage::Area PDFiumPage::GetLaunchTarget(FPDF_ACTION launch_action, |
+ LinkTarget* target) const { |
+ if (target) { |
+ size_t buffer_size = FPDFAction_GetFilePath(launch_action, nullptr, 0); |
+ if (buffer_size > 0) { |
+ PDFiumAPIStringBufferAdapter<std::string> api_string_adapter( |
+ &target->url, buffer_size, true); |
+ void* data = api_string_adapter.GetData(); |
+ size_t bytes_written = |
+ FPDFAction_GetFilePath(launch_action, data, buffer_size); |
+ api_string_adapter.Close(bytes_written); |
+ } |
+ } |
+ return WEBLINK_AREA; |
+} |
+ |
int PDFiumPage::GetLink(int char_index, LinkTarget* target) { |
if (!available_) |
return -1; |