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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 // The link currently under the cursor. | 684 // The link currently under the cursor. |
685 std::string link_under_cursor_; | 685 std::string link_under_cursor_; |
686 | 686 |
687 // Pending progressive paints. | 687 // Pending progressive paints. |
688 struct ProgressivePaint { | 688 struct ProgressivePaint { |
689 pp::Rect rect; // In screen coordinates. | 689 pp::Rect rect; // In screen coordinates. |
690 FPDF_BITMAP bitmap; | 690 FPDF_BITMAP bitmap; |
691 int page_index; | 691 int page_index; |
692 // Temporary used to figure out if in a series of Paint() calls whether this | 692 // Temporary used to figure out if in a series of Paint() calls whether this |
693 // pending paint was updated or not. | 693 // pending paint was updated or not. |
694 int painted_; | 694 bool painted_; |
695 }; | 695 }; |
696 std::vector<ProgressivePaint> progressive_paints_; | 696 std::vector<ProgressivePaint> progressive_paints_; |
697 | 697 |
698 // Keeps track of when we started the last progressive paint, so that in our | 698 // Keeps track of when we started the last progressive paint, so that in our |
699 // callback we can determine if we need to pause. | 699 // callback we can determine if we need to pause. |
700 base::Time last_progressive_start_time_; | 700 base::Time last_progressive_start_time_; |
701 | 701 |
702 // The timeout to use for the current progressive paint. | 702 // The timeout to use for the current progressive paint. |
703 int progressive_paint_timeout_; | 703 int progressive_paint_timeout_; |
704 | 704 |
705 // Shadow matrix for generating the page shadow bitmap. | 705 // Shadow matrix for generating the page shadow bitmap. |
706 scoped_ptr<ShadowMatrix> page_shadow_; | 706 scoped_ptr<ShadowMatrix> page_shadow_; |
707 | 707 |
708 // Set to true if the user is being prompted for their password. Will be set | 708 // Set to true if the user is being prompted for their password. Will be set |
709 // to false after the user finishes getting their password. | 709 // to false after the user finishes getting their password. |
710 bool getting_password_; | 710 bool getting_password_; |
| 711 |
| 712 DISALLOW_COPY_AND_ASSIGN(PDFiumEngine); |
711 }; | 713 }; |
712 | 714 |
713 // Create a local variable of this when calling PDFium functions which can call | 715 // Create a local variable of this when calling PDFium functions which can call |
714 // our global callback when an unsupported feature is reached. | 716 // our global callback when an unsupported feature is reached. |
715 class ScopedUnsupportedFeature { | 717 class ScopedUnsupportedFeature { |
716 public: | 718 public: |
717 explicit ScopedUnsupportedFeature(PDFiumEngine* engine); | 719 explicit ScopedUnsupportedFeature(PDFiumEngine* engine); |
718 ~ScopedUnsupportedFeature(); | 720 ~ScopedUnsupportedFeature(); |
719 private: | 721 private: |
720 PDFiumEngine* engine_; | 722 PDFiumEngine* engine_; |
(...skipping 24 matching lines...) Expand all Loading... |
745 | 747 |
746 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 748 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
747 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 749 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
748 int pdf_buffer_size, int page_number, | 750 int pdf_buffer_size, int page_number, |
749 double* width, double* height); | 751 double* width, double* height); |
750 }; | 752 }; |
751 | 753 |
752 } // namespace chrome_pdf | 754 } // namespace chrome_pdf |
753 | 755 |
754 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ | 756 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ |
OLD | NEW |