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 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 } | 993 } |
994 | 994 |
995 pp::Instance* PDFiumEngine::GetPluginInstance() { | 995 pp::Instance* PDFiumEngine::GetPluginInstance() { |
996 return client_->GetPluginInstance(); | 996 return client_->GetPluginInstance(); |
997 } | 997 } |
998 | 998 |
999 pp::URLLoader PDFiumEngine::CreateURLLoader() { | 999 pp::URLLoader PDFiumEngine::CreateURLLoader() { |
1000 return client_->CreateURLLoader(); | 1000 return client_->CreateURLLoader(); |
1001 } | 1001 } |
1002 | 1002 |
| 1003 void PDFiumEngine::OnGotActualURL(const std::string& url) { |
| 1004 client_->OnGotActualURL(url); |
| 1005 } |
| 1006 |
1003 void PDFiumEngine::AppendPage(PDFEngine* engine, int index) { | 1007 void PDFiumEngine::AppendPage(PDFEngine* engine, int index) { |
1004 // Unload and delete the blank page before appending. | 1008 // Unload and delete the blank page before appending. |
1005 pages_[index]->Unload(); | 1009 pages_[index]->Unload(); |
1006 pages_[index]->set_calculated_links(false); | 1010 pages_[index]->set_calculated_links(false); |
1007 pp::Size curr_page_size = GetPageSize(index); | 1011 pp::Size curr_page_size = GetPageSize(index); |
1008 FPDFPage_Delete(doc_, index); | 1012 FPDFPage_Delete(doc_, index); |
1009 FPDF_ImportPages(doc_, | 1013 FPDF_ImportPages(doc_, |
1010 static_cast<PDFiumEngine*>(engine)->doc(), | 1014 static_cast<PDFiumEngine*>(engine)->doc(), |
1011 "1", | 1015 "1", |
1012 index); | 1016 index); |
(...skipping 2962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3975 FPDF_DOCUMENT doc = | 3979 FPDF_DOCUMENT doc = |
3976 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); | 3980 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); |
3977 if (!doc) | 3981 if (!doc) |
3978 return false; | 3982 return false; |
3979 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 3983 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
3980 FPDF_CloseDocument(doc); | 3984 FPDF_CloseDocument(doc); |
3981 return success; | 3985 return success; |
3982 } | 3986 } |
3983 | 3987 |
3984 } // namespace chrome_pdf | 3988 } // namespace chrome_pdf |
OLD | NEW |