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

Side by Side Diff: pdf/pdfium/pdfium_engine.h

Issue 2645813007: PDF: Fix a failing find-in-page corner case. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | pdf/pdfium/pdfium_engine.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef PDF_PDFIUM_PDFIUM_ENGINE_H_ 5 #ifndef PDF_PDFIUM_PDFIUM_ENGINE_H_
6 #define PDF_PDFIUM_PDFIUM_ENGINE_H_ 6 #define PDF_PDFIUM_PDFIUM_ENGINE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 void GetAllScreenRectsUnion(std::vector<PDFiumRange>* rect_range, 268 void GetAllScreenRectsUnion(std::vector<PDFiumRange>* rect_range,
269 const pp::Point& offset_point, 269 const pp::Point& offset_point,
270 std::vector<pp::Rect>* rect_vector); 270 std::vector<pp::Rect>* rect_vector);
271 271
272 void UpdateTickMarks(); 272 void UpdateTickMarks();
273 273
274 // Called to continue searching so we don't block the main thread. 274 // Called to continue searching so we don't block the main thread.
275 void ContinueFind(int32_t result); 275 void ContinueFind(int32_t result);
276 276
277 // Inserts a find result into find_results_, which is sorted. 277 // Inserts a find result into |find_results_|, which is sorted.
278 void AddFindResult(const PDFiumRange& result); 278 void AddFindResult(const PDFiumRange& result);
279 279
280 // Search a page using PDFium's methods. Doesn't work with unicode. This 280 // Search a page using PDFium's methods. Doesn't work with unicode. This
281 // function is just kept arount in case PDFium code is fixed. 281 // function is just kept arount in case PDFium code is fixed.
282 void SearchUsingPDFium(const base::string16& term, 282 void SearchUsingPDFium(const base::string16& term,
283 bool case_sensitive, 283 bool case_sensitive,
284 bool first_search, 284 bool first_search,
285 int character_to_start_searching_from, 285 int character_to_start_searching_from,
286 int current_page); 286 int current_page);
287 287
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 637
638 // Used for selection. There could be more than one range if selection spans 638 // Used for selection. There could be more than one range if selection spans
639 // more than one page. 639 // more than one page.
640 std::vector<PDFiumRange> selection_; 640 std::vector<PDFiumRange> selection_;
641 // True if we're in the middle of selection. 641 // True if we're in the middle of selection.
642 bool selecting_; 642 bool selecting_;
643 643
644 MouseDownState mouse_down_state_; 644 MouseDownState mouse_down_state_;
645 645
646 // Used for searching. 646 // Used for searching.
647 typedef std::vector<PDFiumRange> FindResults; 647 std::vector<PDFiumRange> find_results_;
648 FindResults find_results_;
649 // Which page to search next. 648 // Which page to search next.
650 int next_page_to_search_; 649 int next_page_to_search_;
651 // Where to stop searching. 650 // Where to stop searching.
652 int last_page_to_search_; 651 int last_page_to_search_;
653 int last_character_index_to_search_; // -1 if search until end of page. 652 int last_character_index_to_search_; // -1 if search until end of page.
654 // Which result the user has currently selected. 653 // Which result the user has currently selected.
655 FindTextIndex current_find_index_; 654 FindTextIndex current_find_index_;
656 // Where to resume searching. 655 // Where to resume searching.
657 FindTextIndex resume_find_index_; 656 FindTextIndex resume_find_index_;
658 657
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 bool GetPDFPageSizeByIndex(const void* pdf_buffer, 789 bool GetPDFPageSizeByIndex(const void* pdf_buffer,
791 int pdf_buffer_size, 790 int pdf_buffer_size,
792 int page_number, 791 int page_number,
793 double* width, 792 double* width,
794 double* height) override; 793 double* height) override;
795 }; 794 };
796 795
797 } // namespace chrome_pdf 796 } // namespace chrome_pdf
798 797
799 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ 798 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_
OLDNEW
« no previous file with comments | « no previous file | pdf/pdfium/pdfium_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698