1 | /* |
2 | * Copyright (C) 2010-2016 Apple Inc. All rights reserved. |
3 | * |
4 | * Redistribution and use in source and binary forms, with or without |
5 | * modification, are permitted provided that the following conditions |
6 | * are met: |
7 | * 1. Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. |
9 | * 2. Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. |
12 | * |
13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' |
14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
23 | * THE POSSIBILITY OF SUCH DAMAGE. |
24 | */ |
25 | |
26 | #pragma once |
27 | |
28 | #include "LayerTreeContext.h" |
29 | #include "SameDocumentNavigationType.h" |
30 | #include "ShareableBitmap.h" |
31 | #include "WebColorPicker.h" |
32 | #include "WebDataListSuggestionsDropdown.h" |
33 | #include "WebPopupMenuProxy.h" |
34 | #include <WebCore/ActivityState.h> |
35 | #include <WebCore/AlternativeTextClient.h> |
36 | #include <WebCore/DragActions.h> |
37 | #include <WebCore/EditorClient.h> |
38 | #include <WebCore/FocusDirection.h> |
39 | #include <WebCore/InputMode.h> |
40 | #include <WebCore/UserInterfaceLayoutDirection.h> |
41 | #include <WebCore/ValidationBubble.h> |
42 | #include <wtf/CompletionHandler.h> |
43 | #include <wtf/Forward.h> |
44 | #include <wtf/URL.h> |
45 | #include <wtf/Variant.h> |
46 | #include <wtf/WeakPtr.h> |
47 | |
48 | #if PLATFORM(COCOA) |
49 | #include "PluginComplexTextInputState.h" |
50 | #include "RemoteLayerTreeNode.h" |
51 | #include "WKFoundation.h" |
52 | |
53 | OBJC_CLASS CALayer; |
54 | OBJC_CLASS NSFileWrapper; |
55 | OBJC_CLASS NSMenu; |
56 | OBJC_CLASS NSSet; |
57 | OBJC_CLASS UIGestureRecognizer; |
58 | OBJC_CLASS WKDrawingView; |
59 | OBJC_CLASS _WKRemoteObjectRegistry; |
60 | |
61 | #if USE(APPKIT) |
62 | OBJC_CLASS WKView; |
63 | OBJC_CLASS NSTextAlternatives; |
64 | #endif |
65 | #endif |
66 | |
67 | namespace API { |
68 | class Attachment; |
69 | class HitTestResult; |
70 | class Object; |
71 | class OpenPanelParameters; |
72 | class SecurityOrigin; |
73 | } |
74 | |
75 | namespace IPC { |
76 | class DataReference; |
77 | } |
78 | |
79 | namespace WebCore { |
80 | class Color; |
81 | class Cursor; |
82 | class FloatQuad; |
83 | class Region; |
84 | class TextIndicator; |
85 | class WebMediaSessionManager; |
86 | |
87 | #if PLATFORM(GTK) |
88 | class SelectionData; |
89 | #endif |
90 | |
91 | enum class RouteSharingPolicy : uint8_t; |
92 | enum class ScrollbarStyle : uint8_t; |
93 | enum class TextIndicatorWindowLifetime : uint8_t; |
94 | enum class TextIndicatorWindowDismissalAnimation : uint8_t; |
95 | enum class DOMPasteAccessResponse : uint8_t; |
96 | |
97 | struct ; |
98 | struct Highlight; |
99 | struct TextIndicatorData; |
100 | struct ViewportAttributes; |
101 | struct ShareDataWithParsedURL; |
102 | |
103 | template <typename> class RectEdges; |
104 | using FloatBoxExtent = RectEdges<float>; |
105 | |
106 | #if ENABLE(DRAG_SUPPORT) |
107 | struct DragItem; |
108 | #endif |
109 | } |
110 | |
111 | namespace WebKit { |
112 | |
113 | enum class UndoOrRedo : bool; |
114 | |
115 | class ; |
116 | class DownloadProxy; |
117 | class DrawingAreaProxy; |
118 | class NativeWebGestureEvent; |
119 | class NativeWebKeyboardEvent; |
120 | class NativeWebMouseEvent; |
121 | class NativeWebWheelEvent; |
122 | class RemoteLayerTreeTransaction; |
123 | class SafeBrowsingWarning; |
124 | class UserData; |
125 | class ViewSnapshot; |
126 | class WebBackForwardListItem; |
127 | class ; |
128 | class WebEditCommandProxy; |
129 | class WebFrameProxy; |
130 | class WebOpenPanelResultListenerProxy; |
131 | class WebPageProxy; |
132 | class ; |
133 | class WebProcessProxy; |
134 | |
135 | enum class ContinueUnsafeLoad : bool { No, Yes }; |
136 | |
137 | struct FocusedElementInformation; |
138 | struct InteractionInformationAtPosition; |
139 | struct WebAutocorrectionContext; |
140 | struct WebHitTestResultData; |
141 | |
142 | #if ENABLE(TOUCH_EVENTS) |
143 | class NativeWebTouchEvent; |
144 | #endif |
145 | |
146 | #if ENABLE(INPUT_TYPE_COLOR) |
147 | class WebColorPicker; |
148 | #endif |
149 | |
150 | #if ENABLE(DATALIST_ELEMENT) |
151 | class WebDataListSuggestionsDropdown; |
152 | #endif |
153 | |
154 | #if ENABLE(FULLSCREEN_API) |
155 | class WebFullScreenManagerProxyClient; |
156 | #endif |
157 | |
158 | #if USE(GSTREAMER) |
159 | class InstallMissingMediaPluginsPermissionRequest; |
160 | #endif |
161 | |
162 | #if PLATFORM(COCOA) |
163 | struct ColorSpaceData; |
164 | #endif |
165 | |
166 | #if HAVE(VISIBILITY_PROPAGATION_VIEW) |
167 | using LayerHostingContextID = uint32_t; |
168 | #endif |
169 | |
170 | class PageClient : public CanMakeWeakPtr<PageClient> { |
171 | public: |
172 | virtual ~PageClient() { } |
173 | |
174 | // Create a new drawing area proxy for the given page. |
175 | virtual std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy(WebProcessProxy&) = 0; |
176 | |
177 | // Tell the view to invalidate the given region. The region is in view coordinates. |
178 | virtual void setViewNeedsDisplay(const WebCore::Region&) = 0; |
179 | |
180 | // Tell the view to scroll to the given position, and whether this was a programmatic scroll. |
181 | virtual void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin) = 0; |
182 | |
183 | // Return the current scroll position (not necessarily the same as the WebCore scroll position, because of scaling, insets etc.) |
184 | virtual WebCore::FloatPoint viewScrollPosition() = 0; |
185 | |
186 | // Return the size of the view the page is associated with. |
187 | virtual WebCore::IntSize viewSize() = 0; |
188 | |
189 | // Return whether the view's containing window is active. |
190 | virtual bool isViewWindowActive() = 0; |
191 | |
192 | // Return whether the view is focused. |
193 | virtual bool isViewFocused() = 0; |
194 | |
195 | // Return whether the view is visible. |
196 | virtual bool isViewVisible() = 0; |
197 | |
198 | // Return whether the view is visible, or occluded by another window. |
199 | virtual bool isViewVisibleOrOccluded() { return isViewVisible(); } |
200 | |
201 | // Return whether the view is in a window. |
202 | virtual bool isViewInWindow() = 0; |
203 | |
204 | // Return whether the view is visually idle. |
205 | virtual bool isVisuallyIdle() { return !isViewVisible(); } |
206 | |
207 | // Return the layer hosting mode for the view. |
208 | virtual LayerHostingMode viewLayerHostingMode() { return LayerHostingMode::InProcess; } |
209 | |
210 | virtual void processDidExit() = 0; |
211 | virtual void processWillSwap() { processDidExit(); } |
212 | virtual void didRelaunchProcess() = 0; |
213 | virtual void pageClosed() = 0; |
214 | |
215 | virtual void preferencesDidChange() = 0; |
216 | |
217 | virtual void toolTipChanged(const String&, const String&) = 0; |
218 | |
219 | #if PLATFORM(IOS_FAMILY) |
220 | // FIXME: Adopt the WKUIDelegatePrivate callback on iOS and remove this. |
221 | virtual void decidePolicyForGeolocationPermissionRequest(WebFrameProxy&, API::SecurityOrigin&, Function<void(bool)>&) = 0; |
222 | #endif |
223 | |
224 | virtual void didStartProvisionalLoadForMainFrame() { }; |
225 | virtual void didFailProvisionalLoadForMainFrame() { }; |
226 | virtual void didCommitLoadForMainFrame(const String& mimeType, bool useCustomContentProvider) = 0; |
227 | |
228 | virtual void handleDownloadRequest(DownloadProxy&) = 0; |
229 | |
230 | virtual bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, API::OpenPanelParameters*, WebOpenPanelResultListenerProxy*) { return false; } |
231 | virtual bool showShareSheet(const WebCore::ShareDataWithParsedURL&, WTF::CompletionHandler<void (bool)>&&) { return false; } |
232 | |
233 | virtual void didChangeContentSize(const WebCore::IntSize&) = 0; |
234 | |
235 | virtual void showSafeBrowsingWarning(const SafeBrowsingWarning&, CompletionHandler<void(Variant<ContinueUnsafeLoad, URL>&&)>&& completionHandler) { completionHandler(ContinueUnsafeLoad::Yes); } |
236 | virtual void clearSafeBrowsingWarning() { } |
237 | virtual void clearSafeBrowsingWarningIfForMainFrameNavigation() { } |
238 | |
239 | #if ENABLE(DRAG_SUPPORT) |
240 | #if PLATFORM(GTK) |
241 | virtual void startDrag(Ref<WebCore::SelectionData>&&, WebCore::DragOperation, RefPtr<ShareableBitmap>&& dragImage) = 0; |
242 | #else |
243 | virtual void startDrag(const WebCore::DragItem&, const ShareableBitmap::Handle&) { } |
244 | #endif |
245 | virtual void didPerformDragOperation(bool) { } |
246 | #endif // ENABLE(DRAG_SUPPORT) |
247 | |
248 | virtual void setCursor(const WebCore::Cursor&) = 0; |
249 | virtual void setCursorHiddenUntilMouseMoves(bool) = 0; |
250 | virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&) = 0; |
251 | |
252 | virtual void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo) = 0; |
253 | virtual void clearAllEditCommands() = 0; |
254 | virtual bool canUndoRedo(UndoOrRedo) = 0; |
255 | virtual void executeUndoRedo(UndoOrRedo) = 0; |
256 | virtual void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) = 0; |
257 | #if PLATFORM(COCOA) |
258 | virtual void accessibilityWebProcessTokenReceived(const IPC::DataReference&) = 0; |
259 | virtual bool executeSavedCommandBySelector(const String& selector) = 0; |
260 | virtual void updateSecureInputState() = 0; |
261 | virtual void resetSecureInputState() = 0; |
262 | virtual void notifyInputContextAboutDiscardedComposition() = 0; |
263 | virtual void makeFirstResponder() = 0; |
264 | virtual void assistiveTechnologyMakeFirstResponder() = 0; |
265 | virtual void setRemoteLayerTreeRootNode(RemoteLayerTreeNode*) = 0; |
266 | virtual CALayer *acceleratedCompositingRootLayer() const = 0; |
267 | #if ENABLE(MAC_GESTURE_EVENTS) |
268 | virtual void gestureEventWasNotHandledByWebCore(const NativeWebGestureEvent&) = 0; |
269 | #endif |
270 | #endif |
271 | |
272 | #if PLATFORM(COCOA) || PLATFORM(GTK) |
273 | virtual void selectionDidChange() = 0; |
274 | virtual RefPtr<ViewSnapshot> takeViewSnapshot() = 0; |
275 | #endif |
276 | |
277 | #if USE(APPKIT) |
278 | virtual void setPromisedDataForImage(const String& pasteboardName, Ref<WebCore::SharedBuffer>&& imageBuffer, const String& filename, const String& extension, const String& title, const String& url, const String& visibleUrl, RefPtr<WebCore::SharedBuffer>&& archiveBuffer) = 0; |
279 | #endif |
280 | |
281 | virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) = 0; |
282 | virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) = 0; |
283 | virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) = 0; |
284 | virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) = 0; |
285 | virtual WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&) = 0; |
286 | virtual WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&) = 0; |
287 | #if PLATFORM(MAC) |
288 | virtual WebCore::IntRect rootViewToWindow(const WebCore::IntRect&) = 0; |
289 | #endif |
290 | #if PLATFORM(IOS_FAMILY) |
291 | virtual void didNotHandleTapAsClick(const WebCore::IntPoint&) = 0; |
292 | virtual void didCompleteSyntheticClick() = 0; |
293 | #endif |
294 | |
295 | #if HAVE(VISIBILITY_PROPAGATION_VIEW) |
296 | virtual void didCreateContextForVisibilityPropagation(LayerHostingContextID) { } |
297 | #endif |
298 | |
299 | virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) = 0; |
300 | #if ENABLE(TOUCH_EVENTS) |
301 | virtual void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled) = 0; |
302 | #endif |
303 | |
304 | virtual RefPtr<WebPopupMenuProxy> (WebPageProxy&) = 0; |
305 | #if ENABLE(CONTEXT_MENUS) |
306 | virtual Ref<WebContextMenuProxy> (WebPageProxy&, ContextMenuContextData&&, const UserData&) = 0; |
307 | #endif |
308 | |
309 | #if ENABLE(INPUT_TYPE_COLOR) |
310 | virtual RefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&, Vector<WebCore::Color>&&) = 0; |
311 | #endif |
312 | |
313 | #if ENABLE(DATALIST_ELEMENT) |
314 | virtual RefPtr<WebDataListSuggestionsDropdown> createDataListSuggestionsDropdown(WebPageProxy&) = 0; |
315 | #endif |
316 | |
317 | #if PLATFORM(COCOA) |
318 | virtual Ref<WebCore::ValidationBubble> createValidationBubble(const String& message, const WebCore::ValidationBubble::Settings&) = 0; |
319 | #endif |
320 | |
321 | #if PLATFORM(COCOA) |
322 | virtual void setTextIndicator(Ref<WebCore::TextIndicator>, WebCore::TextIndicatorWindowLifetime) = 0; |
323 | virtual void clearTextIndicator(WebCore::TextIndicatorWindowDismissalAnimation) = 0; |
324 | virtual void setTextIndicatorAnimationProgress(float) = 0; |
325 | |
326 | virtual void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&) = 0; |
327 | #endif |
328 | |
329 | virtual bool effectiveAppearanceIsDark() const { return false; } |
330 | virtual bool effectiveAppearanceIsInactive() const { return false; } |
331 | |
332 | virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) = 0; |
333 | virtual void exitAcceleratedCompositingMode() = 0; |
334 | virtual void updateAcceleratedCompositingMode(const LayerTreeContext&) = 0; |
335 | |
336 | virtual void takeFocus(WebCore::FocusDirection) { } |
337 | |
338 | #if PLATFORM(MAC) |
339 | virtual void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus) = 0; |
340 | virtual void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState) = 0; |
341 | virtual void showCorrectionPanel(WebCore::AlternativeTextType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) = 0; |
342 | virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingAlternativeText) = 0; |
343 | virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingAlternativeText) = 0; |
344 | virtual void recordAutocorrectionResponse(WebCore::AutocorrectionResponse, const String& replacedString, const String& replacementString) = 0; |
345 | virtual void recommendedScrollbarStyleDidChange(WebCore::ScrollbarStyle) = 0; |
346 | virtual void handleControlledElementIDResponse(const String&) = 0; |
347 | |
348 | virtual CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const = 0; |
349 | |
350 | virtual ColorSpaceData colorSpace() = 0; |
351 | |
352 | virtual void showPlatformContextMenu(NSMenu *, WebCore::IntPoint) = 0; |
353 | |
354 | virtual void startWindowDrag() = 0; |
355 | virtual NSWindow *platformWindow() = 0; |
356 | virtual void setShouldSuppressFirstResponderChanges(bool) = 0; |
357 | |
358 | virtual NSView *inspectorAttachmentView() = 0; |
359 | virtual _WKRemoteObjectRegistry *remoteObjectRegistry() = 0; |
360 | |
361 | #if USE(APPKIT) |
362 | virtual void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize) = 0; |
363 | #if USE(DICTATION_ALTERNATIVES) |
364 | virtual uint64_t addDictationAlternatives(const RetainPtr<NSTextAlternatives>&) = 0; |
365 | virtual void removeDictationAlternatives(uint64_t dictationContext) = 0; |
366 | virtual void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext) = 0; |
367 | virtual Vector<String> dictationAlternatives(uint64_t dictationContext) = 0; |
368 | #endif // USE(DICTATION_ALTERNATIVES) |
369 | #if USE(INSERTION_UNDO_GROUPING) |
370 | virtual void registerInsertionUndoGrouping() = 0; |
371 | #endif // USE(INSERTION_UNDO_GROUPING) |
372 | #endif // USE(APPKIT) |
373 | virtual void setEditableElementIsFocused(bool) = 0; |
374 | #endif // PLATFORM(MAC) |
375 | |
376 | #if PLATFORM(IOS_FAMILY) |
377 | virtual void commitPotentialTapFailed() = 0; |
378 | virtual void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color&, const Vector<WebCore::FloatQuad>& highlightedQuads, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius, bool nodeHasBuiltInClickHandling) = 0; |
379 | |
380 | virtual void didCommitLayerTree(const RemoteLayerTreeTransaction&) = 0; |
381 | virtual void layerTreeCommitComplete() = 0; |
382 | |
383 | virtual void couldNotRestorePageState() = 0; |
384 | virtual void restorePageState(Optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale) = 0; |
385 | virtual void restorePageCenterAndScale(Optional<WebCore::FloatPoint> center, double scale) = 0; |
386 | |
387 | virtual void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, API::Object* userData) = 0; |
388 | virtual void elementDidBlur() = 0; |
389 | virtual void focusedElementDidChangeInputMode(WebCore::InputMode) = 0; |
390 | virtual void didReceiveEditorStateUpdateAfterFocus() = 0; |
391 | virtual bool isFocusingElement() = 0; |
392 | virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&, bool isCharEvent) = 0; |
393 | virtual void positionInformationDidChange(const InteractionInformationAtPosition&) = 0; |
394 | virtual void saveImageToLibrary(Ref<WebCore::SharedBuffer>&&) = 0; |
395 | virtual void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect, WebCore::RouteSharingPolicy, const String&) = 0; |
396 | virtual void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) = 0; |
397 | virtual void handleSmartMagnificationInformationForPotentialTap(uint64_t requestID, const WebCore::FloatRect& renderRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale) = 0; |
398 | virtual double minimumZoomScale() const = 0; |
399 | virtual WebCore::FloatRect documentRect() const = 0; |
400 | virtual void scrollingNodeScrollViewWillStartPanGesture() = 0; |
401 | virtual void scrollingNodeScrollViewDidScroll() = 0; |
402 | virtual void scrollingNodeScrollWillStartScroll() = 0; |
403 | virtual void scrollingNodeScrollDidEndScroll() = 0; |
404 | virtual Vector<String> mimeTypesWithCustomContentProviders() = 0; |
405 | |
406 | virtual void showInspectorHighlight(const WebCore::Highlight&) = 0; |
407 | virtual void hideInspectorHighlight() = 0; |
408 | |
409 | virtual void showInspectorIndication() = 0; |
410 | virtual void hideInspectorIndication() = 0; |
411 | |
412 | virtual void enableInspectorNodeSearch() = 0; |
413 | virtual void disableInspectorNodeSearch() = 0; |
414 | |
415 | virtual void handleAutocorrectionContext(const WebAutocorrectionContext&) = 0; |
416 | |
417 | virtual Seconds doubleTapForDoubleClickDelay() = 0; |
418 | virtual float doubleTapForDoubleClickRadius() = 0; |
419 | #endif |
420 | |
421 | // Auxiliary Client Creation |
422 | #if ENABLE(FULLSCREEN_API) |
423 | virtual WebFullScreenManagerProxyClient& fullScreenManagerProxyClient() = 0; |
424 | #endif |
425 | |
426 | // Custom representations. |
427 | virtual void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&) = 0; |
428 | |
429 | virtual void navigationGestureDidBegin() = 0; |
430 | virtual void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&) = 0; |
431 | virtual void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&) = 0; |
432 | virtual void navigationGestureDidEnd() = 0; |
433 | virtual void willRecordNavigationSnapshot(WebBackForwardListItem&) = 0; |
434 | virtual void didRemoveNavigationGestureSnapshot() = 0; |
435 | |
436 | virtual void didFirstVisuallyNonEmptyLayoutForMainFrame() = 0; |
437 | virtual void didFinishLoadForMainFrame() = 0; |
438 | virtual void didFailLoadForMainFrame() = 0; |
439 | virtual void didSameDocumentNavigationForMainFrame(SameDocumentNavigationType) = 0; |
440 | |
441 | virtual void didChangeBackgroundColor() = 0; |
442 | virtual void isPlayingAudioWillChange() = 0; |
443 | virtual void isPlayingAudioDidChange() = 0; |
444 | |
445 | virtual void pinnedStateWillChange() { } |
446 | virtual void pinnedStateDidChange() { } |
447 | virtual bool scrollingUpdatesDisabledForTesting() { return false; } |
448 | |
449 | virtual bool hasSafeBrowsingWarning() const { return false; } |
450 | |
451 | #if PLATFORM(MAC) |
452 | virtual void didPerformImmediateActionHitTest(const WebHitTestResultData&, bool contentPreventsDefault, API::Object*) = 0; |
453 | virtual NSObject *immediateActionAnimationControllerForHitTestResult(RefPtr<API::HitTestResult>, uint64_t, RefPtr<API::Object>) = 0; |
454 | virtual void didHandleAcceptedCandidate() = 0; |
455 | #endif |
456 | |
457 | virtual void didFinishProcessingAllPendingMouseEvents() = 0; |
458 | |
459 | virtual void videoControlsManagerDidChange() { } |
460 | |
461 | #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY) |
462 | virtual WebCore::WebMediaSessionManager& mediaSessionManager() = 0; |
463 | #endif |
464 | |
465 | virtual void refView() = 0; |
466 | virtual void derefView() = 0; |
467 | |
468 | #if ENABLE(VIDEO) && USE(GSTREAMER) |
469 | virtual bool decidePolicyForInstallMissingMediaPluginsPermissionRequest(InstallMissingMediaPluginsPermissionRequest&) = 0; |
470 | #endif |
471 | |
472 | virtual void didRestoreScrollPosition() = 0; |
473 | |
474 | virtual bool windowIsFrontWindowUnderMouse(const NativeWebMouseEvent&) { return false; } |
475 | |
476 | virtual WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() = 0; |
477 | |
478 | #if USE(QUICK_LOOK) |
479 | virtual void requestPasswordForQuickLookDocument(const String& fileName, WTF::Function<void(const String&)>&&) = 0; |
480 | #endif |
481 | |
482 | #if ENABLE(DATA_INTERACTION) |
483 | virtual void didHandleDragStartRequest(bool started) = 0; |
484 | virtual void didHandleAdditionalDragItemsRequest(bool added) = 0; |
485 | virtual void willReceiveEditDragSnapshot() = 0; |
486 | virtual void didReceiveEditDragSnapshot(Optional<WebCore::TextIndicatorData>) = 0; |
487 | virtual void didChangeDragCaretRect(const WebCore::IntRect& previousCaretRect, const WebCore::IntRect& caretRect) = 0; |
488 | #endif |
489 | |
490 | virtual void requestDOMPasteAccess(const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) = 0; |
491 | |
492 | #if ENABLE(ATTACHMENT_ELEMENT) |
493 | virtual void didInsertAttachment(API::Attachment&, const String& source) { } |
494 | virtual void didRemoveAttachment(API::Attachment&) { } |
495 | virtual void didInvalidateDataForAttachment(API::Attachment&) { } |
496 | #if PLATFORM(COCOA) |
497 | virtual NSFileWrapper *allocFileWrapperInstance() const { return nullptr; } |
498 | virtual NSSet *serializableFileWrapperClasses() const { return nullptr; } |
499 | #endif |
500 | #endif |
501 | |
502 | #if HAVE(PENCILKIT) |
503 | virtual RetainPtr<WKDrawingView> createDrawingView(WebCore::GraphicsLayer::EmbeddedViewID) { return nullptr; } |
504 | #endif |
505 | |
506 | #if ENABLE(POINTER_EVENTS) |
507 | virtual void cancelPointersForGestureRecognizer(UIGestureRecognizer*) { } |
508 | virtual WTF::Optional<unsigned> activeTouchIdentifierForGestureRecognizer(UIGestureRecognizer*) { return WTF::nullopt; } |
509 | #endif |
510 | |
511 | #if USE(WPE_RENDERER) |
512 | virtual IPC::Attachment hostFileDescriptor() = 0; |
513 | #endif |
514 | }; |
515 | |
516 | } // namespace WebKit |
517 | |