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

Unified Diff: pdf/pdfium/pdfium_engine.h

Issue 2855953003: Handle long press in PDF documents. (Closed)
Patch Set: Rebase to master Created 3 years, 7 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/pdf_engine.h ('k') | 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 999ecce0a4b7ad543a76e56439bfdd73be33aef5..6620c77cb6bad9313550bdb79835ac494e61afdb 100644
--- a/pdf/pdfium/pdfium_engine.h
+++ b/pdf/pdfium/pdfium_engine.h
@@ -24,6 +24,7 @@
#include "ppapi/cpp/completion_callback.h"
#include "ppapi/cpp/dev/buffer_dev.h"
#include "ppapi/cpp/image_data.h"
+#include "ppapi/cpp/input_event.h"
#include "ppapi/cpp/point.h"
#include "ppapi/cpp/var_array.h"
#include "third_party/pdfium/public/fpdf_dataavail.h"
@@ -31,11 +32,6 @@
#include "third_party/pdfium/public/fpdf_progressive.h"
#include "third_party/pdfium/public/fpdfview.h"
-namespace pp {
-class KeyboardInputEvent;
-class MouseInputEvent;
-}
-
namespace chrome_pdf {
class ShadowMatrix;
@@ -90,6 +86,7 @@ class PDFiumEngine : public PDFEngine,
int GetVerticalScrollbarYPosition() override;
void SetGrayscale(bool grayscale) override;
void OnCallback(int id) override;
+ void OnTouchTimerCallback(int id) override;
int GetCharCount(int page_index) override;
pp::FloatRect GetCharBounds(int page_index, int char_index) override;
uint32_t GetCharUnicode(int page_index, int char_index) override;
@@ -445,6 +442,10 @@ class PDFiumEngine : public PDFEngine,
bool PageIndexInBounds(int index) const;
+ void ScheduleTouchTimer(const pp::TouchInputEvent& event);
+ void KillTouchTimer(int timer_id);
+ void HandleLongPress(const pp::TouchInputEvent& event);
+
// FPDF_FORMFILLINFO callbacks.
static void Form_Invalidate(FPDF_FORMFILLINFO* param,
FPDF_PAGE page,
@@ -678,8 +679,12 @@ class PDFiumEngine : public PDFEngine,
// Used to manage timers that form fill API needs. The pair holds the timer
// period, in ms, and the callback function.
- std::map<int, std::pair<int, TimerCallback>> timers_;
- int next_timer_id_;
+ std::map<int, std::pair<int, TimerCallback>> formfill_timers_;
+ int next_formfill_timer_id_;
+
+ // Used to manage timers for touch long press.
+ std::map<int, pp::TouchInputEvent> touch_timers_;
+ int next_touch_timer_id_;
// Holds the zero-based page index of the last page that the mouse clicked on.
int last_page_mouse_down_;
« no previous file with comments | « pdf/pdf_engine.h ('k') | pdf/pdfium/pdfium_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698