| 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 #include "pdf/pdfium/pdfium_engine.h" | 5 #include "pdf/pdfium/pdfium_engine.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 IPDF_JSPLATFORM::Doc_print = Form_Print; | 601 IPDF_JSPLATFORM::Doc_print = Form_Print; |
| 602 IPDF_JSPLATFORM::Doc_submitForm = Form_SubmitForm; | 602 IPDF_JSPLATFORM::Doc_submitForm = Form_SubmitForm; |
| 603 IPDF_JSPLATFORM::Doc_gotoPage = Form_GotoPage; | 603 IPDF_JSPLATFORM::Doc_gotoPage = Form_GotoPage; |
| 604 IPDF_JSPLATFORM::Field_browse = Form_Browse; | 604 IPDF_JSPLATFORM::Field_browse = Form_Browse; |
| 605 | 605 |
| 606 IFSDK_PAUSE::version = 1; | 606 IFSDK_PAUSE::version = 1; |
| 607 IFSDK_PAUSE::user = NULL; | 607 IFSDK_PAUSE::user = NULL; |
| 608 IFSDK_PAUSE::NeedToPauseNow = Pause_NeedToPauseNow; | 608 IFSDK_PAUSE::NeedToPauseNow = Pause_NeedToPauseNow; |
| 609 | 609 |
| 610 #if defined(OS_LINUX) | 610 #if defined(OS_LINUX) |
| 611 g_last_instance_id = client_->GetPluginInstance()->pp_instance(); | 611 // PreviewModeClient does not know its pp::Instance. |
| 612 pp::Instance* instance = client_->GetPluginInstance(); |
| 613 if (instance) |
| 614 g_last_instance_id = instance->pp_instance(); |
| 612 #endif | 615 #endif |
| 613 } | 616 } |
| 614 | 617 |
| 615 PDFiumEngine::~PDFiumEngine() { | 618 PDFiumEngine::~PDFiumEngine() { |
| 616 for (auto& page : pages_) | 619 for (auto& page : pages_) |
| 617 page->Unload(); | 620 page->Unload(); |
| 618 | 621 |
| 619 if (doc_) { | 622 if (doc_) { |
| 620 FORM_DoDocumentAAction(form_, FPDFDOC_AACTION_WC); | 623 FORM_DoDocumentAAction(form_, FPDFDOC_AACTION_WC); |
| 621 | 624 |
| (...skipping 3326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3948 double* height) { | 3951 double* height) { |
| 3949 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); | 3952 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); |
| 3950 if (!doc) | 3953 if (!doc) |
| 3951 return false; | 3954 return false; |
| 3952 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 3955 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
| 3953 FPDF_CloseDocument(doc); | 3956 FPDF_CloseDocument(doc); |
| 3954 return success; | 3957 return success; |
| 3955 } | 3958 } |
| 3956 | 3959 |
| 3957 } // namespace chrome_pdf | 3960 } // namespace chrome_pdf |
| OLD | NEW |