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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 2267063002: PDF: Put back removed SetScrollPosition(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 8d958751c0d17559a7b22b6bb4621e6acd189743..ca0fd31fcb99dba61d9b42d24578b1414d42ab42 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -587,7 +587,7 @@ PDFiumEngine::PDFiumEngine(PDFEngine::Client* client)
FPDF_FORMFILLINFO::FFI_SetTextFieldFocus = Form_SetTextFieldFocus;
FPDF_FORMFILLINFO::FFI_DoURIAction = Form_DoURIAction;
FPDF_FORMFILLINFO::FFI_DoGoToAction = Form_DoGoToAction;
-#ifdef PDF_USE_XFA
+#if defined(PDF_USE_XFA)
FPDF_FORMFILLINFO::version = 2;
FPDF_FORMFILLINFO::FFI_EmailTo = Form_EmailTo;
FPDF_FORMFILLINFO::FFI_DisplayCaret = Form_DisplayCaret;
@@ -604,7 +604,7 @@ PDFiumEngine::PDFiumEngine(PDFEngine::Client* client)
FPDF_FORMFILLINFO::FFI_OpenFile = Form_OpenFile;
FPDF_FORMFILLINFO::FFI_GotoURL = Form_GotoURL;
FPDF_FORMFILLINFO::FFI_GetLanguage = Form_GetLanguage;
-#endif // PDF_USE_XFA
+#endif // defined(PDF_USE_XFA)
IPDF_JSPLATFORM::version = 3;
IPDF_JSPLATFORM::app_alert = Form_Alert;
IPDF_JSPLATFORM::app_beep = Form_Beep;
@@ -635,7 +635,7 @@ PDFiumEngine::~PDFiumEngine() {
if (doc_) {
FORM_DoDocumentAAction(form_, FPDFDOC_AACTION_WC);
-#ifdef PDF_USE_XFA
+#if defined(PDF_USE_XFA)
// XFA may require |form_| to outlive |doc_|, so shut down in that order.
FPDF_CloseDocument(doc_);
FPDFDOC_ExitFormFillEnvironment(form_);
@@ -650,7 +650,7 @@ PDFiumEngine::~PDFiumEngine() {
base::STLDeleteElements(&pages_);
}
-#ifdef PDF_USE_XFA
+#if defined(PDF_USE_XFA)
void PDFiumEngine::Form_EmailTo(FPDF_FORMFILLINFO* param,
FPDF_FILEHANDLER* file_handler,
@@ -832,7 +832,7 @@ int PDFiumEngine::Form_GetLanguage(FPDF_FORMFILLINFO* param,
return 0;
}
-#endif // PDF_USE_XFA
+#endif // defined(PDF_USE_XFA)
int PDFiumEngine::GetBlock(void* param, unsigned long position,
unsigned char* buffer, unsigned long size) {
@@ -1013,6 +1013,12 @@ void PDFiumEngine::AppendPage(PDFEngine* engine, int index) {
client_->Invalidate(GetPageScreenRect(index));
}
+#if defined(PDF_USE_XFA)
+void PDFiumEngine::SetScrollPosition(const pp::Point& position) {
+ position_ = position;
+}
+#endif
+
bool PDFiumEngine::IsProgressiveLoad() {
return doc_loader_.is_partial_document();
}
@@ -1119,7 +1125,7 @@ void PDFiumEngine::FinishLoadingDocument() {
void PDFiumEngine::UnsupportedFeature(int type) {
std::string feature;
switch (type) {
-#ifndef PDF_USE_XFA
+#if !defined(PDF_USE_XFA)
case FPDF_UNSP_DOC_XFAFORM:
feature = "XFA";
break;
@@ -1562,7 +1568,7 @@ bool PDFiumEngine::OnMouseDown(const pp::MouseInputEvent& event) {
mouse_down_state_.Set(PDFiumPage::NONSELECTABLE_AREA, target);
bool is_valid_control = (form_type == FPDF_FORMFIELD_TEXTFIELD ||
form_type == FPDF_FORMFIELD_COMBOBOX);
-#ifdef PDF_USE_XFA
+#if defined(PDF_USE_XFA)
is_valid_control |= (form_type == FPDF_FORMFIELD_XFA);
#endif
client_->FormTextFieldFocusChange(is_valid_control);
@@ -1619,7 +1625,6 @@ void PDFiumEngine::OnMultipleClick(int click_count,
}
bool PDFiumEngine::OnMouseUp(const pp::MouseInputEvent& event) {
-
if (event.GetButton() != PP_INPUTEVENT_MOUSEBUTTON_LEFT &&
event.GetButton() != PP_INPUTEVENT_MOUSEBUTTON_MIDDLE) {
return false;
@@ -2527,7 +2532,7 @@ void PDFiumEngine::ContinueLoadingDocument(const std::string& password) {
form_ = FPDFDOC_InitFormFillEnvironment(
doc_, static_cast<FPDF_FORMFILLINFO*>(this));
-#ifdef PDF_USE_XFA
+#if defined(PDF_USE_XFA)
FPDF_LoadXFA(doc_);
#endif
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698