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

Unified Diff: pdf/pdfium/pdfium_page.cc

Issue 969513002: PDF: Handle hit tests for form controls and links consistently. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « pdf/pdfium/pdfium_page.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_page.cc
diff --git a/pdf/pdfium/pdfium_page.cc b/pdf/pdfium/pdfium_page.cc
index 1335f0780cf211ceb08d4c237eab05c6ed2c2d79..e514af33d324fccb0ad61f3421cc8f2fdd751789 100644
--- a/pdf/pdfium/pdfium_page.cc
+++ b/pdf/pdfium/pdfium_page.cc
@@ -258,6 +258,7 @@ base::Value* PDFiumPage::CreateURLNode(std::string text, std::string url) {
PDFiumPage::Area PDFiumPage::GetCharIndex(const pp::Point& point,
int rotation,
int* char_index,
+ int* form_type,
LinkTarget* target) {
if (!available_)
return NONSELECTABLE_AREA;
@@ -270,6 +271,13 @@ PDFiumPage::Area PDFiumPage::GetCharIndex(const pp::Point& point,
GetTextPage(), new_x, new_y, kTolerance, kTolerance);
*char_index = rv;
+ int control =
+ FPDPage_HasFormFieldAtPoint(engine_->form(), GetPage(), new_x, new_y);
Lei Zhang 2015/02/28 01:16:14 FPDPage_HasFormFieldAtPoint() and FPDFLink_GetLink
+ if (control > FPDF_FORMFIELD_UNKNOWN) {
+ *form_type = control;
+ return PDFiumPage::NONSELECTABLE_AREA;
+ }
+
FPDF_LINK link = FPDFLink_GetLinkAtPoint(GetPage(), new_x, new_y);
if (link) {
// We don't handle all possible link types of the PDF. For example,
« no previous file with comments | « pdf/pdfium/pdfium_page.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698