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