OLD | NEW |
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 20 matching lines...) Expand all Loading... |
31 #include "platform/geometry/IntPoint.h" | 31 #include "platform/geometry/IntPoint.h" |
32 #include "platform/heap/Handle.h" | 32 #include "platform/heap/Handle.h" |
33 #include "wtf/Time.h" | 33 #include "wtf/Time.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 class LocalFrame; | 37 class LocalFrame; |
38 class FrameView; | 38 class FrameView; |
39 class Node; | 39 class Node; |
40 class Page; | 40 class Page; |
41 class PlatformMouseEvent; | |
42 class LayoutBox; | 41 class LayoutBox; |
43 class LayoutObject; | 42 class LayoutObject; |
| 43 class WebMouseEvent; |
44 | 44 |
45 enum AutoscrollType { | 45 enum AutoscrollType { |
46 NoAutoscroll, | 46 NoAutoscroll, |
47 AutoscrollForDragAndDrop, | 47 AutoscrollForDragAndDrop, |
48 AutoscrollForSelection, | 48 AutoscrollForSelection, |
49 AutoscrollForMiddleClickCanStop, | 49 AutoscrollForMiddleClickCanStop, |
50 AutoscrollForMiddleClick, | 50 AutoscrollForMiddleClick, |
51 }; | 51 }; |
52 | 52 |
53 // AutscrollController handels autoscroll and middle click autoscroll for | 53 // AutscrollController handels autoscroll and middle click autoscroll for |
(...skipping 11 matching lines...) Expand all Loading... |
65 bool autoscrollInProgress(const LayoutBox*) const; | 65 bool autoscrollInProgress(const LayoutBox*) const; |
66 bool middleClickAutoscrollInProgress() const; | 66 bool middleClickAutoscrollInProgress() const; |
67 void startAutoscrollForSelection(LayoutObject*); | 67 void startAutoscrollForSelection(LayoutObject*); |
68 void stopAutoscroll(); | 68 void stopAutoscroll(); |
69 void stopAutoscrollIfNeeded(LayoutObject*); | 69 void stopAutoscrollIfNeeded(LayoutObject*); |
70 void updateAutoscrollLayoutObject(); | 70 void updateAutoscrollLayoutObject(); |
71 void updateDragAndDrop(Node* targetNode, | 71 void updateDragAndDrop(Node* targetNode, |
72 const IntPoint& eventPosition, | 72 const IntPoint& eventPosition, |
73 TimeTicks eventTime); | 73 TimeTicks eventTime); |
74 void handleMouseReleaseForMiddleClickAutoscroll(LocalFrame*, | 74 void handleMouseReleaseForMiddleClickAutoscroll(LocalFrame*, |
75 const PlatformMouseEvent&); | 75 const WebMouseEvent&); |
76 void startMiddleClickAutoscroll(LayoutBox*, const IntPoint&); | 76 void startMiddleClickAutoscroll(LayoutBox*, const IntPoint&); |
77 | 77 |
78 private: | 78 private: |
79 explicit AutoscrollController(Page&); | 79 explicit AutoscrollController(Page&); |
80 | 80 |
81 void startAutoscroll(); | 81 void startAutoscroll(); |
82 | 82 |
83 void updateMiddleClickAutoscrollState(FrameView*, | 83 void updateMiddleClickAutoscrollState(FrameView*, |
84 const IntPoint& lastKnownMousePosition); | 84 const IntPoint& lastKnownMousePosition); |
85 FloatSize calculateAutoscrollDelta(); | 85 FloatSize calculateAutoscrollDelta(); |
86 | 86 |
87 Member<Page> m_page; | 87 Member<Page> m_page; |
88 LayoutBox* m_autoscrollLayoutObject; | 88 LayoutBox* m_autoscrollLayoutObject; |
89 LayoutBox* m_pressedLayoutObject; | 89 LayoutBox* m_pressedLayoutObject; |
90 AutoscrollType m_autoscrollType; | 90 AutoscrollType m_autoscrollType; |
91 IntPoint m_dragAndDropAutoscrollReferencePosition; | 91 IntPoint m_dragAndDropAutoscrollReferencePosition; |
92 TimeTicks m_dragAndDropAutoscrollStartTime; | 92 TimeTicks m_dragAndDropAutoscrollStartTime; |
93 IntPoint m_middleClickAutoscrollStartPos; | 93 IntPoint m_middleClickAutoscrollStartPos; |
94 bool m_didLatchForMiddleClickAutoscroll; | 94 bool m_didLatchForMiddleClickAutoscroll; |
95 }; | 95 }; |
96 | 96 |
97 } // namespace blink | 97 } // namespace blink |
98 | 98 |
99 #endif // AutoscrollController_h | 99 #endif // AutoscrollController_h |
OLD | NEW |