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