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