| 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 12 matching lines...) Expand all Loading... |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef AutoscrollController_h | 26 #ifndef AutoscrollController_h |
| 27 #define AutoscrollController_h | 27 #define AutoscrollController_h |
| 28 | 28 |
| 29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
| 30 #include "platform/geometry/FloatSize.h" | 30 #include "platform/geometry/FloatSize.h" |
| 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 | 34 |
| 34 namespace blink { | 35 namespace blink { |
| 35 | 36 |
| 36 class LocalFrame; | 37 class LocalFrame; |
| 37 class FrameView; | 38 class FrameView; |
| 38 class Node; | 39 class Node; |
| 39 class Page; | 40 class Page; |
| 40 class PlatformMouseEvent; | 41 class PlatformMouseEvent; |
| 41 class LayoutBox; | 42 class LayoutBox; |
| 42 class LayoutObject; | 43 class LayoutObject; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 void animate(double monotonicFrameBeginTime); | 63 void animate(double monotonicFrameBeginTime); |
| 63 bool autoscrollInProgress() const; | 64 bool autoscrollInProgress() const; |
| 64 bool autoscrollInProgress(const LayoutBox*) const; | 65 bool autoscrollInProgress(const LayoutBox*) const; |
| 65 bool middleClickAutoscrollInProgress() const; | 66 bool middleClickAutoscrollInProgress() const; |
| 66 void startAutoscrollForSelection(LayoutObject*); | 67 void startAutoscrollForSelection(LayoutObject*); |
| 67 void stopAutoscroll(); | 68 void stopAutoscroll(); |
| 68 void stopAutoscrollIfNeeded(LayoutObject*); | 69 void stopAutoscrollIfNeeded(LayoutObject*); |
| 69 void updateAutoscrollLayoutObject(); | 70 void updateAutoscrollLayoutObject(); |
| 70 void updateDragAndDrop(Node* targetNode, | 71 void updateDragAndDrop(Node* targetNode, |
| 71 const IntPoint& eventPosition, | 72 const IntPoint& eventPosition, |
| 72 double eventTime); | 73 TimeTicks eventTime); |
| 73 void handleMouseReleaseForMiddleClickAutoscroll(LocalFrame*, | 74 void handleMouseReleaseForMiddleClickAutoscroll(LocalFrame*, |
| 74 const PlatformMouseEvent&); | 75 const PlatformMouseEvent&); |
| 75 void startMiddleClickAutoscroll(LayoutBox*, const IntPoint&); | 76 void startMiddleClickAutoscroll(LayoutBox*, const IntPoint&); |
| 76 | 77 |
| 77 private: | 78 private: |
| 78 explicit AutoscrollController(Page&); | 79 explicit AutoscrollController(Page&); |
| 79 | 80 |
| 80 void startAutoscroll(); | 81 void startAutoscroll(); |
| 81 | 82 |
| 82 void updateMiddleClickAutoscrollState(FrameView*, | 83 void updateMiddleClickAutoscrollState(FrameView*, |
| 83 const IntPoint& lastKnownMousePosition); | 84 const IntPoint& lastKnownMousePosition); |
| 84 FloatSize calculateAutoscrollDelta(); | 85 FloatSize calculateAutoscrollDelta(); |
| 85 | 86 |
| 86 Member<Page> m_page; | 87 Member<Page> m_page; |
| 87 LayoutBox* m_autoscrollLayoutObject; | 88 LayoutBox* m_autoscrollLayoutObject; |
| 88 LayoutBox* m_pressedLayoutObject; | 89 LayoutBox* m_pressedLayoutObject; |
| 89 AutoscrollType m_autoscrollType; | 90 AutoscrollType m_autoscrollType; |
| 90 IntPoint m_dragAndDropAutoscrollReferencePosition; | 91 IntPoint m_dragAndDropAutoscrollReferencePosition; |
| 91 double m_dragAndDropAutoscrollStartTime; | 92 TimeTicks m_dragAndDropAutoscrollStartTime; |
| 92 IntPoint m_middleClickAutoscrollStartPos; | 93 IntPoint m_middleClickAutoscrollStartPos; |
| 93 bool m_didLatchForMiddleClickAutoscroll; | 94 bool m_didLatchForMiddleClickAutoscroll; |
| 94 }; | 95 }; |
| 95 | 96 |
| 96 } // namespace blink | 97 } // namespace blink |
| 97 | 98 |
| 98 #endif // AutoscrollController_h | 99 #endif // AutoscrollController_h |
| OLD | NEW |