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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 IPDF_JSPLATFORM::Doc_getFilePath = Form_GetFilePath; | 599 IPDF_JSPLATFORM::Doc_getFilePath = Form_GetFilePath; |
600 IPDF_JSPLATFORM::Doc_mail = Form_Mail; | 600 IPDF_JSPLATFORM::Doc_mail = Form_Mail; |
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 |
| 610 #if defined(OS_LINUX) |
| 611 g_last_instance_id = client_->GetPluginInstance()->pp_instance(); |
| 612 #endif |
609 } | 613 } |
610 | 614 |
611 PDFiumEngine::~PDFiumEngine() { | 615 PDFiumEngine::~PDFiumEngine() { |
612 for (auto& page : pages_) | 616 for (auto& page : pages_) |
613 page->Unload(); | 617 page->Unload(); |
614 | 618 |
615 if (doc_) { | 619 if (doc_) { |
616 FORM_DoDocumentAAction(form_, FPDFDOC_AACTION_WC); | 620 FORM_DoDocumentAAction(form_, FPDFDOC_AACTION_WC); |
617 | 621 |
618 #ifdef PDF_USE_XFA | 622 #ifdef PDF_USE_XFA |
(...skipping 3325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3944 double* height) { | 3948 double* height) { |
3945 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); | 3949 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); |
3946 if (!doc) | 3950 if (!doc) |
3947 return false; | 3951 return false; |
3948 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 3952 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
3949 FPDF_CloseDocument(doc); | 3953 FPDF_CloseDocument(doc); |
3950 return success; | 3954 return success; |
3951 } | 3955 } |
3952 | 3956 |
3953 } // namespace chrome_pdf | 3957 } // namespace chrome_pdf |
OLD | NEW |