Add a layout mode that scales down the view to try to fit the document
[WebKit-https.git] / Source / WebKit2 / UIProcess / WebPageProxy.h
1 /*
2  * Copyright (C) 2010, 2011, 2014-2015 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 #ifndef WebPageProxy_h
27 #define WebPageProxy_h
28
29 #include "APIObject.h"
30 #include "APISession.h"
31 #include "AssistedNodeInformation.h"
32 #include "AutoCorrectionCallback.h"
33 #include "Connection.h"
34 #include "ContextMenuContextData.h"
35 #include "DragControllerAction.h"
36 #include "DrawingAreaProxy.h"
37 #include "EditingRange.h"
38 #include "EditorState.h"
39 #include "GeolocationPermissionRequestManagerProxy.h"
40 #include "InteractionInformationAtPosition.h"
41 #include "LayerTreeContext.h"
42 #include "MessageSender.h"
43 #include "NotificationPermissionRequestManagerProxy.h"
44 #include "PageLoadState.h"
45 #include "PlatformProcessIdentifier.h"
46 #include "ProcessThrottler.h"
47 #include "SandboxExtension.h"
48 #include "ShareableBitmap.h"
49 #include "UserMediaPermissionRequestManagerProxy.h"
50 #include "VisibleContentRectUpdateInfo.h"
51 #include "WKBase.h"
52 #include "WKPagePrivate.h"
53 #include "WebColorPicker.h"
54 #include "WebContextMenuItemData.h"
55 #include "WebCoreArgumentCoders.h"
56 #include "WebFindClient.h"
57 #include "WebFrameProxy.h"
58 #include "WebPageCreationParameters.h"
59 #include "WebPageDiagnosticLoggingClient.h"
60 #include "WebPageInjectedBundleClient.h"
61 #include "WebPreferences.h"
62 #include <WebCore/AlternativeTextClient.h> // FIXME: Needed by WebPageProxyMessages.h for DICTATION_ALTERNATIVES.
63 #include "WebPageProxyMessages.h"
64 #include "WebPopupMenuProxy.h"
65 #include "WebProcessLifetimeTracker.h"
66 #include <WebCore/Color.h>
67 #include <WebCore/DragActions.h>
68 #include <WebCore/HitTestResult.h>
69 #include <WebCore/MediaProducer.h>
70 #include <WebCore/Page.h>
71 #include <WebCore/PlatformScreen.h>
72 #include <WebCore/ScrollTypes.h>
73 #include <WebCore/TextChecking.h>
74 #include <WebCore/TextGranularity.h>
75 #include <WebCore/ViewState.h>
76 #include <WebCore/VisibleSelection.h>
77 #include <memory>
78 #include <wtf/HashMap.h>
79 #include <wtf/HashSet.h>
80 #include <wtf/PassRefPtr.h>
81 #include <wtf/Ref.h>
82 #include <wtf/RefPtr.h>
83 #include <wtf/Vector.h>
84 #include <wtf/text/WTFString.h>
85
86 #if ENABLE(DRAG_SUPPORT)
87 #include <WebCore/DragActions.h>
88 #endif
89
90 #if ENABLE(TOUCH_EVENTS)
91 #include "NativeWebTouchEvent.h"
92 #endif
93
94 #if PLATFORM(EFL)
95 #include "WKPageEfl.h"
96 #include "WebUIPopupMenuClient.h"
97 #include <Evas.h>
98 #endif
99
100 #if PLATFORM(COCOA)
101 #include "LayerRepresentation.h"
102 #endif
103
104 #if PLATFORM(MAC)
105 #include "AttributedString.h"
106 #endif
107
108 #if PLATFORM(IOS)
109 #include "ProcessThrottler.h"
110 #endif
111
112 #if PLATFORM(GTK)
113 #include "ArgumentCodersGtk.h"
114 #endif
115
116 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
117 #include <WebCore/MediaPlaybackTargetPicker.h>
118 #include <WebCore/WebMediaSessionManagerClient.h>
119 #endif
120
121 namespace API {
122 class ContextMenuClient;
123 class FindClient;
124 class FormClient;
125 class HistoryClient;
126 class LoaderClient;
127 class Navigation;
128 class NavigationClient;
129 class PolicyClient;
130 class UIClient;
131 class URLRequest;
132 }
133
134 namespace IPC {
135 class ArgumentDecoder;
136 class Connection;
137 }
138
139 namespace WebCore {
140 class AuthenticationChallenge;
141 class Cursor;
142 class DragData;
143 class FloatRect;
144 class GraphicsLayer;
145 class IntSize;
146 class MediaConstraintsImpl;
147 class ProtectionSpace;
148 class RunLoopObserver;
149 class SharedBuffer;
150 class TextIndicator;
151 struct FileChooserSettings;
152 struct TextAlternativeWithRange;
153 struct TextCheckingResult;
154 struct ViewportAttributes;
155 struct WindowFeatures;
156 }
157
158 #if USE(APPKIT)
159 OBJC_CLASS WKView;
160 #endif
161
162 #if PLATFORM(GTK)
163 typedef GtkWidget* PlatformWidget;
164 #endif
165
166 namespace WebKit {
167
168 class CertificateInfo;
169 class NativeWebKeyboardEvent;
170 class NativeWebMouseEvent;
171 class NativeWebWheelEvent;
172 class PageClient;
173 class RemoteLayerTreeScrollingPerformanceData;
174 class RemoteLayerTreeTransaction;
175 class RemoteScrollingCoordinatorProxy;
176 class StringPairVector;
177 class UserData;
178 class ViewSnapshot;
179 class VisitedLinkProvider;
180 class WebBackForwardList;
181 class WebBackForwardListItem;
182 class WebContextMenuProxy;
183 class WebEditCommandProxy;
184 class WebFullScreenManagerProxy;
185 class WebNavigationState;
186 class WebVideoFullscreenManagerProxy;
187 class WebKeyboardEvent;
188 class WebMouseEvent;
189 class WebOpenPanelResultListenerProxy;
190 class WebPageGroup;
191 class WebProcessProxy;
192 class WebUserContentControllerProxy;
193 class WebWheelEvent;
194 class WebsiteDataStore;
195 struct AttributedString;
196 struct ColorSpaceData;
197 struct DictionaryPopupInfo;
198 struct EditingRange;
199 struct EditorState;
200 struct PlatformPopupMenuData;
201 struct PrintInfo;
202 struct WebPopupItem;
203
204 #if ENABLE(VIBRATION)
205 class WebVibrationProxy;
206 #endif
207
208 #if USE(QUICK_LOOK)
209 class QuickLookDocumentData;
210 #endif
211
212 typedef GenericCallback<uint64_t> UnsignedCallback;
213 typedef GenericCallback<EditingRange> EditingRangeCallback;
214 typedef GenericCallback<const String&> StringCallback;
215 typedef GenericCallback<API::SerializedScriptValue*> ScriptValueCallback;
216
217 #if PLATFORM(GTK)
218 typedef GenericCallback<API::Error*> PrintFinishedCallback;
219 #endif
220
221 #if ENABLE(TOUCH_EVENTS)
222 struct QueuedTouchEvents {
223     QueuedTouchEvents(const NativeWebTouchEvent& event)
224         : forwardedEvent(event)
225     {
226     }
227     NativeWebTouchEvent forwardedEvent;
228     Vector<NativeWebTouchEvent> deferredTouchEvents;
229 };
230 #endif
231
232 typedef GenericCallback<const String&, bool, int32_t> ValidateCommandCallback;
233 typedef GenericCallback<const WebCore::IntRect&, const EditingRange&> RectForCharacterRangeCallback;
234
235 #if PLATFORM(MAC)
236 typedef GenericCallback<const AttributedString&, const EditingRange&> AttributedStringForCharacterRangeCallback;
237 typedef GenericCallback<const String&, double, bool> FontAtSelectionCallback;
238 #endif
239
240 #if PLATFORM(IOS)
241 typedef GenericCallback<const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t> GestureCallback;
242 typedef GenericCallback<const WebCore::IntPoint&, uint32_t> TouchesCallback;
243 #endif
244
245 #if PLATFORM(COCOA)
246 typedef GenericCallback<const WebCore::MachSendRight&> MachSendRightCallback;
247 #endif
248
249 struct WebPageConfiguration {
250     WebPageGroup* pageGroup = nullptr;
251     WebPreferences* preferences = nullptr;
252     WebUserContentControllerProxy* userContentController = nullptr;
253     VisitedLinkProvider* visitedLinkProvider = nullptr;
254
255     WebsiteDataStore* websiteDataStore = nullptr;
256     // FIXME: We currently have to pass the session ID separately here to support the legacy private browsing session.
257     // Once we get rid of it we should get rid of this configuration parameter as well.
258     WebCore::SessionID sessionID;
259
260     WebPageProxy* relatedPage = nullptr;
261
262     bool treatsSHA1SignedCertificatesAsInsecure = false;
263
264     WebPreferencesStore::ValueMap preferenceValues;
265 };
266
267 class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page>
268 #if ENABLE(INPUT_TYPE_COLOR)
269     , public WebColorPicker::Client
270 #endif
271 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
272     , public WebCore::WebMediaSessionManagerClient
273 #endif
274     , public WebPopupMenuProxy::Client
275     , public IPC::MessageReceiver
276     , public IPC::MessageSender {
277 public:
278     static Ref<WebPageProxy> create(PageClient&, WebProcessProxy&, uint64_t pageID, const WebPageConfiguration&);
279     virtual ~WebPageProxy();
280
281     uint64_t pageID() const { return m_pageID; }
282     WebCore::SessionID sessionID() const { return m_sessionID; }
283     void setSessionID(WebCore::SessionID);
284
285     WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
286     WebFrameProxy* focusedFrame() const { return m_focusedFrame.get(); }
287     WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
288
289     DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); }
290
291     WebNavigationState& navigationState() { return *m_navigationState.get(); }
292
293     WebsiteDataStore& websiteDataStore() { return m_websiteDataStore; }
294
295 #if ENABLE(ASYNC_SCROLLING)
296     RemoteScrollingCoordinatorProxy* scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy.get(); }
297 #endif
298
299     WebBackForwardList& backForwardList() { return m_backForwardList; }
300
301     bool addsVisitedLinks() const { return m_addsVisitedLinks; }
302     void setAddsVisitedLinks(bool addsVisitedLinks) { m_addsVisitedLinks = addsVisitedLinks; }
303
304     void fullscreenMayReturnToInline();
305     void didEnterFullscreen();
306     void didExitFullscreen();
307
308     WebInspectorProxy* inspector();
309
310 #if ENABLE(REMOTE_INSPECTOR)
311     bool allowsRemoteInspection() const { return m_allowsRemoteInspection; }
312     void setAllowsRemoteInspection(bool);
313 #endif
314
315 #if ENABLE(VIBRATION)
316     WebVibrationProxy* vibration() { return m_vibration.get(); }
317 #endif
318
319 #if ENABLE(FULLSCREEN_API)
320     WebFullScreenManagerProxy* fullScreenManager();
321 #endif
322 #if PLATFORM(IOS)
323     RefPtr<WebVideoFullscreenManagerProxy> videoFullscreenManager();
324 #endif
325
326 #if ENABLE(CONTEXT_MENUS)
327     void setContextMenuClient(std::unique_ptr<API::ContextMenuClient>);
328 #endif
329     API::FindClient& findClient() { return *m_findClient; }
330     void setFindClient(std::unique_ptr<API::FindClient>);
331     API::DiagnosticLoggingClient& diagnosticLoggingClient() { return *m_diagnosticLoggingClient; }
332     void setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>);
333     void initializeFindMatchesClient(const WKPageFindMatchesClientBase*);
334     void setFormClient(std::unique_ptr<API::FormClient>);
335     void setNavigationClient(std::unique_ptr<API::NavigationClient>);
336     void setHistoryClient(std::unique_ptr<API::HistoryClient>);
337     void setLoaderClient(std::unique_ptr<API::LoaderClient>);
338     void setPolicyClient(std::unique_ptr<API::PolicyClient>);
339     void setInjectedBundleClient(const WKPageInjectedBundleClientBase*);
340     WebPageInjectedBundleClient* injectedBundleClient() { return m_injectedBundleClient.get(); }
341
342     API::UIClient& uiClient() { return *m_uiClient; }
343     void setUIClient(std::unique_ptr<API::UIClient>);
344 #if PLATFORM(EFL)
345     void initializeUIPopupMenuClient(const WKPageUIPopupMenuClientBase*);
346 #endif
347
348     void initializeWebPage();
349
350     void close();
351     bool tryClose();
352     bool isClosed() const { return m_isClosed; }
353
354     RefPtr<API::Navigation> loadRequest(const WebCore::ResourceRequest&, API::Object* userData = nullptr);
355     RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
356     RefPtr<API::Navigation> loadData(API::Data*, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
357     RefPtr<API::Navigation> loadHTMLString(const String& htmlString, const String& baseURL, API::Object* userData = nullptr);
358     void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, API::Object* userData = nullptr);
359     void loadPlainTextString(const String&, API::Object* userData = nullptr);
360     void loadWebArchiveData(API::Data*, API::Object* userData = nullptr);
361     void navigateToURLWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
362
363     void stopLoading();
364     RefPtr<API::Navigation> reload(bool reloadFromOrigin);
365
366     RefPtr<API::Navigation> goForward();
367     RefPtr<API::Navigation> goBack();
368
369     RefPtr<API::Navigation> goToBackForwardItem(WebBackForwardListItem*);
370     void tryRestoreScrollPosition();
371     void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<RefPtr<WebBackForwardListItem>> removed);
372     void willGoToBackForwardListItem(uint64_t itemID, const UserData&);
373
374     bool shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem*);
375
376     bool willHandleHorizontalScrollEvents() const;
377
378     bool canShowMIMEType(const String& mimeType);
379
380     bool drawsBackground() const { return m_drawsBackground; }
381     void setDrawsBackground(bool);
382
383     bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
384     void setDrawsTransparentBackground(bool);
385
386     float topContentInset() const { return m_topContentInset; }
387     void setTopContentInset(float);
388
389     WebCore::Color underlayColor() const { return m_underlayColor; }
390     void setUnderlayColor(const WebCore::Color&);
391
392     // At this time, m_pageExtendedBackgroundColor can be set via pageExtendedBackgroundColorDidChange() which is a message
393     // from the UIProcess, or by didCommitLayerTree(). When PLATFORM(MAC) adopts UI side compositing, we should get rid of
394     // the message entirely.
395     WebCore::Color pageExtendedBackgroundColor() const { return m_pageExtendedBackgroundColor; }
396
397     void viewWillStartLiveResize();
398     void viewWillEndLiveResize();
399
400     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, std::function<void (CallbackBase::Error)>);
401     void setWindowResizerSize(const WebCore::IntSize&);
402     
403     void clearSelection();
404     void restoreSelectionInFocusedEditableElement();
405
406     void setViewNeedsDisplay(const WebCore::IntRect&);
407     void displayView();
408     bool canScrollView();
409     void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset); // FIXME: CoordinatedGraphics should use requestScroll().
410     void requestScroll(const WebCore::FloatPoint& scrollPosition, bool isProgrammaticScroll);
411     
412     void setDelegatesScrolling(bool delegatesScrolling) { m_delegatesScrolling = delegatesScrolling; }
413     bool delegatesScrolling() const { return m_delegatesScrolling; }
414
415     enum class ViewStateChangeDispatchMode { Deferrable, Immediate };
416     void viewStateDidChange(WebCore::ViewState::Flags mayHaveChanged, bool wantsSynchronousReply = false, ViewStateChangeDispatchMode = ViewStateChangeDispatchMode::Deferrable);
417     bool isInWindow() const { return m_viewState & WebCore::ViewState::IsInWindow; }
418     void waitForDidUpdateViewState();
419     void didUpdateViewState() { m_waitingForDidUpdateViewState = false; }
420
421     void layerHostingModeDidChange();
422
423     WebCore::IntSize viewSize() const;
424     bool isViewVisible() const { return m_viewState & WebCore::ViewState::IsVisible; }
425     bool isViewWindowActive() const;
426
427     void addMIMETypeWithCustomContentProvider(const String& mimeType);
428
429     void executeEditCommand(const String& commandName);
430     void validateCommand(const String& commandName, std::function<void (const String&, bool, int32_t, CallbackBase::Error)>);
431
432     const EditorState& editorState() const { return m_editorState; }
433     bool canDelete() const { return hasSelectedRange() && isContentEditable(); }
434     bool hasSelectedRange() const { return m_editorState.selectionIsRange; }
435     bool isContentEditable() const { return m_editorState.isContentEditable; }
436     
437     bool maintainsInactiveSelection() const { return m_maintainsInactiveSelection; }
438     void setMaintainsInactiveSelection(bool);
439     void setEditable(bool);
440     bool isEditable() const { return m_isEditable; }
441
442 #if PLATFORM(IOS)
443     void executeEditCommand(const String& commandName, std::function<void (CallbackBase::Error)>);
444     double displayedContentScale() const { return m_lastVisibleContentRectUpdate.scale(); }
445     const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedRect(); }
446     const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredRect(); }
447
448     void updateVisibleContentRects(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate);
449     void resendLastVisibleContentRects();
450
451     enum class UnobscuredRectConstraint { ConstrainedToDocumentRect, Unconstrained };
452     WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, double displayedContentScale, UnobscuredRectConstraint = UnobscuredRectConstraint::Unconstrained) const;
453     void overflowScrollViewWillStartPanGesture();
454     void overflowScrollViewDidScroll();
455     void overflowScrollWillStartScroll();
456     void overflowScrollDidEndScroll();
457
458     void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, double targetScale, int32_t deviceOrientation);
459     void synchronizeDynamicViewportUpdate();
460
461     void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&);
462     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
463     void setDeviceOrientation(int32_t);
464     int32_t deviceOrientation() const { return m_deviceOrientation; }
465     void willCommitLayerTree(uint64_t transactionID);
466
467     void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>);
468     void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, std::function<void (const WebCore::IntPoint&, uint32_t, CallbackBase::Error)>);
469     void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>);
470     void updateBlockSelectionWithTouch(const WebCore::IntPoint, uint32_t touch, uint32_t handlePosition);
471     void extendSelection(WebCore::TextGranularity);
472     void selectWordBackward();
473     void moveSelectionByOffset(int32_t offset, std::function<void (CallbackBase::Error)>);
474     void selectTextWithGranularityAtPoint(const WebCore::IntPoint, WebCore::TextGranularity, std::function<void (CallbackBase::Error)>);
475     void selectPositionAtPoint(const WebCore::IntPoint, std::function<void (CallbackBase::Error)>);
476     void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint, WebCore::TextGranularity, WebCore::SelectionDirection, std::function<void (CallbackBase::Error)>);
477     void moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity, WebCore::SelectionDirection, std::function<void(CallbackBase::Error)>);
478     void beginSelectionInDirection(WebCore::SelectionDirection, std::function<void (uint64_t, CallbackBase::Error)>);
479     void updateSelectionWithExtentPoint(const WebCore::IntPoint, std::function<void (uint64_t, CallbackBase::Error)>);
480     void requestAutocorrectionData(const String& textForAutocorrection, std::function<void (const Vector<WebCore::FloatRect>&, const String&, double, uint64_t, CallbackBase::Error)>);
481     void applyAutocorrection(const String& correction, const String& originalText, std::function<void (const String&, CallbackBase::Error)>);
482     bool applyAutocorrection(const String& correction, const String& originalText);
483     void requestAutocorrectionContext(std::function<void (const String&, const String&, const String&, const String&, uint64_t, uint64_t, CallbackBase::Error)>);
484     void getAutocorrectionContext(String& contextBefore, String& markedText, String& selectedText, String& contextAfter, uint64_t& location, uint64_t& length);
485     void requestDictationContext(std::function<void (const String&, const String&, const String&, CallbackBase::Error)>);
486     void replaceDictatedText(const String& oldText, const String& newText);
487     void replaceSelectedText(const String& oldText, const String& newText);
488     void didReceivePositionInformation(const InteractionInformationAtPosition&);
489     void getPositionInformation(const WebCore::IntPoint&, InteractionInformationAtPosition&);
490     void requestPositionInformation(const WebCore::IntPoint&);
491     void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
492     void stopInteraction();
493     void performActionOnElement(uint32_t action);
494     void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize);
495     void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold);
496     void focusNextAssistedNode(bool isForward, std::function<void (CallbackBase::Error)>);
497     void setAssistedNodeValue(const String&);
498     void setAssistedNodeValueAsNumber(double);
499     void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection = false);
500
501     void applicationWillEnterForeground();
502     void applicationDidEnterBackground();
503     void applicationWillResignActive();
504     void applicationDidBecomeActive();
505
506     void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
507     void commitPotentialTapFailed();
508     void didNotHandleTapAsClick(const WebCore::IntPoint&);
509     void viewportMetaTagWidthDidChange(float width);
510     void didFinishDrawingPagesToPDF(const IPC::DataReference&);
511     void contentSizeCategoryDidChange(const String& contentSizeCategory);
512     void getLookupContextAtPoint(const WebCore::IntPoint&, std::function<void(const String&, CallbackBase::Error)>);
513 #endif
514
515     void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);
516
517 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
518     void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
519 #endif
520 #if PLATFORM(EFL)
521     void setThemePath(const String&);
522 #endif
523
524 #if PLATFORM(GTK)
525     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
526     void confirmComposition(const String& compositionString, int64_t selectionStart, int64_t selectionLength);
527     void cancelComposition();
528 #endif
529
530 #if PLATFORM(GTK)
531     void setInputMethodState(bool enabled);
532 #endif
533
534 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
535     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& center);
536 #endif
537
538 #if PLATFORM(COCOA)
539     void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
540     void setMainFrameIsScrollable(bool);
541
542     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
543     bool shouldDelayWindowOrderingForEvent(const WebMouseEvent&);
544     bool acceptsFirstMouse(int eventNumber, const WebMouseEvent&);
545
546     void setAcceleratedCompositingRootLayer(LayerOrView*);
547     LayerOrView* acceleratedCompositingRootLayer() const;
548
549     void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false);
550     void getMarkedRangeAsync(std::function<void (EditingRange, CallbackBase::Error)>);
551     void getSelectedRangeAsync(std::function<void (EditingRange, CallbackBase::Error)>);
552     void characterIndexForPointAsync(const WebCore::IntPoint&, std::function<void (uint64_t, CallbackBase::Error)>);
553     void firstRectForCharacterRangeAsync(const EditingRange&, std::function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)>);
554     void setCompositionAsync(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
555     void confirmCompositionAsync();
556
557     void setScrollPerformanceDataCollectionEnabled(bool);
558     bool scrollPerformanceDataCollectionEnabled() const { return m_scrollPerformanceDataCollectionEnabled; }
559     RemoteLayerTreeScrollingPerformanceData* scrollingPerformanceData() { return m_scrollingPerformanceData.get(); }
560 #endif // PLATFORM(COCOA)
561
562 #if PLATFORM(MAC)
563     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives, bool registerUndoGroup);
564     void attributedSubstringForCharacterRangeAsync(const EditingRange&, std::function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)>);
565     void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits);
566     void fontAtSelection(std::function<void (const String&, double, bool, CallbackBase::Error)>);
567
568 #if !USE(ASYNC_NSTEXTINPUTCLIENT)
569     bool insertText(const String& text, const EditingRange& replacementRange);
570     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
571     void confirmComposition();
572     bool insertDictatedText(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives);
573     void getAttributedSubstringFromRange(const EditingRange&, AttributedString&);
574     void getMarkedRange(EditingRange&);
575     void getSelectedRange(EditingRange&);
576     uint64_t characterIndexForPoint(const WebCore::IntPoint);
577     WebCore::IntRect firstRectForCharacterRange(const EditingRange&);
578     bool executeKeypressCommands(const Vector<WebCore::KeypressCommand>&);
579     void cancelComposition();
580 #endif // !USE(ASYNC_NSTEXTINPUTCLIENT)
581
582     WKView* wkView() const;
583     void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize);
584     CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const;
585 #endif // PLATFORM(MAC)
586
587 #if PLATFORM(EFL)
588     void handleInputMethodKeydown(bool& handled);
589     void confirmComposition(const String&);
590     void setComposition(const String&, Vector<WebCore::CompositionUnderline>&, int);
591     void cancelComposition();
592 #endif
593
594 #if PLATFORM(GTK)
595     PlatformWidget viewWidget();
596     const WebCore::Color& backgroundColor() const { return m_backgroundColor; }
597     void setBackgroundColor(const WebCore::Color& color) { m_backgroundColor = color; }
598 #endif
599
600 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
601     void commitPageTransitionViewport();
602 #endif
603
604     void handleMouseEvent(const NativeWebMouseEvent&);
605     void handleWheelEvent(const NativeWebWheelEvent&);
606     void handleKeyboardEvent(const NativeWebKeyboardEvent&);
607
608 #if ENABLE(IOS_TOUCH_EVENTS)
609     void handleTouchEventSynchronously(const NativeWebTouchEvent&);
610     void handleTouchEventAsynchronously(const NativeWebTouchEvent&);
611
612 #elif ENABLE(TOUCH_EVENTS)
613     void handleTouchEvent(const NativeWebTouchEvent&);
614 #endif
615
616     void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
617     void centerSelectionInVisibleArea();
618
619     const String& toolTip() const { return m_toolTip; }
620
621     const String& userAgent() const { return m_userAgent; }
622     void setApplicationNameForUserAgent(const String&);
623     const String& applicationNameForUserAgent() const { return m_applicationNameForUserAgent; }
624     void setCustomUserAgent(const String&);
625     const String& customUserAgent() const { return m_customUserAgent; }
626     static String standardUserAgent(const String& applicationName = String());
627
628     bool supportsTextEncoding() const;
629     void setCustomTextEncodingName(const String&);
630     String customTextEncodingName() const { return m_customTextEncodingName; }
631
632     bool areActiveDOMObjectsAndAnimationsSuspended() const { return m_isPageSuspended; }
633     void resumeActiveDOMObjectsAndAnimations();
634     void suspendActiveDOMObjectsAndAnimations();
635
636     double estimatedProgress() const;
637
638     void terminateProcess();
639
640     SessionState sessionState(const std::function<bool (WebBackForwardListItem&)>& = nullptr) const;
641     RefPtr<API::Navigation> restoreFromSessionState(SessionState, bool navigate);
642
643     bool supportsTextZoom() const;
644     double textZoomFactor() const { return m_textZoomFactor; }
645     void setTextZoomFactor(double);
646     double pageZoomFactor() const;
647     void setPageZoomFactor(double);
648     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
649
650     void scalePage(double scale, const WebCore::IntPoint& origin);
651     void scalePageInViewCoordinates(double scale, const WebCore::IntPoint& centerInViewCoordinates);
652     double pageScaleFactor() const;
653     double viewScaleFactor() const { return m_viewScaleFactor; }
654     void scaleView(double scale);
655 #if PLATFORM(COCOA)
656     void scaleViewAndUpdateGeometryFenced(double scale, WebCore::IntSize viewSize, std::function<void (const WebCore::MachSendRight&, CallbackBase::Error)>);
657 #endif
658     void setShouldScaleViewToFitDocument(bool);
659
660     float deviceScaleFactor() const;
661     void setIntrinsicDeviceScaleFactor(float);
662     void setCustomDeviceScaleFactor(float);
663     void windowScreenDidChange(PlatformDisplayID);
664
665     void setUseFixedLayout(bool);
666     void setFixedLayoutSize(const WebCore::IntSize&);
667     bool useFixedLayout() const { return m_useFixedLayout; };
668     const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
669
670     void listenForLayoutMilestones(WebCore::LayoutMilestones);
671
672     bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
673     bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
674
675     void setSuppressScrollbarAnimations(bool);
676     bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
677
678     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
679     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
680     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
681     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
682
683     bool rubberBandsAtLeft() const;
684     void setRubberBandsAtLeft(bool);
685     bool rubberBandsAtRight() const;
686     void setRubberBandsAtRight(bool);
687     bool rubberBandsAtTop() const;
688     void setRubberBandsAtTop(bool);
689     bool rubberBandsAtBottom() const;
690     void setRubberBandsAtBottom(bool);
691
692     void setShouldUseImplicitRubberBandControl(bool shouldUseImplicitRubberBandControl) { m_shouldUseImplicitRubberBandControl = shouldUseImplicitRubberBandControl; }
693     bool shouldUseImplicitRubberBandControl() const { return m_shouldUseImplicitRubberBandControl; }
694         
695     void setEnableVerticalRubberBanding(bool);
696     bool verticalRubberBandingIsEnabled() const;
697     void setEnableHorizontalRubberBanding(bool);
698     bool horizontalRubberBandingIsEnabled() const;
699         
700     void setBackgroundExtendsBeyondPage(bool);
701     bool backgroundExtendsBeyondPage() const;
702
703     void setPaginationMode(WebCore::Pagination::Mode);
704     WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
705     void setPaginationBehavesLikeColumns(bool);
706     bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
707     void setPageLength(double);
708     double pageLength() const { return m_pageLength; }
709     void setGapBetweenPages(double);
710     double gapBetweenPages() const { return m_gapBetweenPages; }
711     unsigned pageCount() const { return m_pageCount; }
712
713 #if PLATFORM(COCOA)
714     // Called by the web process through a message.
715     void registerWebProcessAccessibilityToken(const IPC::DataReference&);
716     // Called by the UI process when it is ready to send its tokens to the web process.
717     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
718     bool readSelectionFromPasteboard(const String& pasteboardName);
719     String stringSelectionForPasteboard();
720     PassRefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
721     void makeFirstResponder();
722
723     ColorSpaceData colorSpace();
724 #endif
725
726 #if ENABLE(SERVICE_CONTROLS)
727     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
728 #endif
729
730     void pageScaleFactorDidChange(double);
731     void pluginScaleFactorDidChange(double);
732     void pluginZoomFactorDidChange(double);
733
734     // Find.
735     void findString(const String&, FindOptions, unsigned maxMatchCount);
736     void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
737     void getImageForFindMatch(int32_t matchIndex);
738     void selectFindMatch(int32_t matchIndex);
739     void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
740     void hideFindUI();
741     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
742     void didCountStringMatches(const String&, uint32_t matchCount);
743     void setTextIndicator(const WebCore::TextIndicatorData&, uint64_t /* WebCore::TextIndicatorLifetime */ lifetime = (uint64_t)WebCore::TextIndicatorLifetime::Permanent);
744     void setTextIndicatorAnimationProgress(float);
745     void clearTextIndicator();
746     void didFindString(const String&, uint32_t matchCount, int32_t matchIndex);
747     void didFailToFindString(const String&);
748     void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);
749
750     void getContentsAsString(std::function<void (const String&, CallbackBase::Error)>);
751     void getBytecodeProfile(std::function<void (const String&, CallbackBase::Error)>);
752
753 #if ENABLE(MHTML)
754     void getContentsAsMHTMLData(std::function<void (API::Data*, CallbackBase::Error)>, bool useBinaryEncoding);
755 #endif
756     void getMainResourceDataOfFrame(WebFrameProxy*, std::function<void (API::Data*, CallbackBase::Error)>);
757     void getResourceDataFromFrame(WebFrameProxy*, API::URL*, std::function<void (API::Data*, CallbackBase::Error)>);
758     void getRenderTreeExternalRepresentation(std::function<void (const String&, CallbackBase::Error)>);
759     void getSelectionOrContentsAsString(std::function<void (const String&, CallbackBase::Error)>);
760     void getSelectionAsWebArchiveData(std::function<void (API::Data*, CallbackBase::Error)>);
761     void getSourceForFrame(WebFrameProxy*, std::function<void (const String&, CallbackBase::Error)>);
762     void getWebArchiveOfFrame(WebFrameProxy*, std::function<void (API::Data*, CallbackBase::Error)>);
763     void runJavaScriptInMainFrame(const String&, std::function<void (API::SerializedScriptValue*, CallbackBase::Error)> callbackFunction);
764     void forceRepaint(PassRefPtr<VoidCallback>);
765
766     float headerHeight(WebFrameProxy*);
767     float footerHeight(WebFrameProxy*);
768     void drawHeader(WebFrameProxy*, const WebCore::FloatRect&);
769     void drawFooter(WebFrameProxy*, const WebCore::FloatRect&);
770
771 #if PLATFORM(COCOA)
772     // Dictionary.
773     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
774     void performDictionaryLookupOfCurrentSelection();
775 #endif
776
777     void receivedPolicyDecision(WebCore::PolicyAction, WebFrameProxy*, uint64_t listenerID, API::Navigation* navigationID);
778
779     void backForwardRemovedItem(uint64_t itemID);
780
781 #if ENABLE(DRAG_SUPPORT)    
782     // Drag and drop support.
783     void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
784     void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
785     void dragExited(WebCore::DragData&, const String& dragStorageName = String());
786     void performDragOperation(WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
787
788     void didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted);
789     void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
790 #if PLATFORM(COCOA)
791     void setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, bool isLinkDrag);
792     void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
793                          const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
794 #if ENABLE(ATTACHMENT_ELEMENT)
795     void setPromisedDataForAttachment(const String& pasteboardName, const String& filename, const String& extension, const String& title, const String& url, const String& visibleURL);
796 #endif
797 #endif
798 #if PLATFORM(GTK)
799     void startDrag(const WebCore::DragData&, const ShareableBitmap::Handle& dragImage);
800 #endif
801 #endif
802
803     void processDidBecomeUnresponsive();
804     void interactionOccurredWhileProcessUnresponsive();
805     void processDidBecomeResponsive();
806     void processDidCrash();
807
808     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
809     virtual void exitAcceleratedCompositingMode();
810     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
811     
812     void didDraw();
813
814     enum UndoOrRedo { Undo, Redo };
815     void addEditCommand(WebEditCommandProxy*);
816     void removeEditCommand(WebEditCommandProxy*);
817     bool isValidEditCommand(WebEditCommandProxy*);
818     void registerEditCommand(PassRefPtr<WebEditCommandProxy>, UndoOrRedo);
819
820 #if PLATFORM(COCOA)
821     void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
822     bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
823 #endif
824
825     WebProcessProxy& process() { return m_process; }
826     PlatformProcessIdentifier processIdentifier() const;
827
828     WebPreferences& preferences() { return m_preferences; }
829     void setPreferences(WebPreferences&);
830
831     WebPageGroup& pageGroup() { return m_pageGroup; }
832
833     bool isValid() const;
834
835 #if ENABLE(DRAG_SUPPORT)
836     WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
837     bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
838     unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
839     void resetCurrentDragInformation()
840     {
841         m_currentDragOperation = WebCore::DragOperationNone;
842         m_currentDragIsOverFileInput = false;
843         m_currentDragNumberOfFilesToBeAccepted = 0;
844     }
845 #endif
846
847     void preferencesDidChange();
848
849 #if ENABLE(CONTEXT_MENUS)
850     // Called by the WebContextMenuProxy.
851     void contextMenuItemSelected(const WebContextMenuItemData&);
852 #endif
853
854     // Called by the WebOpenPanelResultListenerProxy.
855 #if PLATFORM(IOS)
856     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const API::Data* iconData);
857 #endif
858     void didChooseFilesForOpenPanel(const Vector<String>&);
859     void didCancelForOpenPanel();
860
861     WebPageCreationParameters creationParameters();
862
863 #if USE(COORDINATED_GRAPHICS)
864     void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&);
865 #endif
866
867     void handleDownloadRequest(DownloadProxy*);
868
869     void advanceToNextMisspelling(bool startBeforeSelection);
870     void changeSpellingToWord(const String& word);
871 #if USE(APPKIT)
872     void uppercaseWord();
873     void lowercaseWord();
874     void capitalizeWord();
875 #endif
876
877 #if PLATFORM(COCOA)
878     bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
879     void setSmartInsertDeleteEnabled(bool);
880 #endif
881
882 #if PLATFORM(GTK)
883     String accessibilityPlugID() const { return m_accessibilityPlugID; }
884 #endif
885
886     void setCanRunModal(bool);
887     bool canRunModal();
888
889     void beginPrinting(WebFrameProxy*, const PrintInfo&);
890     void endPrinting();
891     void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<ComputedPagesCallback>);
892 #if PLATFORM(COCOA)
893     void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, PassRefPtr<ImageCallback>);
894     void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, PassRefPtr<DataCallback>);
895 #elif PLATFORM(GTK)
896     void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<PrintFinishedCallback>);
897 #endif
898
899     PageLoadState& pageLoadState() { return m_pageLoadState; }
900
901 #if PLATFORM(COCOA)
902     void handleAlternativeTextUIResult(const String& result);
903 #endif
904
905     void saveDataToFileInDownloadsFolder(const String& suggestedFilename, const String& mimeType, const String& originatingURLString, API::Data*);
906     void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&);
907 #if PLATFORM(COCOA)
908     void savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
909     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID);
910     void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
911 #endif
912
913     WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
914
915     uint64_t renderTreeSize() const { return m_renderTreeSize; }
916
917     void setShouldSendEventsSynchronously(bool sync) { m_shouldSendEventsSynchronously = sync; };
918
919     void printMainFrame();
920     
921     void setMediaVolume(float);
922     void setMuted(bool);
923     void setMayStartMediaWhenInWindow(bool);
924     bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; }
925         
926     // WebPopupMenuProxy::Client
927     virtual NativeWebMouseEvent* currentlyProcessedMouseDownEvent() override;
928
929     void setSuppressVisibilityUpdates(bool flag);
930     bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
931
932 #if PLATFORM(IOS)
933     void willStartUserTriggeredZooming();
934
935     void potentialTapAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
936     void commitPotentialTap();
937     void cancelPotentialTap();
938     void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
939     void handleTap(const WebCore::FloatPoint&);
940
941     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
942     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
943
944     void blurAssistedNode();
945 #endif
946
947     void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
948
949 #if ENABLE(INPUT_TYPE_COLOR)
950     void setColorPickerColor(const WebCore::Color&);
951     void endColorPicker();
952 #endif
953
954     WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
955     void setMinimumLayoutSize(const WebCore::IntSize&);
956
957     bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
958     void setAutoSizingShouldExpandToViewHeight(bool);
959
960     void didReceiveAuthenticationChallengeProxy(uint64_t frameID, PassRefPtr<AuthenticationChallengeProxy>);
961
962     int64_t spellDocumentTag();
963     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
964     void didCancelCheckingText(uint64_t requestID);
965
966     void connectionWillOpen(IPC::Connection&);
967     void connectionDidClose(IPC::Connection&);
968
969     void processDidFinishLaunching();
970
971     void didSaveToPageCache();
972         
973     void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
974     WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
975
976     void setOverlayScrollbarStyle(WTF::Optional<WebCore::ScrollbarOverlayStyle>);
977     WTF::Optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() { return m_scrollbarOverlayStyle; }
978
979     bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
980     void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
981     void recordNavigationSnapshot();
982     void recordNavigationSnapshot(WebBackForwardListItem&);
983
984 #if PLATFORM(COCOA)
985     PassRefPtr<ViewSnapshot> takeViewSnapshot();
986 #endif
987
988 #if ENABLE(SUBTLE_CRYPTO)
989     void wrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
990     void unwrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
991 #endif
992
993     void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, std::function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>);
994
995     void navigationGestureDidBegin();
996     void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&);
997     void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&);
998     void navigationGestureSnapshotWasRemoved();
999     void willRecordNavigationSnapshot(WebBackForwardListItem&);
1000
1001     bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
1002
1003     bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::IsPlayingAudio); }
1004     void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags);
1005
1006 #if PLATFORM(MAC)
1007     void removeNavigationGestureSnapshot();
1008
1009     WebHitTestResult* lastMouseMoveHitTestResult() const { return m_lastMouseMoveHitTestResult.get(); }
1010     void performActionMenuHitTestAtLocation(WebCore::FloatPoint, bool forImmediateAction);
1011     void selectLastActionMenuRange();
1012     void focusAndSelectLastActionMenuHitTestResult();
1013
1014     void immediateActionDidUpdate();
1015     void immediateActionDidCancel();
1016     void immediateActionDidComplete();
1017
1018     void installViewStateChangeCompletionHandler(void(^completionHandler)());
1019 #endif
1020
1021 #if PLATFORM(EFL) && HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
1022     bool accessibilityObjectReadByPoint(const WebCore::IntPoint&);
1023     bool accessibilityObjectReadPrevious();
1024     bool accessibilityObjectReadNext();
1025 #endif
1026
1027 #if USE(UNIFIED_TEXT_CHECKING)
1028     void checkTextOfParagraph(const String& text, uint64_t checkingTypes, Vector<WebCore::TextCheckingResult>& results);
1029 #endif
1030     void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses);
1031
1032     void setShouldDispatchFakeMouseMoveEvents(bool);
1033
1034     // Diagnostic messages logging.
1035     void logDiagnosticMessage(const String& message, const String& description, bool shouldSample);
1036     void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, bool shouldSample);
1037     void logDiagnosticMessageWithValue(const String& message, const String& description, const String& value, bool shouldSample);
1038
1039 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1040     void addPlaybackTargetPickerClient(uint64_t);
1041     void removePlaybackTargetPickerClient(uint64_t);
1042     void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
1043     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
1044
1045     // WebMediaSessionManagerClient
1046     virtual void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;
1047     virtual void externalOutputDeviceAvailableDidChange(uint64_t, bool) override;
1048     virtual void setShouldPlayToPlaybackTarget(uint64_t, bool) override;
1049 #endif
1050
1051     void didChangeBackgroundColor();
1052     void didLayoutForCustomContentProvider();
1053
1054     void clearWheelEventTestTrigger();
1055
1056 private:
1057     WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, const WebPageConfiguration&);
1058     void platformInitialize();
1059
1060     void updateViewState(WebCore::ViewState::Flags flagsToUpdate = WebCore::ViewState::AllFlags);
1061     void updateActivityToken();
1062     void updateProccessSuppressionState();
1063
1064     enum class ResetStateReason {
1065         PageInvalidated,
1066         WebProcessExited,
1067     };
1068     void resetState(ResetStateReason);
1069     void resetStateAfterProcessExited();
1070
1071     void setUserAgent(const String&);
1072
1073     // IPC::MessageReceiver
1074     // Implemented in generated WebPageProxyMessageReceiver.cpp
1075     virtual void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override;
1076     virtual void didReceiveSyncMessage(IPC::Connection&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
1077
1078     // IPC::MessageSender
1079     virtual bool sendMessage(std::unique_ptr<IPC::MessageEncoder>, unsigned messageSendFlags) override;
1080     virtual IPC::Connection* messageSenderConnection() override;
1081     virtual uint64_t messageSenderDestinationID() override;
1082
1083     // WebPopupMenuProxy::Client
1084     virtual void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex) override;
1085     virtual void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index) override;
1086 #if PLATFORM(GTK)
1087     virtual void failedToShowPopupMenu() override;
1088 #endif
1089
1090     void didCreateMainFrame(uint64_t frameID);
1091     void didCreateSubframe(uint64_t frameID);
1092
1093     void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& url, const String& unreachableURL, const UserData&);
1094     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String&, const UserData&);
1095     void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, const String& url);
1096     void didFailProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&);
1097     void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, const UserData&);
1098     void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1099     void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1100     void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
1101     void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, const String&, const UserData&);
1102     void didReceiveTitleForFrame(uint64_t frameID, const String&, const UserData&);
1103     void didFirstLayoutForFrame(uint64_t frameID, const UserData&);
1104     void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, const UserData&);
1105     void didLayout(uint32_t layoutMilestones, const UserData&);
1106     void didRemoveFrameFromHierarchy(uint64_t frameID, const UserData&);
1107     void didDisplayInsecureContentForFrame(uint64_t frameID, const UserData&);
1108     void didRunInsecureContentForFrame(uint64_t frameID, const UserData&);
1109     void didDetectXSSForFrame(uint64_t frameID, const UserData&);
1110     void frameDidBecomeFrameSet(uint64_t frameID, bool);
1111     void didStartProgress();
1112     void didChangeProgress(double);
1113     void didFinishProgress();
1114     void setNetworkRequestsInProgress(bool);
1115
1116     void didDestroyNavigation(uint64_t navigationID);
1117
1118     void decidePolicyForNavigationAction(uint64_t frameID, uint64_t navigationID, const NavigationActionData&, uint64_t originatingFrameID, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest&, uint64_t listenerID, const UserData&, bool& receivedPolicyAction, uint64_t& newNavigationID, uint64_t& policyAction, uint64_t& downloadID);
1119     void decidePolicyForNewWindowAction(uint64_t frameID, const NavigationActionData&, const WebCore::ResourceRequest&, const String& frameName, uint64_t listenerID, const UserData&);
1120     void decidePolicyForResponse(uint64_t frameID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&);
1121     void decidePolicyForResponseSync(uint64_t frameID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
1122     void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&);
1123
1124     void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&);
1125
1126     // History client
1127     void didNavigateWithNavigationData(const WebNavigationDataStore&, uint64_t frameID);
1128     void didPerformClientRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1129     void didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1130     void didUpdateHistoryTitle(const String& title, const String& url, uint64_t frameID);
1131
1132     // UI client
1133     void createNewPage(uint64_t frameID, const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, const NavigationActionData&, uint64_t& newPageID, WebPageCreationParameters&);
1134     void showPage();
1135     void closePage(bool stopResponsivenessTimer);
1136     void runJavaScriptAlert(uint64_t frameID, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply>);
1137     void runJavaScriptConfirm(uint64_t frameID, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply>);
1138     void runJavaScriptPrompt(uint64_t frameID, const String&, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply>);
1139     void shouldInterruptJavaScript(bool& result);
1140     void setStatusText(const String&);
1141     void mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t modifiers, const UserData&);
1142
1143     void didBeginTrackingPotentialLongMousePress(const WebCore::IntPoint& mouseDownPosition, const WebHitTestResult::Data& hitTestResultData, const UserData&);
1144     void didRecognizeLongMousePress(const UserData&);
1145     void didCancelTrackingPotentialLongMousePress(const UserData&);
1146
1147 #if ENABLE(NETSCAPE_PLUGIN_API)
1148     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
1149 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1150 #if ENABLE(WEBGL)
1151     void webGLPolicyForURL(const String& url, uint32_t& loadPolicy);
1152     void resolveWebGLPolicyForURL(const String& url, uint32_t& loadPolicy);
1153 #endif // ENABLE(WEBGL)
1154     void setToolbarsAreVisible(bool toolbarsAreVisible);
1155     void getToolbarsAreVisible(bool& toolbarsAreVisible);
1156     void setMenuBarIsVisible(bool menuBarIsVisible);
1157     void getMenuBarIsVisible(bool& menuBarIsVisible);
1158     void setStatusBarIsVisible(bool statusBarIsVisible);
1159     void getStatusBarIsVisible(bool& statusBarIsVisible);
1160     void setIsResizable(bool isResizable);
1161     void getIsResizable(bool& isResizable);
1162     void setWindowFrame(const WebCore::FloatRect&);
1163     void getWindowFrame(WebCore::FloatRect&);
1164     void screenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
1165     void rootViewToScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
1166 #if PLATFORM(IOS)
1167     void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
1168     void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
1169 #endif
1170     void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose);
1171     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
1172     void pageDidScroll();
1173     void runOpenPanel(uint64_t frameID, const WebCore::FileChooserSettings&);
1174     void printFrame(uint64_t frameID);
1175     void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>);
1176     void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, PassRefPtr<Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply>);
1177     void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
1178
1179     void requestUserMediaPermissionForFrame(uint64_t userMediaID, uint64_t frameID, String originIdentifier, bool audio, bool video);
1180
1181     void runModal();
1182     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
1183     void recommendedScrollbarStyleDidChange(int32_t newStyle);
1184     void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
1185     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
1186     void didChangePageCount(unsigned);
1187     void pageExtendedBackgroundColorDidChange(const WebCore::Color&);
1188 #if ENABLE(NETSCAPE_PLUGIN_API)
1189     void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
1190     void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
1191 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1192     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
1193
1194     void reattachToWebProcess();
1195     RefPtr<API::Navigation> reattachToWebProcessForReload();
1196     RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem*);
1197
1198     void requestNotificationPermission(uint64_t notificationID, const String& originString);
1199     void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID);
1200     void cancelNotification(uint64_t notificationID);
1201     void clearNotifications(const Vector<uint64_t>& notificationIDs);
1202     void didDestroyNotification(uint64_t notificationID);
1203
1204 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
1205     void pageDidRequestScroll(const WebCore::IntPoint&);
1206     void pageTransitionViewportReady();
1207     void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
1208 #endif
1209
1210     void didChangeContentSize(const WebCore::IntSize&);
1211
1212 #if ENABLE(INPUT_TYPE_COLOR)
1213     void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&);
1214     virtual void didChooseColor(const WebCore::Color&) override;
1215     virtual void didEndColorPicker() override;
1216 #endif
1217
1218     void editorStateChanged(const EditorState&);
1219     void compositionWasCanceled(const EditorState&);
1220
1221     // Back/Forward list management
1222     void backForwardAddItem(uint64_t itemID);
1223     void backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle&);
1224     void backForwardItemAtIndex(int32_t index, uint64_t& itemID);
1225     void backForwardBackListCount(int32_t& count);
1226     void backForwardForwardListCount(int32_t& count);
1227     void backForwardClear();
1228
1229     // Undo management
1230     void registerEditCommandForUndo(uint64_t commandID, uint32_t editAction);
1231     void registerInsertionUndoGrouping();
1232     void clearAllEditCommands();
1233     void canUndoRedo(uint32_t action, bool& result);
1234     void executeUndoRedo(uint32_t action, bool& result);
1235
1236     // Keyboard handling
1237 #if PLATFORM(COCOA)
1238     void executeSavedCommandBySelector(const String& selector, bool& handled);
1239 #endif
1240
1241 #if PLATFORM(GTK)
1242     void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&);
1243     void bindAccessibilityTree(const String&);
1244 #endif
1245 #if PLATFORM(EFL)
1246     void getEditorCommandsForKeyEvent(Vector<String>&);
1247 #endif
1248
1249     // Popup Menu.
1250     void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
1251     void hidePopupMenu();
1252
1253 #if ENABLE(CONTEXT_MENUS)
1254     enum class ContextMenuClientEligibility {
1255         EligibleForClient,
1256         NotEligibleForClient
1257     };
1258     void showContextMenu(const WebCore::IntPoint& menuLocation, const ContextMenuContextData&, const Vector<WebContextMenuItemData>&, const UserData&);
1259     void internalShowContextMenu(const WebCore::IntPoint& menuLocation, const ContextMenuContextData&, const Vector<WebContextMenuItemData>&, ContextMenuClientEligibility, const UserData&);
1260
1261     void platformInitializeShareMenuItem(WebCore::ContextMenuItem&);
1262 #endif
1263
1264 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
1265 #if PLATFORM(MAC)
1266     void showTelephoneNumberMenu(const String& telephoneNumber, const WebCore::IntPoint&);
1267 #endif
1268 #endif
1269
1270 #if ENABLE(SERVICE_CONTROLS)
1271     void showSelectionServiceMenu(const IPC::DataReference& selectionAsRTFD, const Vector<String>& telephoneNumbers, bool isEditable, const WebCore::IntPoint&);
1272 #endif
1273
1274     // Search popup results
1275     void saveRecentSearches(const String&, const Vector<String>&);
1276     void loadRecentSearches(const String&, Vector<String>&);
1277
1278 #if PLATFORM(COCOA)
1279     // Speech.
1280     void getIsSpeaking(bool&);
1281     void speak(const String&);
1282     void stopSpeaking();
1283
1284     // Spotlight.
1285     void searchWithSpotlight(const String&);
1286         
1287     void searchTheWeb(const String&);
1288
1289     // Dictionary.
1290     void didPerformDictionaryLookup(const DictionaryPopupInfo&);
1291 #endif
1292
1293 #if PLATFORM(MAC)
1294     bool appleMailPaginationQuirkEnabled();
1295 #endif
1296
1297     // Spelling and grammar.
1298     void checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength);
1299     void checkGrammarOfString(const String& text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);
1300     void spellingUIIsShowing(bool&);
1301     void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
1302     void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
1303     void learnWord(const String& word);
1304     void ignoreWord(const String& word);
1305     void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&);
1306
1307     void setFocus(bool focused);
1308     void takeFocus(uint32_t direction);
1309     void setToolTip(const String&);
1310     void setCursor(const WebCore::Cursor&);
1311     void setCursorHiddenUntilMouseMoves(bool);
1312
1313     void didReceiveEvent(uint32_t opaqueType, bool handled);
1314     void stopResponsivenessTimer();
1315
1316     void voidCallback(uint64_t);
1317     void dataCallback(const IPC::DataReference&, uint64_t);
1318     void imageCallback(const ShareableBitmap::Handle&, uint64_t);
1319     void stringCallback(const String&, uint64_t);
1320     void scriptValueCallback(const IPC::DataReference&, uint64_t);
1321     void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, uint64_t);
1322     void validateCommandCallback(const String&, bool, int, uint64_t);
1323     void unsignedCallback(uint64_t, uint64_t);
1324     void editingRangeCallback(const EditingRange&, uint64_t);
1325 #if PLATFORM(COCOA)
1326     void machSendRightCallback(const WebCore::MachSendRight&, uint64_t);
1327 #endif
1328     void rectForCharacterRangeCallback(const WebCore::IntRect&, const EditingRange&, uint64_t);
1329 #if PLATFORM(MAC)
1330     void attributedStringForCharacterRangeCallback(const AttributedString&, const EditingRange&, uint64_t);
1331     void fontAtSelectionCallback(const String&, double, bool, uint64_t);
1332 #endif
1333 #if PLATFORM(IOS)
1334     void gestureCallback(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, uint64_t);
1335     void touchesCallback(const WebCore::IntPoint&, uint32_t, uint64_t);
1336     void autocorrectionDataCallback(const Vector<WebCore::FloatRect>&, const String&, float, uint64_t, uint64_t);
1337     void autocorrectionContextCallback(const String&, const String&, const String&, const String&, uint64_t, uint64_t, uint64_t);
1338     void dictationContextCallback(const String&, const String&, const String&, uint64_t);
1339     void interpretKeyEvent(const EditorState&, bool isCharEvent, bool& handled);
1340     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect);
1341 #endif
1342 #if PLATFORM(GTK)
1343     void printFinishedCallback(const WebCore::ResourceError&, uint64_t);
1344 #endif
1345
1346     void focusedFrameChanged(uint64_t frameID);
1347     void frameSetLargestFrameChanged(uint64_t frameID);
1348
1349     void canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const WebCore::ProtectionSpace&, bool& canAuthenticate);
1350     void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID);
1351
1352     void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&);
1353
1354 #if PLATFORM(COCOA)
1355     void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
1356     void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
1357 #endif
1358
1359     bool maybeInitializeSandboxExtensionHandle(const WebCore::URL&, SandboxExtension::Handle&);
1360
1361 #if PLATFORM(MAC)
1362     void substitutionsPanelIsShowing(bool&);
1363     void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
1364     void dismissCorrectionPanel(int32_t reason);
1365     void dismissCorrectionPanelSoon(int32_t reason, String& result);
1366     void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
1367
1368 #if USE(DICTATION_ALTERNATIVES)
1369     void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
1370     void removeDictationAlternatives(uint64_t dictationContext);
1371     void dictationAlternatives(uint64_t dictationContext, Vector<String>& result);
1372 #endif
1373 #endif // PLATFORM(MAC)
1374
1375 #if PLATFORM(IOS)
1376     WebCore::FloatSize screenSize();
1377     WebCore::FloatSize availableScreenSize();
1378     float textAutosizingWidth();
1379
1380     void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint& newScrollPosition, uint64_t dynamicViewportSizeUpdateID);
1381     void restorePageState(const WebCore::FloatRect&, double scale);
1382     void restorePageCenterAndScale(const WebCore::FloatPoint&, double scale);
1383
1384     void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius);
1385
1386     void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, const UserData&);
1387     void stopAssistingNode();
1388
1389     void showInspectorHighlight(const WebCore::Highlight&);
1390     void hideInspectorHighlight();
1391
1392     void showInspectorIndication();
1393     void hideInspectorIndication();
1394
1395     void enableInspectorNodeSearch();
1396     void disableInspectorNodeSearch();
1397
1398     void notifyRevealedSelection();
1399 #endif // PLATFORM(IOS)
1400
1401     void clearLoadDependentCallbacks();
1402
1403     void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
1404
1405     void updateBackingStoreDiscardableState();
1406
1407     void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
1408
1409 #if PLUGIN_ARCHITECTURE(X11)
1410     void createPluginContainer(uint64_t& windowID);
1411     void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
1412     void windowedPluginVisibilityDidChange(bool isVisible, uint64_t windowID);
1413 #endif
1414
1415     void processNextQueuedWheelEvent();
1416     void sendWheelEvent(const WebWheelEvent&);
1417
1418 #if ENABLE(TOUCH_EVENTS)
1419     bool shouldStartTrackingTouchEvents(const WebTouchEvent&) const;
1420 #endif
1421
1422 #if ENABLE(NETSCAPE_PLUGIN_API)
1423     void findPlugin(const String& mimeType, uint32_t processType, const String& urlString, const String& frameURLString, const String& pageURLString, bool allowOnlyApplicationPlugins, uint64_t& pluginProcessToken, String& newMIMEType, uint32_t& pluginLoadPolicy, String& unavailabilityDescription);
1424 #endif
1425
1426 #if USE(QUICK_LOOK)
1427     void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
1428     void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&);
1429 #endif
1430
1431 #if ENABLE(CONTENT_FILTERING)
1432     void contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler&, uint64_t frameID);
1433 #endif
1434
1435     uint64_t generateNavigationID();
1436
1437     WebPreferencesStore preferencesStore() const;
1438
1439     void dispatchViewStateChange();
1440     void viewDidLeaveWindow();
1441     void viewDidEnterWindow();
1442
1443 #if PLATFORM(MAC)
1444     void didPerformActionMenuHitTest(const WebHitTestResult::Data&, bool forImmediateAction, bool contentPreventsDefault, const UserData&);
1445 #endif
1446
1447     void handleAutoFillButtonClick(const UserData&);
1448
1449     void handleMessage(IPC::Connection&, const String& messageName, const UserData& messageBody);
1450     void handleSynchronousMessage(IPC::Connection&, const String& messageName, const UserData& messageBody, UserData& returnUserData);
1451
1452     PageClient& m_pageClient;
1453     std::unique_ptr<API::LoaderClient> m_loaderClient;
1454     std::unique_ptr<API::PolicyClient> m_policyClient;
1455     std::unique_ptr<API::NavigationClient> m_navigationClient;
1456     std::unique_ptr<API::HistoryClient> m_historyClient;
1457     std::unique_ptr<API::FormClient> m_formClient;
1458     std::unique_ptr<API::UIClient> m_uiClient;
1459 #if PLATFORM(EFL)
1460     WebUIPopupMenuClient m_uiPopupMenuClient;
1461 #endif
1462     std::unique_ptr<API::FindClient> m_findClient;
1463     WebFindMatchesClient m_findMatchesClient;
1464     std::unique_ptr<API::DiagnosticLoggingClient> m_diagnosticLoggingClient;
1465 #if ENABLE(CONTEXT_MENUS)
1466     std::unique_ptr<API::ContextMenuClient> m_contextMenuClient;
1467 #endif
1468     std::unique_ptr<WebPageInjectedBundleClient> m_injectedBundleClient;
1469
1470     std::unique_ptr<WebNavigationState> m_navigationState;
1471     String m_failingProvisionalLoadURL;
1472
1473     std::unique_ptr<DrawingAreaProxy> m_drawingArea;
1474 #if ENABLE(ASYNC_SCROLLING)
1475     std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy;
1476 #endif
1477
1478     Ref<WebProcessProxy> m_process;
1479     Ref<WebPageGroup> m_pageGroup;
1480     Ref<WebPreferences> m_preferences;
1481
1482     WebProcessLifetimeTracker m_webProcessLifetimeTracker { *this };
1483
1484     const RefPtr<WebUserContentControllerProxy> m_userContentController;
1485     Ref<VisitedLinkProvider> m_visitedLinkProvider;
1486     Ref<WebsiteDataStore> m_websiteDataStore;
1487
1488     RefPtr<WebFrameProxy> m_mainFrame;
1489     RefPtr<WebFrameProxy> m_focusedFrame;
1490     RefPtr<WebFrameProxy> m_frameSetLargestFrame;
1491
1492     String m_userAgent;
1493     String m_applicationNameForUserAgent;
1494     String m_customUserAgent;
1495     String m_customTextEncodingName;
1496
1497     bool m_treatsSHA1CertificatesAsInsecure;
1498
1499     RefPtr<WebInspectorProxy> m_inspector;
1500
1501 #if ENABLE(FULLSCREEN_API)
1502     RefPtr<WebFullScreenManagerProxy> m_fullScreenManager;
1503 #endif
1504 #if PLATFORM(IOS)
1505     RefPtr<WebVideoFullscreenManagerProxy> m_videoFullscreenManager;
1506     VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
1507     bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad;
1508     uint64_t m_firstLayerTreeTransactionIdAfterDidCommitLoad;
1509     int32_t m_deviceOrientation;
1510     bool m_dynamicViewportSizeUpdateWaitingForTarget;
1511     bool m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit;
1512     uint64_t m_dynamicViewportSizeUpdateLayerTreeTransactionID;
1513     uint64_t m_layerTreeTransactionIdAtLastTouchStart;
1514     uint64_t m_currentDynamicViewportSizeUpdateID { 0 };
1515 #endif
1516
1517 #if ENABLE(VIBRATION)
1518     RefPtr<WebVibrationProxy> m_vibration;
1519 #endif
1520
1521     CallbackMap m_callbacks;
1522     HashSet<uint64_t> m_loadDependentStringCallbackIDs;
1523
1524     HashSet<WebEditCommandProxy*> m_editCommandSet;
1525
1526 #if PLATFORM(COCOA)
1527     HashSet<String> m_knownKeypressCommandNames;
1528 #endif
1529
1530     RefPtr<WebPopupMenuProxy> m_activePopupMenu;
1531 #if ENABLE(CONTEXT_MENUS)
1532     RefPtr<WebContextMenuProxy> m_activeContextMenu;
1533     ContextMenuContextData m_activeContextMenuContextData;
1534 #endif
1535     RefPtr<WebHitTestResult> m_lastMouseMoveHitTestResult;
1536
1537     RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
1538     GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
1539     NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
1540
1541     UserMediaPermissionRequestManagerProxy m_userMediaPermissionRequestManager;
1542
1543     WebCore::ViewState::Flags m_viewState;
1544     bool m_viewWasEverInWindow;
1545
1546 #if PLATFORM(IOS)
1547     ProcessThrottler::ForegroundActivityToken m_activityToken;
1548 #endif
1549         
1550     Ref<WebBackForwardList> m_backForwardList;
1551         
1552     bool m_maintainsInactiveSelection;
1553
1554     String m_toolTip;
1555
1556     EditorState m_editorState;
1557     bool m_isEditable;
1558 #if PLATFORM(MAC) && !USE(ASYNC_NSTEXTINPUTCLIENT)
1559     bool m_temporarilyClosedComposition; // Editor state changed from hasComposition to !hasComposition, but that was only with shouldIgnoreCompositionSelectionChange yet.
1560 #endif
1561
1562     double m_textZoomFactor;
1563     double m_pageZoomFactor;
1564     double m_pageScaleFactor;
1565     double m_pluginZoomFactor;
1566     double m_pluginScaleFactor;
1567     double m_viewScaleFactor { 1 };
1568     float m_intrinsicDeviceScaleFactor;
1569     float m_customDeviceScaleFactor;
1570     float m_topContentInset;
1571
1572     LayerHostingMode m_layerHostingMode;
1573
1574     bool m_drawsBackground;
1575     bool m_drawsTransparentBackground;
1576
1577     WebCore::Color m_underlayColor;
1578     WebCore::Color m_pageExtendedBackgroundColor;
1579
1580     bool m_useFixedLayout;
1581     WebCore::IntSize m_fixedLayoutSize;
1582
1583     bool m_suppressScrollbarAnimations;
1584
1585     WebCore::Pagination::Mode m_paginationMode;
1586     bool m_paginationBehavesLikeColumns;
1587     double m_pageLength;
1588     double m_gapBetweenPages;
1589
1590     // If the process backing the web page is alive and kicking.
1591     bool m_isValid;
1592
1593     // Whether WebPageProxy::close() has been called on this page.
1594     bool m_isClosed;
1595
1596     // Whether it can run modal child web pages.
1597     bool m_canRunModal;
1598
1599     bool m_isInPrintingMode;
1600     bool m_isPerformingDOMPrintOperation;
1601
1602     bool m_inDecidePolicyForResponseSync;
1603     const WebCore::ResourceRequest* m_decidePolicyForResponseRequest;
1604     bool m_syncMimeTypePolicyActionIsValid;
1605     WebCore::PolicyAction m_syncMimeTypePolicyAction;
1606     uint64_t m_syncMimeTypePolicyDownloadID;
1607
1608     bool m_inDecidePolicyForNavigationAction;
1609     bool m_syncNavigationActionPolicyActionIsValid;
1610     WebCore::PolicyAction m_syncNavigationActionPolicyAction;
1611     uint64_t m_syncNavigationActionPolicyDownloadID;
1612
1613     Deque<NativeWebKeyboardEvent> m_keyEventQueue;
1614     Deque<NativeWebWheelEvent> m_wheelEventQueue;
1615     Deque<std::unique_ptr<Vector<NativeWebWheelEvent>>> m_currentlyProcessedWheelEvents;
1616
1617     bool m_processingMouseMoveEvent;
1618     std::unique_ptr<NativeWebMouseEvent> m_nextMouseMoveEvent;
1619     std::unique_ptr<NativeWebMouseEvent> m_currentlyProcessedMouseDownEvent;
1620
1621 #if ENABLE(TOUCH_EVENTS)
1622     bool m_isTrackingTouchEvents;
1623 #endif
1624 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
1625     Deque<QueuedTouchEvents> m_touchEventQueue;
1626 #endif
1627
1628 #if ENABLE(INPUT_TYPE_COLOR)
1629     RefPtr<WebColorPicker> m_colorPicker;
1630 #endif
1631
1632     const uint64_t m_pageID;
1633     WebCore::SessionID m_sessionID;
1634
1635     bool m_isPageSuspended;
1636     bool m_addsVisitedLinks;
1637
1638 #if ENABLE(REMOTE_INSPECTOR)
1639     bool m_allowsRemoteInspection;
1640 #endif
1641
1642 #if PLATFORM(COCOA)
1643     bool m_isSmartInsertDeleteEnabled;
1644 #endif
1645
1646 #if PLATFORM(GTK)
1647     String m_accessibilityPlugID;
1648     WebCore::Color m_backgroundColor;
1649 #endif
1650
1651     int64_t m_spellDocumentTag;
1652     bool m_hasSpellDocumentTag;
1653     unsigned m_pendingLearnOrIgnoreWordMessageCount;
1654
1655     bool m_mainFrameHasCustomContentProvider;
1656
1657 #if ENABLE(DRAG_SUPPORT)
1658     // Current drag destination details are delivered as an asynchronous response,
1659     // so we preserve them to be used when the next dragging delegate call is made.
1660     WebCore::DragOperation m_currentDragOperation;
1661     bool m_currentDragIsOverFileInput;
1662     unsigned m_currentDragNumberOfFilesToBeAccepted;
1663 #endif
1664
1665     PageLoadState m_pageLoadState;
1666     
1667     bool m_delegatesScrolling;
1668
1669     bool m_mainFrameHasHorizontalScrollbar;
1670     bool m_mainFrameHasVerticalScrollbar;
1671
1672     // Whether horizontal wheel events can be handled directly for swiping purposes.
1673     bool m_canShortCircuitHorizontalWheelEvents;
1674
1675     bool m_mainFrameIsPinnedToLeftSide;
1676     bool m_mainFrameIsPinnedToRightSide;
1677     bool m_mainFrameIsPinnedToTopSide;
1678     bool m_mainFrameIsPinnedToBottomSide;
1679
1680     bool m_shouldUseImplicitRubberBandControl;
1681     bool m_rubberBandsAtLeft;
1682     bool m_rubberBandsAtRight;
1683     bool m_rubberBandsAtTop;
1684     bool m_rubberBandsAtBottom;
1685         
1686     bool m_enableVerticalRubberBanding;
1687     bool m_enableHorizontalRubberBanding;
1688
1689     bool m_backgroundExtendsBeyondPage;
1690
1691     bool m_shouldRecordNavigationSnapshots;
1692     bool m_isShowingNavigationGestureSnapshot;
1693
1694     unsigned m_pageCount;
1695
1696     WebCore::IntRect m_visibleScrollerThumbRect;
1697
1698     uint64_t m_renderTreeSize;
1699     uint64_t m_sessionRestorationRenderTreeSize;
1700     bool m_wantsSessionRestorationRenderTreeSizeThresholdEvent;
1701     bool m_hitRenderTreeSizeThreshold;
1702
1703     bool m_shouldSendEventsSynchronously;
1704
1705     bool m_suppressVisibilityUpdates;
1706     bool m_autoSizingShouldExpandToViewHeight;
1707     WebCore::IntSize m_minimumLayoutSize;
1708
1709     float m_mediaVolume;
1710     bool m_muted;
1711     bool m_mayStartMediaWhenInWindow;
1712
1713     bool m_waitingForDidUpdateViewState;
1714
1715     bool m_shouldScaleViewToFitDocument { false };
1716
1717 #if PLATFORM(COCOA)
1718     HashMap<String, String> m_temporaryPDFFiles;
1719     std::unique_ptr<WebCore::RunLoopObserver> m_viewStateChangeDispatcher;
1720
1721     std::unique_ptr<RemoteLayerTreeScrollingPerformanceData> m_scrollingPerformanceData;
1722     bool m_scrollPerformanceDataCollectionEnabled;
1723 #endif
1724     UserObservablePageToken m_pageIsUserObservableCount;
1725     ProcessSuppressionDisabledToken m_preventProcessSuppressionCount;
1726         
1727     WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1728     WTF::Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
1729
1730     uint64_t m_navigationID;
1731
1732     WebPreferencesStore::ValueMap m_configurationPreferenceValues;
1733     WebCore::ViewState::Flags m_potentiallyChangedViewStateFlags;
1734     bool m_viewStateChangeWantsSynchronousReply;
1735     Vector<uint64_t> m_nextViewStateChangeCallbacks;
1736
1737     WebCore::MediaProducer::MediaStateFlags m_mediaState { WebCore::MediaProducer::IsNotPlaying };
1738
1739 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1740     bool m_requiresTargetMonitoring { false };
1741 #endif
1742
1743 };
1744
1745 } // namespace WebKit
1746
1747 #endif // WebPageProxy_h