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

Side by Side Diff: Source/core/page/scrolling/ScrollingCoordinator.h

Issue 206603002: Add EventHandlerRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tests. Created 6 years, 9 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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 // Should be called after compositing has been updated. 66 // Should be called after compositing has been updated.
67 void updateAfterCompositingChange(); 67 void updateAfterCompositingChange();
68 68
69 bool needsToUpdateAfterCompositingChange() const { return m_scrollGestureReg ionIsDirty || m_touchEventTargetRectsAreDirty || frameViewIsDirty(); } 69 bool needsToUpdateAfterCompositingChange() const { return m_scrollGestureReg ionIsDirty || m_touchEventTargetRectsAreDirty || frameViewIsDirty(); }
70 70
71 // Should be called whenever a wheel event handler is added or removed in th e 71 // Should be called whenever a wheel event handler is added or removed in th e
72 // frame view's underlying document. 72 // frame view's underlying document.
73 void frameViewWheelEventHandlerCountChanged(FrameView*); 73 void frameViewWheelEventHandlerCountChanged(FrameView*);
74 74
75 // Should be called whenever a scroll event handler is added or removed in t he
76 // frame view's underlying document.
77 void frameViewScrollEventHandlerCountChanged(FrameView*);
78
75 // Should be called whenever the slow repaint objects counter changes betwee n zero and one. 79 // Should be called whenever the slow repaint objects counter changes betwee n zero and one.
76 void frameViewHasSlowRepaintObjectsDidChange(FrameView*); 80 void frameViewHasSlowRepaintObjectsDidChange(FrameView*);
77 81
78 // Should be called whenever the set of fixed objects changes. 82 // Should be called whenever the set of fixed objects changes.
79 void frameViewFixedObjectsDidChange(FrameView*); 83 void frameViewFixedObjectsDidChange(FrameView*);
80 84
81 // Should be called whenever the root layer for the given frame view changes . 85 // Should be called whenever the root layer for the given frame view changes .
82 void frameViewRootLayerDidChange(FrameView*); 86 void frameViewRootLayerDidChange(FrameView*);
83 87
84 #if OS(MACOSX) 88 #if OS(MACOSX)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // For testing purposes only. This ScrollingCoordinator is reused between la yout test, and must be reset 122 // For testing purposes only. This ScrollingCoordinator is reused between la yout test, and must be reset
119 // for the results to be valid. 123 // for the results to be valid.
120 void reset(); 124 void reset();
121 125
122 protected: 126 protected:
123 explicit ScrollingCoordinator(Page*); 127 explicit ScrollingCoordinator(Page*);
124 128
125 bool isForMainFrame(ScrollableArea*) const; 129 bool isForMainFrame(ScrollableArea*) const;
126 130
127 unsigned computeCurrentWheelEventHandlerCount(); 131 unsigned computeCurrentWheelEventHandlerCount();
132 unsigned computeCurrentScrollEventHandlerCount();
128 GraphicsLayer* scrollLayerForFrameView(FrameView*); 133 GraphicsLayer* scrollLayerForFrameView(FrameView*);
129 GraphicsLayer* counterScrollingLayerForFrameView(FrameView*); 134 GraphicsLayer* counterScrollingLayerForFrameView(FrameView*);
130 135
131 Page* m_page; 136 Page* m_page;
132 137
133 // Dirty flags used to idenfity what really needs to be computed after compo siting is updated. 138 // Dirty flags used to idenfity what really needs to be computed after compo siting is updated.
134 bool m_scrollGestureRegionIsDirty; 139 bool m_scrollGestureRegionIsDirty;
135 bool m_touchEventTargetRectsAreDirty; 140 bool m_touchEventTargetRectsAreDirty;
136 bool m_shouldScrollOnMainThreadDirty; 141 bool m_shouldScrollOnMainThreadDirty;
137 142
138 private: 143 private:
139 void recomputeWheelEventHandlerCountForFrameView(FrameView*); 144 void recomputeWheelEventHandlerCountForFrameView(FrameView*);
145 void recomputeScrollEventHandlerCountForFrameView(FrameView*);
140 void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReaso ns); 146 void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReaso ns);
141 147
142 bool hasVisibleSlowRepaintViewportConstrainedObjects(FrameView*) const; 148 bool hasVisibleSlowRepaintViewportConstrainedObjects(FrameView*) const;
143 149
144 bool touchHitTestingEnabled() const; 150 bool touchHitTestingEnabled() const;
145 void setShouldHandleScrollGestureOnMainThreadRegion(const Region&); 151 void setShouldHandleScrollGestureOnMainThreadRegion(const Region&);
146 void setTouchEventTargetRects(const LayerHitTestRects&); 152 void setTouchEventTargetRects(const LayerHitTestRects&);
147 void computeTouchEventTargetRects(LayerHitTestRects&); 153 void computeTouchEventTargetRects(LayerHitTestRects&);
148 void setWheelEventHandlerCount(unsigned); 154 void setWheelEventHandlerCount(unsigned);
155 void setScrollEventHandlerCount(unsigned);
149 156
150 blink::WebScrollbarLayer* addWebScrollbarLayer(ScrollableArea*, ScrollbarOri entation, PassOwnPtr<blink::WebScrollbarLayer>); 157 blink::WebScrollbarLayer* addWebScrollbarLayer(ScrollableArea*, ScrollbarOri entation, PassOwnPtr<blink::WebScrollbarLayer>);
151 blink::WebScrollbarLayer* getWebScrollbarLayer(ScrollableArea*, ScrollbarOri entation); 158 blink::WebScrollbarLayer* getWebScrollbarLayer(ScrollableArea*, ScrollbarOri entation);
152 void removeWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation); 159 void removeWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation);
153 160
154 bool frameViewIsDirty() const; 161 bool frameViewIsDirty() const;
155 162
156 typedef HashMap<ScrollableArea*, OwnPtr<blink::WebScrollbarLayer> > Scrollba rMap; 163 typedef HashMap<ScrollableArea*, OwnPtr<blink::WebScrollbarLayer> > Scrollba rMap;
157 ScrollbarMap m_horizontalScrollbars; 164 ScrollbarMap m_horizontalScrollbars;
158 ScrollbarMap m_verticalScrollbars; 165 ScrollbarMap m_verticalScrollbars;
159 HashSet<const RenderLayer*> m_layersWithTouchRects; 166 HashSet<const RenderLayer*> m_layersWithTouchRects;
160 bool m_wasFrameScrollable; 167 bool m_wasFrameScrollable;
161 168
162 // This is retained for testing. 169 // This is retained for testing.
163 MainThreadScrollingReasons m_lastMainThreadScrollingReasons; 170 MainThreadScrollingReasons m_lastMainThreadScrollingReasons;
164 }; 171 };
165 172
166 } // namespace WebCore 173 } // namespace WebCore
167 174
168 #endif // ScrollingCoordinator_h 175 #endif // ScrollingCoordinator_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698