OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 class WebViewImpl final : public WebView | 91 class WebViewImpl final : public WebView |
92 , public RefCounted<WebViewImpl> | 92 , public RefCounted<WebViewImpl> |
93 , public WebGestureCurveTarget | 93 , public WebGestureCurveTarget |
94 , public PageWidgetEventHandler { | 94 , public PageWidgetEventHandler { |
95 public: | 95 public: |
96 static WebViewImpl* create(WebViewClient*); | 96 static WebViewImpl* create(WebViewClient*); |
97 static HashSet<WebViewImpl*>& allInstances(); | 97 static HashSet<WebViewImpl*>& allInstances(); |
98 | 98 |
99 // WebWidget methods: | 99 // WebWidget methods: |
100 virtual void close() override; | 100 void close() override; |
101 virtual WebSize size() override; | 101 WebSize size() override; |
102 virtual void willStartLiveResize() override; | 102 void willStartLiveResize() override; |
103 virtual void resize(const WebSize&) override; | 103 void resize(const WebSize&) override; |
104 virtual void resizePinchViewport(const WebSize&) override; | 104 void resizePinchViewport(const WebSize&) override; |
105 virtual void willEndLiveResize() override; | 105 void willEndLiveResize() override; |
106 virtual void didEnterFullScreen() override; | 106 void didEnterFullScreen() override; |
107 virtual void didExitFullScreen() override; | 107 void didExitFullScreen() override; |
108 | 108 |
109 virtual void beginFrame(const WebBeginFrameArgs&) override; | 109 void beginFrame(const WebBeginFrameArgs&) override; |
110 | 110 |
111 virtual void setNeedsLayoutAndFullPaintInvalidation() override; | 111 void setNeedsLayoutAndFullPaintInvalidation() override; |
112 virtual void layout() override; | 112 void layout() override; |
113 virtual void paint(WebCanvas*, const WebRect&) override; | 113 void paint(WebCanvas*, const WebRect&) override; |
114 #if OS(ANDROID) | 114 #if OS(ANDROID) |
115 virtual void paintCompositedDeprecated(WebCanvas*, const WebRect&) override; | 115 void paintCompositedDeprecated(WebCanvas*, const WebRect&) override; |
116 #endif | 116 #endif |
117 virtual void layoutAndPaintAsync(WebLayoutAndPaintAsyncCallback*) override; | 117 void layoutAndPaintAsync(WebLayoutAndPaintAsyncCallback*) override; |
118 virtual void compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback*
) override; | 118 void compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback*) overri
de; |
119 virtual bool isTrackingRepaints() const override; | 119 bool isTrackingRepaints() const override; |
120 virtual void themeChanged() override; | 120 void themeChanged() override; |
121 virtual bool handleInputEvent(const WebInputEvent&) override; | 121 bool handleInputEvent(const WebInputEvent&) override; |
122 virtual void setCursorVisibilityState(bool isVisible) override; | 122 void setCursorVisibilityState(bool isVisible) override; |
123 virtual bool hasTouchEventHandlersAt(const WebPoint&) override; | 123 bool hasTouchEventHandlersAt(const WebPoint&) override; |
124 | 124 |
125 virtual void applyViewportDeltas( | 125 void applyViewportDeltas( |
126 const WebFloatSize& pinchViewportDelta, | 126 const WebFloatSize& pinchViewportDelta, |
127 const WebFloatSize& layoutViewportDelta, | 127 const WebFloatSize& layoutViewportDelta, |
128 const WebFloatSize& elasticOverscrollDelta, | 128 const WebFloatSize& elasticOverscrollDelta, |
129 float pageScaleDelta, | 129 float pageScaleDelta, |
130 float topControlsShownRatioDelta) override; | 130 float topControlsShownRatioDelta) override; |
131 virtual void recordFrameTimingEvent(enum FrameTimingEventType, int64_t, cons
t WebVector<WebFrameTimingEvent>&) override; | 131 void recordFrameTimingEvent(enum FrameTimingEventType, int64_t, const WebVec
tor<WebFrameTimingEvent>&) override; |
132 virtual void mouseCaptureLost() override; | 132 void mouseCaptureLost() override; |
133 virtual void setFocus(bool enable) override; | 133 void setFocus(bool enable) override; |
134 virtual bool setComposition( | 134 bool setComposition( |
135 const WebString& text, | 135 const WebString& text, |
136 const WebVector<WebCompositionUnderline>& underlines, | 136 const WebVector<WebCompositionUnderline>& underlines, |
137 int selectionStart, | 137 int selectionStart, |
138 int selectionEnd) override; | 138 int selectionEnd) override; |
139 virtual bool confirmComposition() override; | 139 bool confirmComposition() override; |
140 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior
) override; | 140 bool confirmComposition(ConfirmCompositionBehavior selectionBehavior) overri
de; |
141 virtual bool confirmComposition(const WebString& text) override; | 141 bool confirmComposition(const WebString& text) override; |
142 virtual bool compositionRange(size_t* location, size_t* length) override; | 142 bool compositionRange(size_t* location, size_t* length) override; |
143 virtual WebTextInputInfo textInputInfo() override; | 143 WebTextInputInfo textInputInfo() override; |
144 virtual WebColor backgroundColor() const override; | 144 WebColor backgroundColor() const override; |
145 virtual WebPagePopup* pagePopup() const override; | 145 WebPagePopup* pagePopup() const override; |
146 virtual bool selectionBounds(WebRect& anchor, WebRect& focus) const override
; | 146 bool selectionBounds(WebRect& anchor, WebRect& focus) const override; |
147 virtual bool selectionTextDirection(WebTextDirection& start, WebTextDirectio
n& end) const override; | 147 bool selectionTextDirection(WebTextDirection& start, WebTextDirection& end)
const override; |
148 virtual bool isSelectionAnchorFirst() const override; | 148 bool isSelectionAnchorFirst() const override; |
149 virtual bool caretOrSelectionRange(size_t* location, size_t* length) overrid
e; | 149 bool caretOrSelectionRange(size_t* location, size_t* length) override; |
150 virtual void setTextDirection(WebTextDirection) override; | 150 void setTextDirection(WebTextDirection) override; |
151 virtual bool isAcceleratedCompositingActive() const override; | 151 bool isAcceleratedCompositingActive() const override; |
152 virtual void willCloseLayerTreeView() override; | 152 void willCloseLayerTreeView() override; |
153 virtual void didAcquirePointerLock() override; | 153 void didAcquirePointerLock() override; |
154 virtual void didNotAcquirePointerLock() override; | 154 void didNotAcquirePointerLock() override; |
155 virtual void didLosePointerLock() override; | 155 void didLosePointerLock() override; |
156 virtual void didChangeWindowResizerRect() override; | 156 void didChangeWindowResizerRect() override; |
157 | 157 |
158 // WebView methods: | 158 // WebView methods: |
159 virtual bool isWebView() const { return true; } | 159 virtual bool isWebView() const { return true; } |
160 virtual void setMainFrame(WebFrame*) override; | 160 void setMainFrame(WebFrame*) override; |
161 virtual void setCredentialManagerClient(WebCredentialManagerClient*) overrid
e; | 161 void setCredentialManagerClient(WebCredentialManagerClient*) override; |
162 virtual void setPrerendererClient(WebPrerendererClient*) override; | 162 void setPrerendererClient(WebPrerendererClient*) override; |
163 virtual void setSpellCheckClient(WebSpellCheckClient*) override; | 163 void setSpellCheckClient(WebSpellCheckClient*) override; |
164 virtual WebSettings* settings() override; | 164 WebSettings* settings() override; |
165 virtual WebString pageEncoding() const override; | 165 WebString pageEncoding() const override; |
166 virtual void setPageEncoding(const WebString&) override; | 166 void setPageEncoding(const WebString&) override; |
167 virtual bool isTransparent() const override; | 167 bool isTransparent() const override; |
168 virtual void setIsTransparent(bool value) override; | 168 void setIsTransparent(bool value) override; |
169 virtual void setBaseBackgroundColor(WebColor) override; | 169 void setBaseBackgroundColor(WebColor) override; |
170 virtual bool tabsToLinks() const override; | 170 bool tabsToLinks() const override; |
171 virtual void setTabsToLinks(bool value) override; | 171 void setTabsToLinks(bool value) override; |
172 virtual bool tabKeyCyclesThroughElements() const override; | 172 bool tabKeyCyclesThroughElements() const override; |
173 virtual void setTabKeyCyclesThroughElements(bool value) override; | 173 void setTabKeyCyclesThroughElements(bool value) override; |
174 virtual bool isActive() const override; | 174 bool isActive() const override; |
175 virtual void setIsActive(bool value) override; | 175 void setIsActive(bool value) override; |
176 virtual void setDomainRelaxationForbidden(bool, const WebString& scheme) ove
rride; | 176 void setDomainRelaxationForbidden(bool, const WebString& scheme) override; |
177 virtual void setWindowFeatures(const WebWindowFeatures&) override; | 177 void setWindowFeatures(const WebWindowFeatures&) override; |
178 virtual void setOpenedByDOM() override; | 178 void setOpenedByDOM() override; |
179 virtual WebFrame* mainFrame() override; | 179 WebFrame* mainFrame() override; |
180 virtual WebFrame* findFrameByName( | 180 WebFrame* findFrameByName( |
181 const WebString& name, WebFrame* relativeToFrame) override; | 181 const WebString& name, WebFrame* relativeToFrame) override; |
182 virtual WebFrame* focusedFrame() override; | 182 WebFrame* focusedFrame() override; |
183 virtual void setFocusedFrame(WebFrame*) override; | 183 void setFocusedFrame(WebFrame*) override; |
184 virtual void setInitialFocus(bool reverse) override; | 184 void setInitialFocus(bool reverse) override; |
185 virtual void clearFocusedElement() override; | 185 void clearFocusedElement() override; |
186 virtual bool scrollFocusedNodeIntoRect(const WebRect&) override; | 186 bool scrollFocusedNodeIntoRect(const WebRect&) override; |
187 virtual void zoomToFindInPageRect(const WebRect&); | 187 void zoomToFindInPageRect(const WebRect&); |
188 virtual void advanceFocus(bool reverse) override; | 188 void advanceFocus(bool reverse) override; |
189 virtual double zoomLevel() override; | 189 double zoomLevel() override; |
190 virtual double setZoomLevel(double) override; | 190 double setZoomLevel(double) override; |
191 virtual void zoomLimitsChanged(double minimumZoomLevel, double maximumZoomLe
vel) override; | 191 void zoomLimitsChanged(double minimumZoomLevel, double maximumZoomLevel) ove
rride; |
192 virtual float textZoomFactor() override; | 192 float textZoomFactor() override; |
193 virtual float setTextZoomFactor(float) override; | 193 float setTextZoomFactor(float) override; |
194 virtual bool zoomToMultipleTargetsRect(const WebRect&) override; | 194 bool zoomToMultipleTargetsRect(const WebRect&) override; |
195 virtual float pageScaleFactor() const override; | 195 float pageScaleFactor() const override; |
196 virtual void setDefaultPageScaleLimits(float minScale, float maxScale) overr
ide; | 196 void setDefaultPageScaleLimits(float minScale, float maxScale) override; |
197 virtual void setInitialPageScaleOverride(float) override; | 197 void setInitialPageScaleOverride(float) override; |
198 virtual void setMaximumLegibleScale(float) override; | 198 void setMaximumLegibleScale(float) override; |
199 virtual void setPageScaleFactor(float) override; | 199 void setPageScaleFactor(float) override; |
200 virtual void setPinchViewportOffset(const WebFloatPoint&) override; | 200 void setPinchViewportOffset(const WebFloatPoint&) override; |
201 virtual WebFloatPoint pinchViewportOffset() const override; | 201 WebFloatPoint pinchViewportOffset() const override; |
202 virtual void resetScrollAndScaleState() override; | 202 void resetScrollAndScaleState() override; |
203 virtual void setIgnoreViewportTagScaleLimits(bool) override; | 203 void setIgnoreViewportTagScaleLimits(bool) override; |
204 virtual WebSize contentsPreferredMinimumSize() override; | 204 WebSize contentsPreferredMinimumSize() override; |
205 virtual void setDisplayMode(WebDisplayMode) override; | 205 void setDisplayMode(WebDisplayMode) override; |
206 | 206 |
207 virtual float deviceScaleFactor() const override; | 207 float deviceScaleFactor() const override; |
208 virtual void setDeviceScaleFactor(float) override; | 208 void setDeviceScaleFactor(float) override; |
209 virtual void setDeviceColorProfile(const WebVector<char>&) override; | 209 void setDeviceColorProfile(const WebVector<char>&) override; |
210 virtual void resetDeviceColorProfile() override; | 210 void resetDeviceColorProfile() override; |
211 | 211 |
212 virtual void enableAutoResizeMode( | 212 void enableAutoResizeMode( |
213 const WebSize& minSize, | 213 const WebSize& minSize, |
214 const WebSize& maxSize) override; | 214 const WebSize& maxSize) override; |
215 virtual void disableAutoResizeMode() override; | 215 void disableAutoResizeMode() override; |
216 virtual void performMediaPlayerAction( | 216 void performMediaPlayerAction( |
217 const WebMediaPlayerAction& action, | 217 const WebMediaPlayerAction& action, |
218 const WebPoint& location) override; | 218 const WebPoint& location) override; |
219 virtual void performPluginAction( | 219 void performPluginAction( |
220 const WebPluginAction&, | 220 const WebPluginAction&, |
221 const WebPoint&) override; | 221 const WebPoint&) override; |
222 virtual WebHitTestResult hitTestResultAt(const WebPoint&) override; | 222 WebHitTestResult hitTestResultAt(const WebPoint&) override; |
223 virtual WebHitTestResult hitTestResultForTap(const WebPoint&, const WebSize&
) override; | 223 WebHitTestResult hitTestResultForTap(const WebPoint&, const WebSize&) overri
de; |
224 virtual void copyImageAt(const WebPoint&) override; | 224 void copyImageAt(const WebPoint&) override; |
225 virtual void saveImageAt(const WebPoint&) override; | 225 void saveImageAt(const WebPoint&) override; |
226 virtual void dragSourceEndedAt( | 226 void dragSourceEndedAt( |
227 const WebPoint& clientPoint, | 227 const WebPoint& clientPoint, |
228 const WebPoint& screenPoint, | 228 const WebPoint& screenPoint, |
229 WebDragOperation) override; | 229 WebDragOperation) override; |
230 virtual void dragSourceSystemDragEnded() override; | 230 void dragSourceSystemDragEnded() override; |
231 virtual WebDragOperation dragTargetDragEnter( | 231 WebDragOperation dragTargetDragEnter( |
232 const WebDragData&, | 232 const WebDragData&, |
233 const WebPoint& clientPoint, | 233 const WebPoint& clientPoint, |
234 const WebPoint& screenPoint, | 234 const WebPoint& screenPoint, |
235 WebDragOperationsMask operationsAllowed, | 235 WebDragOperationsMask operationsAllowed, |
236 int modifiers) override; | 236 int modifiers) override; |
237 virtual WebDragOperation dragTargetDragOver( | 237 WebDragOperation dragTargetDragOver( |
238 const WebPoint& clientPoint, | 238 const WebPoint& clientPoint, |
239 const WebPoint& screenPoint, | 239 const WebPoint& screenPoint, |
240 WebDragOperationsMask operationsAllowed, | 240 WebDragOperationsMask operationsAllowed, |
241 int modifiers) override; | 241 int modifiers) override; |
242 virtual void dragTargetDragLeave() override; | 242 void dragTargetDragLeave() override; |
243 virtual void dragTargetDrop( | 243 void dragTargetDrop( |
244 const WebPoint& clientPoint, | 244 const WebPoint& clientPoint, |
245 const WebPoint& screenPoint, | 245 const WebPoint& screenPoint, |
246 int modifiers) override; | 246 int modifiers) override; |
247 virtual void spellingMarkers(WebVector<uint32_t>* markers) override; | 247 void spellingMarkers(WebVector<uint32_t>* markers) override; |
248 virtual void removeSpellingMarkersUnderWords(const WebVector<WebString>& wor
ds) override; | 248 void removeSpellingMarkersUnderWords(const WebVector<WebString>& words) over
ride; |
249 virtual unsigned long createUniqueIdentifierForRequest() override; | 249 unsigned long createUniqueIdentifierForRequest() override; |
250 void enableDeviceEmulation(const WebDeviceEmulationParams&) override; | 250 void enableDeviceEmulation(const WebDeviceEmulationParams&) override; |
251 void disableDeviceEmulation() override; | 251 void disableDeviceEmulation() override; |
252 virtual WebAXObject accessibilityObject() override; | 252 WebAXObject accessibilityObject() override; |
253 virtual void setSelectionColors(unsigned activeBackgroundColor, | 253 void setSelectionColors(unsigned activeBackgroundColor, |
254 unsigned activeForegroundColor, | 254 unsigned activeForegroundColor, |
255 unsigned inactiveBackgroundColor, | 255 unsigned inactiveBackgroundColor, |
256 unsigned inactiveForegroundColor) override; | 256 unsigned inactiveForegroundColor) override; |
257 virtual void performCustomContextMenuAction(unsigned action) override; | 257 void performCustomContextMenuAction(unsigned action) override; |
258 virtual void showContextMenu() override; | 258 void showContextMenu() override; |
259 virtual void extractSmartClipData(WebRect, WebString&, WebString&, WebRect&)
override; | 259 void extractSmartClipData(WebRect, WebString&, WebString&, WebRect&) overrid
e; |
260 virtual void hidePopups() override; | 260 void hidePopups() override; |
261 virtual void addPageOverlay(WebPageOverlay*, int /* zOrder */) override; | 261 void addPageOverlay(WebPageOverlay*, int /* zOrder */) override; |
262 virtual void removePageOverlay(WebPageOverlay*) override; | 262 void removePageOverlay(WebPageOverlay*) override; |
263 virtual void transferActiveWheelFlingAnimation(const WebActiveWheelFlingPara
meters&) override; | 263 void transferActiveWheelFlingAnimation(const WebActiveWheelFlingParameters&)
override; |
264 virtual bool endActiveFlingAnimation() override; | 264 bool endActiveFlingAnimation() override; |
265 virtual void setShowPaintRects(bool) override; | 265 void setShowPaintRects(bool) override; |
266 void setShowDebugBorders(bool); | 266 void setShowDebugBorders(bool); |
267 virtual void setShowFPSCounter(bool) override; | 267 void setShowFPSCounter(bool) override; |
268 virtual void setContinuousPaintingEnabled(bool) override; | 268 void setContinuousPaintingEnabled(bool) override; |
269 virtual void setShowScrollBottleneckRects(bool) override; | 269 void setShowScrollBottleneckRects(bool) override; |
270 virtual void acceptLanguagesChanged() override; | 270 void acceptLanguagesChanged() override; |
271 | 271 |
272 // WebViewImpl | 272 // WebViewImpl |
273 void enableViewport(); | 273 void enableViewport(); |
274 void disableViewport(); | 274 void disableViewport(); |
275 | 275 |
276 float defaultMinimumPageScaleFactor() const; | 276 float defaultMinimumPageScaleFactor() const; |
277 float defaultMaximumPageScaleFactor() const; | 277 float defaultMaximumPageScaleFactor() const; |
278 float minimumPageScaleFactor() const; | 278 float minimumPageScaleFactor() const; |
279 float maximumPageScaleFactor() const; | 279 float maximumPageScaleFactor() const; |
280 float clampPageScaleFactorToLimits(float) const; | 280 float clampPageScaleFactorToLimits(float) const; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 // Event related methods: | 347 // Event related methods: |
348 void mouseContextMenu(const WebMouseEvent&); | 348 void mouseContextMenu(const WebMouseEvent&); |
349 void mouseDoubleClick(const WebMouseEvent&); | 349 void mouseDoubleClick(const WebMouseEvent&); |
350 | 350 |
351 bool detectContentOnTouch(const GestureEventWithHitTestResults& targetedEven
t); | 351 bool detectContentOnTouch(const GestureEventWithHitTestResults& targetedEven
t); |
352 bool startPageScaleAnimation(const IntPoint& targetPosition, bool useAnchor,
float newScale, double durationInSeconds); | 352 bool startPageScaleAnimation(const IntPoint& targetPosition, bool useAnchor,
float newScale, double durationInSeconds); |
353 | 353 |
354 void hasTouchEventHandlers(bool); | 354 void hasTouchEventHandlers(bool); |
355 | 355 |
356 // WebGestureCurveTarget implementation for fling. | 356 // WebGestureCurveTarget implementation for fling. |
357 virtual bool scrollBy(const WebFloatSize& delta, const WebFloatSize& velocit
y) override; | 357 bool scrollBy(const WebFloatSize& delta, const WebFloatSize& velocity) overr
ide; |
358 | 358 |
359 // Handles context menu events orignated via the the keyboard. These | 359 // Handles context menu events orignated via the the keyboard. These |
360 // include the VK_APPS virtual key and the Shift+F10 combine. Code is | 360 // include the VK_APPS virtual key and the Shift+F10 combine. Code is |
361 // based on the Webkit function bool WebView::handleContextMenuEvent(WPARAM | 361 // based on the Webkit function bool WebView::handleContextMenuEvent(WPARAM |
362 // wParam, LPARAM lParam) in webkit\webkit\win\WebView.cpp. The only | 362 // wParam, LPARAM lParam) in webkit\webkit\win\WebView.cpp. The only |
363 // significant change in this function is the code to convert from a | 363 // significant change in this function is the code to convert from a |
364 // Keyboard event to the Right Mouse button down event. | 364 // Keyboard event to the Right Mouse button down event. |
365 bool sendContextMenuEvent(const WebKeyboardEvent&); | 365 bool sendContextMenuEvent(const WebKeyboardEvent&); |
366 | 366 |
367 void showContextMenuAtPoint(float x, float y, PassRefPtrWillBeRawPtr<Context
MenuProvider>); | 367 void showContextMenuAtPoint(float x, float y, PassRefPtrWillBeRawPtr<Context
MenuProvider>); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 GraphicsLayer* rootGraphicsLayer(); | 437 GraphicsLayer* rootGraphicsLayer(); |
438 void setRootGraphicsLayer(GraphicsLayer*); | 438 void setRootGraphicsLayer(GraphicsLayer*); |
439 void scheduleCompositingLayerSync(); | 439 void scheduleCompositingLayerSync(); |
440 GraphicsLayerFactory* graphicsLayerFactory() const; | 440 GraphicsLayerFactory* graphicsLayerFactory() const; |
441 DeprecatedPaintLayerCompositor* compositor() const; | 441 DeprecatedPaintLayerCompositor* compositor() const; |
442 void registerForAnimations(WebLayer*); | 442 void registerForAnimations(WebLayer*); |
443 void scheduleAnimation(); | 443 void scheduleAnimation(); |
444 void attachCompositorAnimationTimeline(WebCompositorAnimationTimeline*); | 444 void attachCompositorAnimationTimeline(WebCompositorAnimationTimeline*); |
445 void detachCompositorAnimationTimeline(WebCompositorAnimationTimeline*); | 445 void detachCompositorAnimationTimeline(WebCompositorAnimationTimeline*); |
446 | 446 |
447 virtual void setVisibilityState(WebPageVisibilityState, bool) override; | 447 void setVisibilityState(WebPageVisibilityState, bool) override; |
448 | 448 |
449 bool hasOpenedPopup() const { return m_pagePopup; } | 449 bool hasOpenedPopup() const { return m_pagePopup; } |
450 | 450 |
451 // Returns true if the event leads to scrolling. | 451 // Returns true if the event leads to scrolling. |
452 static bool mapKeyCodeForScroll( | 452 static bool mapKeyCodeForScroll( |
453 int keyCode, | 453 int keyCode, |
454 ScrollDirectionPhysical*, | 454 ScrollDirectionPhysical*, |
455 ScrollGranularity*); | 455 ScrollGranularity*); |
456 | 456 |
457 // Called by a full frame plugin inside this view to inform it that its | 457 // Called by a full frame plugin inside this view to inform it that its |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 // Returns the bounding box of the block type node touched by the WebPoint. | 506 // Returns the bounding box of the block type node touched by the WebPoint. |
507 WebRect computeBlockBound(const WebPoint&, bool ignoreClipping); | 507 WebRect computeBlockBound(const WebPoint&, bool ignoreClipping); |
508 | 508 |
509 // Exposed for tests. | 509 // Exposed for tests. |
510 WebVector<WebCompositionUnderline> compositionUnderlines() const; | 510 WebVector<WebCompositionUnderline> compositionUnderlines() const; |
511 | 511 |
512 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; } | 512 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; } |
513 | 513 |
514 bool matchesHeuristicsForGpuRasterizationForTesting() const { return m_match
esHeuristicsForGpuRasterization; } | 514 bool matchesHeuristicsForGpuRasterizationForTesting() const { return m_match
esHeuristicsForGpuRasterization; } |
515 | 515 |
516 virtual void setTopControlsHeight(float height, bool topControlsShrinkLayout
Size) override; | 516 void setTopControlsHeight(float height, bool topControlsShrinkLayoutSize) ov
erride; |
517 virtual void updateTopControlsState(WebTopControlsState constraint, WebTopCo
ntrolsState current, bool animate) override; | 517 void updateTopControlsState(WebTopControlsState constraint, WebTopControlsSt
ate current, bool animate) override; |
518 | 518 |
519 TopControls& topControls(); | 519 TopControls& topControls(); |
520 // Called anytime top controls layout height or content offset have changed. | 520 // Called anytime top controls layout height or content offset have changed. |
521 void didUpdateTopControls(); | 521 void didUpdateTopControls(); |
522 | 522 |
523 virtual void forceNextWebGLContextCreationToFail() override; | 523 void forceNextWebGLContextCreationToFail() override; |
524 virtual void forceNextDrawingBufferCreationToFail() override; | 524 void forceNextDrawingBufferCreationToFail() override; |
525 | 525 |
526 IntSize mainFrameSize(); | 526 IntSize mainFrameSize(); |
527 WebDisplayMode displayMode() const { return m_displayMode; } | 527 WebDisplayMode displayMode() const { return m_displayMode; } |
528 | 528 |
529 PageScaleConstraintsSet& pageScaleConstraintsSet() const; | 529 PageScaleConstraintsSet& pageScaleConstraintsSet() const; |
530 | 530 |
531 private: | 531 private: |
532 void setPageScaleFactorAndLocation(float, const FloatPoint&); | 532 void setPageScaleFactorAndLocation(float, const FloatPoint&); |
533 | 533 |
534 void scrollAndRescaleViewports(float scaleFactor, const IntPoint& mainFrameO
rigin, const FloatPoint& pinchViewportOrigin); | 534 void scrollAndRescaleViewports(float scaleFactor, const IntPoint& mainFrameO
rigin, const FloatPoint& pinchViewportOrigin); |
535 | 535 |
536 float maximumLegiblePageScale() const; | 536 float maximumLegiblePageScale() const; |
537 void refreshPageScaleFactorAfterLayout(); | 537 void refreshPageScaleFactorAfterLayout(); |
538 void resumeTreeViewCommits(); | 538 void resumeTreeViewCommits(); |
539 IntSize contentsSize() const; | 539 IntSize contentsSize() const; |
540 | 540 |
541 void performResize(); | 541 void performResize(); |
542 void resizeViewWhileAnchored(FrameView*); | 542 void resizeViewWhileAnchored(FrameView*); |
543 | 543 |
544 friend class WebView; // So WebView::Create can call our constructor | 544 friend class WebView; // So WebView::Create can call our constructor |
545 friend class WTF::RefCounted<WebViewImpl>; | 545 friend class WTF::RefCounted<WebViewImpl>; |
546 friend void setCurrentInputEventForTest(const WebInputEvent*); | 546 friend void setCurrentInputEventForTest(const WebInputEvent*); |
547 | 547 |
548 enum DragAction { | 548 enum DragAction { |
549 DragEnter, | 549 DragEnter, |
550 DragOver | 550 DragOver |
551 }; | 551 }; |
552 | 552 |
553 explicit WebViewImpl(WebViewClient*); | 553 explicit WebViewImpl(WebViewClient*); |
554 virtual ~WebViewImpl(); | 554 ~WebViewImpl() override; |
555 | 555 |
556 WebTextInputType textInputType(); | 556 WebTextInputType textInputType(); |
557 int textInputFlags(); | 557 int textInputFlags(); |
558 | 558 |
559 WebString inputModeOfFocusedElement(); | 559 WebString inputModeOfFocusedElement(); |
560 | 560 |
561 // Returns true if the event was actually processed. | 561 // Returns true if the event was actually processed. |
562 bool keyEventDefault(const WebKeyboardEvent&); | 562 bool keyEventDefault(const WebKeyboardEvent&); |
563 | 563 |
564 bool confirmComposition(const WebString& text, ConfirmCompositionBehavior); | 564 bool confirmComposition(const WebString& text, ConfirmCompositionBehavior); |
(...skipping 26 matching lines...) Expand all Loading... |
591 void updateRootLayerTransform(); | 591 void updateRootLayerTransform(); |
592 void updateLayerTreeDeviceScaleFactor(); | 592 void updateLayerTreeDeviceScaleFactor(); |
593 | 593 |
594 // Helper function: Widens the width of |source| by the specified margins | 594 // Helper function: Widens the width of |source| by the specified margins |
595 // while keeping it smaller than page width. | 595 // while keeping it smaller than page width. |
596 WebRect widenRectWithinPageBounds(const WebRect& source, int targetMargin, i
nt minimumMargin); | 596 WebRect widenRectWithinPageBounds(const WebRect& source, int targetMargin, i
nt minimumMargin); |
597 | 597 |
598 void pointerLockMouseEvent(const WebInputEvent&); | 598 void pointerLockMouseEvent(const WebInputEvent&); |
599 | 599 |
600 // PageWidgetEventHandler functions | 600 // PageWidgetEventHandler functions |
601 virtual void handleMouseLeave(LocalFrame&, const WebMouseEvent&) override; | 601 void handleMouseLeave(LocalFrame&, const WebMouseEvent&) override; |
602 virtual void handleMouseDown(LocalFrame&, const WebMouseEvent&) override; | 602 void handleMouseDown(LocalFrame&, const WebMouseEvent&) override; |
603 virtual void handleMouseUp(LocalFrame&, const WebMouseEvent&) override; | 603 void handleMouseUp(LocalFrame&, const WebMouseEvent&) override; |
604 virtual bool handleMouseWheel(LocalFrame&, const WebMouseWheelEvent&) overri
de; | 604 bool handleMouseWheel(LocalFrame&, const WebMouseWheelEvent&) override; |
605 virtual bool handleGestureEvent(const WebGestureEvent&) override; | 605 bool handleGestureEvent(const WebGestureEvent&) override; |
606 virtual bool handleKeyEvent(const WebKeyboardEvent&) override; | 606 bool handleKeyEvent(const WebKeyboardEvent&) override; |
607 virtual bool handleCharEvent(const WebKeyboardEvent&) override; | 607 bool handleCharEvent(const WebKeyboardEvent&) override; |
608 | 608 |
609 bool handleSyntheticWheelFromTouchpadPinchEvent(const WebGestureEvent&); | 609 bool handleSyntheticWheelFromTouchpadPinchEvent(const WebGestureEvent&); |
610 | 610 |
611 WebPlugin* focusedPluginIfInputMethodSupported(LocalFrame*); | 611 WebPlugin* focusedPluginIfInputMethodSupported(LocalFrame*); |
612 | 612 |
613 void enablePopupMouseWheelEventListener(); | 613 void enablePopupMouseWheelEventListener(); |
614 void disablePopupMouseWheelEventListener(); | 614 void disablePopupMouseWheelEventListener(); |
615 | 615 |
616 void cancelPagePopup(); | 616 void cancelPagePopup(); |
617 | 617 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 }; | 754 }; |
755 | 755 |
756 DEFINE_TYPE_CASTS(WebViewImpl, WebWidget, widget, widget->isWebView(), widget.is
WebView()); | 756 DEFINE_TYPE_CASTS(WebViewImpl, WebWidget, widget, widget->isWebView(), widget.is
WebView()); |
757 // We have no ways to check if the specified WebView is an instance of | 757 // We have no ways to check if the specified WebView is an instance of |
758 // WebViewImpl because WebViewImpl is the only implementation of WebView. | 758 // WebViewImpl because WebViewImpl is the only implementation of WebView. |
759 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); | 759 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); |
760 | 760 |
761 } // namespace blink | 761 } // namespace blink |
762 | 762 |
763 #endif | 763 #endif |
OLD | NEW |