OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "pdf/pdfium/pdfium_page.h" | 5 #include "pdf/pdfium/pdfium_page.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 return area; | 276 return area; |
277 } else if (link) { | 277 } else if (link) { |
278 // We don't handle all possible link types of the PDF. For example, | 278 // We don't handle all possible link types of the PDF. For example, |
279 // launch actions, cross-document links, etc. | 279 // launch actions, cross-document links, etc. |
280 // See identical block above. | 280 // See identical block above. |
281 PDFiumPage::Area area = GetLinkTarget(link, target); | 281 PDFiumPage::Area area = GetLinkTarget(link, target); |
282 if (area != PDFiumPage::NONSELECTABLE_AREA) | 282 if (area != PDFiumPage::NONSELECTABLE_AREA) |
283 return area; | 283 return area; |
284 } else if (control > FPDF_FORMFIELD_UNKNOWN) { | 284 } else if (control > FPDF_FORMFIELD_UNKNOWN) { |
285 *form_type = control; | 285 *form_type = control; |
| 286 |
| 287 if (*form_type == FPDF_FORMFIELD_TEXTFIELD) { |
| 288 return PDFiumPage::FORM_TEXT_AREA; |
| 289 } |
286 return PDFiumPage::NONSELECTABLE_AREA; | 290 return PDFiumPage::NONSELECTABLE_AREA; |
287 } | 291 } |
288 | 292 |
289 if (rv < 0) | 293 if (rv < 0) |
290 return NONSELECTABLE_AREA; | 294 return NONSELECTABLE_AREA; |
291 | 295 |
292 return GetLink(*char_index, target) != -1 ? WEBLINK_AREA : TEXT_AREA; | 296 return GetLink(*char_index, target) != -1 ? WEBLINK_AREA : TEXT_AREA; |
293 } | 297 } |
294 | 298 |
295 base::char16 PDFiumPage::GetCharAtIndex(int index) { | 299 base::char16 PDFiumPage::GetCharAtIndex(int index) { |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 page_->loading_count_--; | 526 page_->loading_count_--; |
523 } | 527 } |
524 | 528 |
525 PDFiumPage::Link::Link() = default; | 529 PDFiumPage::Link::Link() = default; |
526 | 530 |
527 PDFiumPage::Link::Link(const Link& that) = default; | 531 PDFiumPage::Link::Link(const Link& that) = default; |
528 | 532 |
529 PDFiumPage::Link::~Link() = default; | 533 PDFiumPage::Link::~Link() = default; |
530 | 534 |
531 } // namespace chrome_pdf | 535 } // namespace chrome_pdf |
OLD | NEW |