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

Side by Side Diff: third_party/WebKit/Source/core/page/AutoscrollController.h

Issue 2289213002: Implement Middle Click Autoscroll on all platforms not just Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/chromium/src into panscroll Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 26 matching lines...) Expand all
37 class Node; 37 class Node;
38 class Page; 38 class Page;
39 class PlatformMouseEvent; 39 class PlatformMouseEvent;
40 class LayoutBox; 40 class LayoutBox;
41 class LayoutObject; 41 class LayoutObject;
42 42
43 enum AutoscrollType { 43 enum AutoscrollType {
44 NoAutoscroll, 44 NoAutoscroll,
45 AutoscrollForDragAndDrop, 45 AutoscrollForDragAndDrop,
46 AutoscrollForSelection, 46 AutoscrollForSelection,
47 #if OS(WIN) 47 AutoscrollForMiddleClickCanStop,
48 AutoscrollForPanCanStop, 48 AutoscrollForMiddleClick,
49 AutoscrollForPan,
50 #endif
51 }; 49 };
52 50
53 // AutscrollController handels autoscroll and pan scroll for EventHandler. 51 // AutscrollController handels autoscroll and middle click autoscroll for EventH andler.
54 class CORE_EXPORT AutoscrollController final : public GarbageCollected<Autoscrol lController> { 52 class CORE_EXPORT AutoscrollController final : public GarbageCollected<Autoscrol lController> {
55 public: 53 public:
56 static AutoscrollController* create(Page&); 54 static AutoscrollController* create(Page&);
57 DECLARE_TRACE(); 55 DECLARE_TRACE();
58 56
59 static const int noPanScrollRadius = 15; 57 static const int noMiddleClickAutoscrollRadius = 15;
60 58
61 void animate(double monotonicFrameBeginTime); 59 void animate(double monotonicFrameBeginTime);
62 bool autoscrollInProgress() const; 60 bool autoscrollInProgress() const;
63 bool autoscrollInProgress(const LayoutBox*) const; 61 bool autoscrollInProgress(const LayoutBox*) const;
64 bool panScrollInProgress() const; 62 bool middleClickAutoscrollInProgress() const;
65 void startAutoscrollForSelection(LayoutObject*); 63 void startAutoscrollForSelection(LayoutObject*);
66 void stopAutoscroll(); 64 void stopAutoscroll();
67 void stopAutoscrollIfNeeded(LayoutObject*); 65 void stopAutoscrollIfNeeded(LayoutObject*);
68 void updateAutoscrollLayoutObject(); 66 void updateAutoscrollLayoutObject();
69 void updateDragAndDrop(Node* targetNode, const IntPoint& eventPosition, doub le eventTime); 67 void updateDragAndDrop(Node* targetNode, const IntPoint& eventPosition, doub le eventTime);
70 #if OS(WIN) 68 void handleMouseReleaseForMiddleClickAutoscroll(LocalFrame*, const PlatformM ouseEvent&);
71 void handleMouseReleaseForPanScrolling(LocalFrame*, const PlatformMouseEvent &); 69 void startMiddleClickAutoscroll(LayoutBox*, const IntPoint&);
72 void startPanScrolling(LayoutBox*, const IntPoint&);
73 #endif
74 70
75 private: 71 private:
76 explicit AutoscrollController(Page&); 72 explicit AutoscrollController(Page&);
77 73
78 void startAutoscroll(); 74 void startAutoscroll();
79 75
80 #if OS(WIN) 76 void updateMiddleClickAutoscrollState(FrameView*, const IntPoint& lastKnownM ousePosition);
81 void updatePanScrollState(FrameView*, const IntPoint& lastKnownMousePosition );
82 #endif
83 77
84 Member<Page> m_page; 78 Member<Page> m_page;
85 LayoutBox* m_autoscrollLayoutObject; 79 LayoutBox* m_autoscrollLayoutObject;
86 LayoutBox* m_pressedLayoutObject; 80 LayoutBox* m_pressedLayoutObject;
87 AutoscrollType m_autoscrollType; 81 AutoscrollType m_autoscrollType;
88 IntPoint m_dragAndDropAutoscrollReferencePosition; 82 IntPoint m_dragAndDropAutoscrollReferencePosition;
89 double m_dragAndDropAutoscrollStartTime; 83 double m_dragAndDropAutoscrollStartTime;
90 #if OS(WIN) 84 IntPoint m_middleClickAutoscrollStartPos;
91 IntPoint m_panScrollStartPos;
92 #endif
93 }; 85 };
94 86
95 } // namespace blink 87 } // namespace blink
96 88
97 #endif // AutoscrollController_h 89 #endif // AutoscrollController_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.cpp ('k') | third_party/WebKit/Source/core/page/AutoscrollController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698