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

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

Issue 2398763002: Add font substitution metric for Linux (Closed)
Patch Set: Restore spacing Created 4 years, 2 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
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 // DocumentLoader::Client implementation. 114 // DocumentLoader::Client implementation.
115 pp::Instance* GetPluginInstance() override; 115 pp::Instance* GetPluginInstance() override;
116 pp::URLLoader CreateURLLoader() override; 116 pp::URLLoader CreateURLLoader() override;
117 void OnPartialDocumentLoaded() override; 117 void OnPartialDocumentLoaded() override;
118 void OnPendingRequestComplete() override; 118 void OnPendingRequestComplete() override;
119 void OnNewDataAvailable() override; 119 void OnNewDataAvailable() override;
120 void OnDocumentComplete() override; 120 void OnDocumentComplete() override;
121 121
122 void UnsupportedFeature(int type); 122 void UnsupportedFeature(int type);
123 void FontSubstituted();
123 124
124 std::string current_find_text() const { return current_find_text_; } 125 std::string current_find_text() const { return current_find_text_; }
125 126
126 FPDF_DOCUMENT doc() { return doc_; } 127 FPDF_DOCUMENT doc() { return doc_; }
127 FPDF_FORMHANDLE form() { return form_; } 128 FPDF_FORMHANDLE form() { return form_; }
128 129
129 private: 130 private:
130 // This helper class is used to detect the difference in selection between 131 // This helper class is used to detect the difference in selection between
131 // construction and destruction. At destruction, it invalidates all the 132 // construction and destruction. At destruction, it invalidates all the
132 // parts that are newly selected, along with all the parts that used to be 133 // parts that are newly selected, along with all the parts that used to be
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 // our global callback when an unsupported feature is reached. 738 // our global callback when an unsupported feature is reached.
738 class ScopedUnsupportedFeature { 739 class ScopedUnsupportedFeature {
739 public: 740 public:
740 explicit ScopedUnsupportedFeature(PDFiumEngine* engine); 741 explicit ScopedUnsupportedFeature(PDFiumEngine* engine);
741 ~ScopedUnsupportedFeature(); 742 ~ScopedUnsupportedFeature();
742 743
743 private: 744 private:
744 PDFiumEngine* const old_engine_; 745 PDFiumEngine* const old_engine_;
745 }; 746 };
746 747
748 // Create a local variable of this when calling PDFium functions which can call
749 // our global callback when a substitute font is mapped.
750 class ScopedSubstFont {
751 public:
752 explicit ScopedSubstFont(PDFiumEngine* engine);
753 ~ScopedSubstFont();
754
755 private:
756 PDFiumEngine* const old_engine_;
757 };
Lei Zhang 2016/10/12 18:56:38 Both of the scopers can use a DISALLOW_COPY_AND_AS
758
747 class PDFiumEngineExports : public PDFEngineExports { 759 class PDFiumEngineExports : public PDFEngineExports {
748 public: 760 public:
749 PDFiumEngineExports() {} 761 PDFiumEngineExports() {}
750 762
751 // PDFEngineExports: 763 // PDFEngineExports:
752 #if defined(OS_WIN) 764 #if defined(OS_WIN)
753 bool RenderPDFPageToDC(const void* pdf_buffer, 765 bool RenderPDFPageToDC(const void* pdf_buffer,
754 int buffer_size, 766 int buffer_size,
755 int page_number, 767 int page_number,
756 const RenderingSettings& settings, 768 const RenderingSettings& settings,
(...skipping 15 matching lines...) Expand all
772 bool GetPDFPageSizeByIndex(const void* pdf_buffer, 784 bool GetPDFPageSizeByIndex(const void* pdf_buffer,
773 int pdf_buffer_size, 785 int pdf_buffer_size,
774 int page_number, 786 int page_number,
775 double* width, 787 double* width,
776 double* height) override; 788 double* height) override;
777 }; 789 };
778 790
779 } // namespace chrome_pdf 791 } // namespace chrome_pdf
780 792
781 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ 793 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698