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