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

Unified Diff: Source/core/page/AutoscrollController.h

Issue 46353003: Switch AutoscrollController to use animation system instead of timer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@gclient
Patch Set: addresses review feedback Created 7 years, 1 month 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 | « Source/core/loader/FrameLoader.cpp ('k') | Source/core/page/AutoscrollController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/AutoscrollController.h
diff --git a/Source/core/page/AutoscrollController.h b/Source/core/page/AutoscrollController.h
index 361581c92cee2eff46f8efe8177cbf06f64dcc02..c66b3a06bc19a35904b5be6cb5d6a693c8713f54 100644
--- a/Source/core/page/AutoscrollController.h
+++ b/Source/core/page/AutoscrollController.h
@@ -26,7 +26,6 @@
#ifndef AutoscrollController_h
#define AutoscrollController_h
-#include "platform/Timer.h"
#include "platform/geometry/IntPoint.h"
#include "wtf/PassOwnPtr.h"
@@ -36,6 +35,7 @@ class EventHandler;
class Frame;
class FrameView;
class Node;
+class Page;
class PlatformMouseEvent;
class RenderBox;
class RenderObject;
@@ -53,12 +53,14 @@ enum AutoscrollType {
// AutscrollController handels autoscroll and pan scroll for EventHandler.
class AutoscrollController {
public:
+ static PassOwnPtr<AutoscrollController> create(Page&);
+
+ void animate(double monotonicFrameBeginTime);
bool autoscrollInProgress() const;
bool autoscrollInProgress(const RenderBox*) const;
- static PassOwnPtr<AutoscrollController> create();
bool panScrollInProgress() const;
void startAutoscrollForSelection(RenderObject*);
- void stopAutoscrollTimer();
+ void stopAutoscroll();
void stopAutoscrollIfNeeded(RenderObject*);
void updateAutoscrollRenderer();
void updateDragAndDrop(Node* targetNode, const IntPoint& eventPosition, double eventTime);
@@ -68,14 +70,15 @@ public:
#endif
private:
- AutoscrollController();
- void autoscrollTimerFired(Timer<AutoscrollController>*);
- void startAutoscrollTimer();
+ explicit AutoscrollController(Page&);
+
+ void startAutoscroll();
+
#if OS(WIN)
- void updatePanScrollState(FrameView*, const IntPoint&);
+ void updatePanScrollState(FrameView*, const IntPoint& lastKnownMousePosition);
#endif
- Timer<AutoscrollController> m_autoscrollTimer;
+ Page& m_page;
RenderBox* m_autoscrollRenderer;
AutoscrollType m_autoscrollType;
IntPoint m_dragAndDropAutoscrollReferencePosition;
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | Source/core/page/AutoscrollController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698