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

Unified Diff: pdf/pdfium/pdfium_engine.h

Issue 2271263002: Allows the PDF engine return the page index it is scrolling to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed an if-branch as per tsepezs advice 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 | « no previous file | pdf/pdfium/pdfium_engine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.h
diff --git a/pdf/pdfium/pdfium_engine.h b/pdf/pdfium/pdfium_engine.h
index 7f7d1136cc2375b8a947920b9dea770824a90118..fdb4fd37698070f50bc625b13b7e4b1327546031 100644
--- a/pdf/pdfium/pdfium_engine.h
+++ b/pdf/pdfium/pdfium_engine.h
@@ -15,6 +15,7 @@
#include <vector>
#include "base/macros.h"
+#include "base/optional.h"
#include "base/time/time.h"
#include "pdf/document_loader.h"
#include "pdf/pdf_engine.h"
@@ -249,6 +250,11 @@ class PDFiumEngine : public PDFEngine,
// must have been called first.
bool IsPageVisible(int index) const;
+ // Internal interface that caches the page index requested by the PDFium
+ // engine
+ // to be used during the interval the client has not finished handling it.
Lei Zhang 2016/08/27 01:20:54 nit: funny line break.
+ void ScrollToPage(int page);
+
// Checks if a page is now available, and if so marks it as such and returns
// true. Otherwise, it will return false and will add the index to the given
// array if it's not already there.
@@ -678,6 +684,10 @@ class PDFiumEngine : public PDFEngine,
// calling CalculateVisiblePages()
int most_visible_page_;
+ // Holds the page index requested by PDFium while there are in-flight
+ // messages being sent by the Browser <-> PDFium engine.
Lei Zhang 2016/08/27 01:20:54 The other side is not the Browser. It's Chromium's
+ base::Optional<int> in_flight_visible_page_;
+
// Set to true after FORM_DoDocumentJSAction/FORM_DoDocumentOpenAction have
// been called. Only after that can we call FORM_DoPageAAction.
bool called_do_document_action_;
« no previous file with comments | « no previous file | pdf/pdfium/pdfium_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698