Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 446 void RotateInternal(); | 446 void RotateInternal(); |
| 447 | 447 |
| 448 // Sets text selection status of document. This does not include text | 448 // Sets text selection status of document. This does not include text |
| 449 // within form text fields. | 449 // within form text fields. |
| 450 void SetSelecting(bool selecting); | 450 void SetSelecting(bool selecting); |
| 451 | 451 |
| 452 // Sets whether or not focus is in form text field or form combobox text | 452 // Sets whether or not focus is in form text field or form combobox text |
| 453 // field. | 453 // field. |
| 454 void SetInFormTextArea(bool in_form_text_area); | 454 void SetInFormTextArea(bool in_form_text_area); |
| 455 | 455 |
| 456 // Sets whether or not left mouse button is currently being held down. | |
| 457 void SetMouseLeftButtonDown(bool is_mouse_left_button_down); | |
| 458 | |
| 456 bool PageIndexInBounds(int index) const; | 459 bool PageIndexInBounds(int index) const; |
| 457 | 460 |
| 458 void ScheduleTouchTimer(const pp::TouchInputEvent& event); | 461 void ScheduleTouchTimer(const pp::TouchInputEvent& event); |
| 459 void KillTouchTimer(int timer_id); | 462 void KillTouchTimer(int timer_id); |
| 460 void HandleLongPress(const pp::TouchInputEvent& event); | 463 void HandleLongPress(const pp::TouchInputEvent& event); |
| 461 | 464 |
| 462 // FPDF_FORMFILLINFO callbacks. | 465 // FPDF_FORMFILLINFO callbacks. |
| 463 static void Form_Invalidate(FPDF_FORMFILLINFO* param, | 466 static void Form_Invalidate(FPDF_FORMFILLINFO* param, |
| 464 FPDF_PAGE page, | 467 FPDF_PAGE page, |
| 465 double left, | 468 double left, |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 646 | 649 |
| 647 // The indexes of the pages pending download. | 650 // The indexes of the pages pending download. |
| 648 std::vector<int> pending_pages_; | 651 std::vector<int> pending_pages_; |
| 649 | 652 |
| 650 // During handling of input events we don't want to unload any pages in | 653 // During handling of input events we don't want to unload any pages in |
| 651 // callbacks to us from PDFium, since the current page can change while PDFium | 654 // callbacks to us from PDFium, since the current page can change while PDFium |
| 652 // code still has a pointer to it. | 655 // code still has a pointer to it. |
| 653 bool defer_page_unload_; | 656 bool defer_page_unload_; |
| 654 std::vector<int> deferred_page_unloads_; | 657 std::vector<int> deferred_page_unloads_; |
| 655 | 658 |
| 656 // Used for text selection, but does not include text within form text fields. | 659 // Used for text selection, but does not include text within form text areas. |
| 657 // There could be more than one range if selection spans more than one page. | 660 // There could be more than one range if selection spans more than one page. |
| 658 std::vector<PDFiumRange> selection_; | 661 std::vector<PDFiumRange> selection_; |
| 659 // True if we're in the middle of text selection. | 662 // True if we're in the middle of text selection. |
| 660 bool selecting_; | 663 bool selecting_; |
| 661 | 664 |
| 665 MouseDownState mouse_down_state_; | |
| 666 | |
| 667 // Text selection within form text fields and form combobox text fields. | |
| 668 std::string selected_form_text_; | |
| 669 | |
| 662 // True if focus is in form text field or form combobox text field. | 670 // True if focus is in form text field or form combobox text field. |
| 663 bool in_form_text_area_; | 671 bool in_form_text_area_; |
| 664 | 672 |
| 665 MouseDownState mouse_down_state_; | 673 // True if left mouse button is currently being held down. |
| 674 bool mouse_left_button_down_; | |
|
Lei Zhang
2017/07/05 22:02:21
We need to initialize this. We also forgot to init
drgage
2017/07/06 19:13:55
Done.
| |
| 666 | 675 |
| 667 // Used for searching. | 676 // Used for searching. |
| 668 std::vector<PDFiumRange> find_results_; | 677 std::vector<PDFiumRange> find_results_; |
| 669 // Which page to search next. | 678 // Which page to search next. |
| 670 int next_page_to_search_; | 679 int next_page_to_search_; |
| 671 // Where to stop searching. | 680 // Where to stop searching. |
| 672 int last_page_to_search_; | 681 int last_page_to_search_; |
| 673 int last_character_index_to_search_; // -1 if search until end of page. | 682 int last_character_index_to_search_; // -1 if search until end of page. |
| 674 // Which result the user has currently selected. | 683 // Which result the user has currently selected. |
| 675 FindTextIndex current_find_index_; | 684 FindTextIndex current_find_index_; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 814 bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 823 bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
| 815 int pdf_buffer_size, | 824 int pdf_buffer_size, |
| 816 int page_number, | 825 int page_number, |
| 817 double* width, | 826 double* width, |
| 818 double* height) override; | 827 double* height) override; |
| 819 }; | 828 }; |
| 820 | 829 |
| 821 } // namespace chrome_pdf | 830 } // namespace chrome_pdf |
| 822 | 831 |
| 823 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ | 832 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ |
| OLD | NEW |