Add support for lookup on iOS.
[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     void getLookupContextAtPoint(const WebCore::IntPoint&, std::function<void(const String&, CallbackBase::Error)>);
505 #endif
506
507     void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);
508
509 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
510     void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
511 #endif
512 #if PLATFORM(EFL)
513     void setThemePath(const String&);
514 #endif
515
516 #if PLATFORM(GTK)
517     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
518     void confirmComposition(const String& compositionString, int64_t selectionStart, int64_t selectionLength);
519     void cancelComposition();
520 #endif
521
522 #if PLATFORM(GTK)
523     void setInputMethodState(bool enabled);
524 #endif
525
526 #if PLATFORM (GTK) && HAVE(GTK_GESTURES)
527     void getCenterForZoomGesture(const WebCore::IntPoint& centerInViewCoordinates, WebCore::IntPoint& center);
528 #endif
529
530 #if PLATFORM(COCOA)
531     void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
532     void setMainFrameIsScrollable(bool);
533
534     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
535     bool shouldDelayWindowOrderingForEvent(const WebMouseEvent&);
536     bool acceptsFirstMouse(int eventNumber, const WebMouseEvent&);
537
538     void setAcceleratedCompositingRootLayer(LayerOrView*);
539     LayerOrView* acceleratedCompositingRootLayer() const;
540
541     void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false);
542     void getMarkedRangeAsync(std::function<void (EditingRange, CallbackBase::Error)>);
543     void getSelectedRangeAsync(std::function<void (EditingRange, CallbackBase::Error)>);
544     void characterIndexForPointAsync(const WebCore::IntPoint&, std::function<void (uint64_t, CallbackBase::Error)>);
545     void firstRectForCharacterRangeAsync(const EditingRange&, std::function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)>);
546     void setCompositionAsync(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
547     void confirmCompositionAsync();
548
549     void setScrollPerformanceDataCollectionEnabled(bool);
550     bool scrollPerformanceDataCollectionEnabled() const { return m_scrollPerformanceDataCollectionEnabled; }
551     RemoteLayerTreeScrollingPerformanceData* scrollingPerformanceData() { return m_scrollingPerformanceData.get(); }
552 #endif // PLATFORM(COCOA)
553
554 #if PLATFORM(MAC)
555     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives, bool registerUndoGroup);
556     void attributedSubstringForCharacterRangeAsync(const EditingRange&, std::function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)>);
557     void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits);
558     void fontAtSelection(std::function<void (const String&, double, bool, CallbackBase::Error)>);
559
560 #if !USE(ASYNC_NSTEXTINPUTCLIENT)
561     bool insertText(const String& text, const EditingRange& replacementRange);
562     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
563     void confirmComposition();
564     bool insertDictatedText(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives);
565     void getAttributedSubstringFromRange(const EditingRange&, AttributedString&);
566     void getMarkedRange(EditingRange&);
567     void getSelectedRange(EditingRange&);
568     uint64_t characterIndexForPoint(const WebCore::IntPoint);
569     WebCore::IntRect firstRectForCharacterRange(const EditingRange&);
570     bool executeKeypressCommands(const Vector<WebCore::KeypressCommand>&);
571     void cancelComposition();
572 #endif // !USE(ASYNC_NSTEXTINPUTCLIENT)
573
574     WKView* wkView() const;
575     void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize);
576     CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const;
577 #endif // PLATFORM(MAC)
578
579 #if PLATFORM(EFL)
580     void handleInputMethodKeydown(bool& handled);
581     void confirmComposition(const String&);
582     void setComposition(const String&, Vector<WebCore::CompositionUnderline>&, int);
583     void cancelComposition();
584 #endif
585
586 #if PLATFORM(GTK)
587     PlatformWidget viewWidget();
588     const WebCore::Color& backgroundColor() const { return m_backgroundColor; }
589     void setBackgroundColor(const WebCore::Color& color) { m_backgroundColor = color; }
590 #endif
591
592 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
593     void commitPageTransitionViewport();
594 #endif
595
596     void handleMouseEvent(const NativeWebMouseEvent&);
597     void handleWheelEvent(const NativeWebWheelEvent&);
598     void handleKeyboardEvent(const NativeWebKeyboardEvent&);
599
600 #if ENABLE(IOS_TOUCH_EVENTS)
601     void handleTouchEventSynchronously(const NativeWebTouchEvent&);
602     void handleTouchEventAsynchronously(const NativeWebTouchEvent&);
603
604 #elif ENABLE(TOUCH_EVENTS)
605     void handleTouchEvent(const NativeWebTouchEvent&);
606 #endif
607
608     void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
609     void centerSelectionInVisibleArea();
610
611     const String& toolTip() const { return m_toolTip; }
612
613     const String& userAgent() const { return m_userAgent; }
614     void setApplicationNameForUserAgent(const String&);
615     const String& applicationNameForUserAgent() const { return m_applicationNameForUserAgent; }
616     void setCustomUserAgent(const String&);
617     const String& customUserAgent() const { return m_customUserAgent; }
618     static String standardUserAgent(const String& applicationName = String());
619
620     bool supportsTextEncoding() const;
621     void setCustomTextEncodingName(const String&);
622     String customTextEncodingName() const { return m_customTextEncodingName; }
623
624     bool areActiveDOMObjectsAndAnimationsSuspended() const { return m_isPageSuspended; }
625     void resumeActiveDOMObjectsAndAnimations();
626     void suspendActiveDOMObjectsAndAnimations();
627
628     double estimatedProgress() const;
629
630     void terminateProcess();
631
632     SessionState sessionState(const std::function<bool (WebBackForwardListItem&)>& = nullptr) const;
633     RefPtr<API::Navigation> restoreFromSessionState(SessionState, bool navigate);
634
635     bool supportsTextZoom() const;
636     double textZoomFactor() const { return m_textZoomFactor; }
637     void setTextZoomFactor(double);
638     double pageZoomFactor() const;
639     void setPageZoomFactor(double);
640     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
641
642     void scalePage(double scale, const WebCore::IntPoint& origin);
643     void scalePageInViewCoordinates(double scale, const WebCore::IntPoint& centerInViewCoordinates);
644     double pageScaleFactor() const;
645     double viewScaleFactor() const { return m_viewScaleFactor; }
646     void scaleView(double scale);
647
648     float deviceScaleFactor() const;
649     void setIntrinsicDeviceScaleFactor(float);
650     void setCustomDeviceScaleFactor(float);
651     void windowScreenDidChange(PlatformDisplayID);
652
653     void setUseFixedLayout(bool);
654     void setFixedLayoutSize(const WebCore::IntSize&);
655     bool useFixedLayout() const { return m_useFixedLayout; };
656     const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
657
658     void listenForLayoutMilestones(WebCore::LayoutMilestones);
659
660     bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
661     bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
662
663     void setSuppressScrollbarAnimations(bool);
664     bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
665
666     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
667     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
668     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
669     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
670
671     bool rubberBandsAtLeft() const;
672     void setRubberBandsAtLeft(bool);
673     bool rubberBandsAtRight() const;
674     void setRubberBandsAtRight(bool);
675     bool rubberBandsAtTop() const;
676     void setRubberBandsAtTop(bool);
677     bool rubberBandsAtBottom() const;
678     void setRubberBandsAtBottom(bool);
679
680     void setShouldUseImplicitRubberBandControl(bool shouldUseImplicitRubberBandControl) { m_shouldUseImplicitRubberBandControl = shouldUseImplicitRubberBandControl; }
681     bool shouldUseImplicitRubberBandControl() const { return m_shouldUseImplicitRubberBandControl; }
682         
683     void setEnableVerticalRubberBanding(bool);
684     bool verticalRubberBandingIsEnabled() const;
685     void setEnableHorizontalRubberBanding(bool);
686     bool horizontalRubberBandingIsEnabled() const;
687         
688     void setBackgroundExtendsBeyondPage(bool);
689     bool backgroundExtendsBeyondPage() const;
690
691     void setPaginationMode(WebCore::Pagination::Mode);
692     WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
693     void setPaginationBehavesLikeColumns(bool);
694     bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
695     void setPageLength(double);
696     double pageLength() const { return m_pageLength; }
697     void setGapBetweenPages(double);
698     double gapBetweenPages() const { return m_gapBetweenPages; }
699     unsigned pageCount() const { return m_pageCount; }
700
701 #if PLATFORM(COCOA)
702     // Called by the web process through a message.
703     void registerWebProcessAccessibilityToken(const IPC::DataReference&);
704     // Called by the UI process when it is ready to send its tokens to the web process.
705     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
706     bool readSelectionFromPasteboard(const String& pasteboardName);
707     String stringSelectionForPasteboard();
708     PassRefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
709     void makeFirstResponder();
710
711     ColorSpaceData colorSpace();
712 #endif
713
714 #if ENABLE(SERVICE_CONTROLS)
715     void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
716 #endif
717
718     void pageScaleFactorDidChange(double);
719     void pluginScaleFactorDidChange(double);
720     void pluginZoomFactorDidChange(double);
721
722     // Find.
723     void findString(const String&, FindOptions, unsigned maxMatchCount);
724     void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
725     void getImageForFindMatch(int32_t matchIndex);
726     void selectFindMatch(int32_t matchIndex);
727     void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
728     void hideFindUI();
729     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
730     void didCountStringMatches(const String&, uint32_t matchCount);
731     void setTextIndicator(const WebCore::TextIndicatorData&, bool fadeOut);
732     void setTextIndicatorAnimationProgress(float);
733     void clearTextIndicator();
734     void didFindString(const String&, uint32_t matchCount, int32_t matchIndex);
735     void didFailToFindString(const String&);
736     void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);
737
738     void getContentsAsString(std::function<void (const String&, CallbackBase::Error)>);
739     void getBytecodeProfile(std::function<void (const String&, CallbackBase::Error)>);
740
741 #if ENABLE(MHTML)
742     void getContentsAsMHTMLData(std::function<void (API::Data*, CallbackBase::Error)>, bool useBinaryEncoding);
743 #endif
744     void getMainResourceDataOfFrame(WebFrameProxy*, std::function<void (API::Data*, CallbackBase::Error)>);
745     void getResourceDataFromFrame(WebFrameProxy*, API::URL*, std::function<void (API::Data*, CallbackBase::Error)>);
746     void getRenderTreeExternalRepresentation(std::function<void (const String&, CallbackBase::Error)>);
747     void getSelectionOrContentsAsString(std::function<void (const String&, CallbackBase::Error)>);
748     void getSelectionAsWebArchiveData(std::function<void (API::Data*, CallbackBase::Error)>);
749     void getSourceForFrame(WebFrameProxy*, std::function<void (const String&, CallbackBase::Error)>);
750     void getWebArchiveOfFrame(WebFrameProxy*, std::function<void (API::Data*, CallbackBase::Error)>);
751     void runJavaScriptInMainFrame(const String&, std::function<void (API::SerializedScriptValue*, CallbackBase::Error)> callbackFunction);
752     void forceRepaint(PassRefPtr<VoidCallback>);
753
754     float headerHeight(WebFrameProxy*);
755     float footerHeight(WebFrameProxy*);
756     void drawHeader(WebFrameProxy*, const WebCore::FloatRect&);
757     void drawFooter(WebFrameProxy*, const WebCore::FloatRect&);
758
759 #if PLATFORM(COCOA)
760     // Dictionary.
761     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
762     void performDictionaryLookupOfCurrentSelection();
763 #endif
764
765     void receivedPolicyDecision(WebCore::PolicyAction, WebFrameProxy*, uint64_t listenerID, API::Navigation* navigationID);
766
767     void backForwardRemovedItem(uint64_t itemID);
768
769 #if ENABLE(DRAG_SUPPORT)    
770     // Drag and drop support.
771     void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
772     void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
773     void dragExited(WebCore::DragData&, const String& dragStorageName = String());
774     void performDragOperation(WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
775
776     void didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted);
777     void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
778 #if PLATFORM(COCOA)
779     void setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, bool isLinkDrag);
780     void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
781                          const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
782 #if ENABLE(ATTACHMENT_ELEMENT)
783     void setPromisedDataForAttachment(const String& pasteboardName, const String& filename, const String& extension, const String& title, const String& url, const String& visibleURL);
784 #endif
785 #endif
786 #if PLATFORM(GTK)
787     void startDrag(const WebCore::DragData&, const ShareableBitmap::Handle& dragImage);
788 #endif
789 #endif
790
791     void processDidBecomeUnresponsive();
792     void interactionOccurredWhileProcessUnresponsive();
793     void processDidBecomeResponsive();
794     void processDidCrash();
795
796     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
797     virtual void exitAcceleratedCompositingMode();
798     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
799     
800     void didDraw();
801
802     enum UndoOrRedo { Undo, Redo };
803     void addEditCommand(WebEditCommandProxy*);
804     void removeEditCommand(WebEditCommandProxy*);
805     bool isValidEditCommand(WebEditCommandProxy*);
806     void registerEditCommand(PassRefPtr<WebEditCommandProxy>, UndoOrRedo);
807
808 #if PLATFORM(COCOA)
809     void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
810     bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
811 #endif
812
813     WebProcessProxy& process() { return m_process; }
814     PlatformProcessIdentifier processIdentifier() const;
815
816     WebPreferences& preferences() { return m_preferences; }
817     void setPreferences(WebPreferences&);
818
819     WebPageGroup& pageGroup() { return m_pageGroup; }
820
821     bool isValid() const;
822
823 #if ENABLE(DRAG_SUPPORT)
824     WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
825     bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
826     unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
827     void resetCurrentDragInformation()
828     {
829         m_currentDragOperation = WebCore::DragOperationNone;
830         m_currentDragIsOverFileInput = false;
831         m_currentDragNumberOfFilesToBeAccepted = 0;
832     }
833 #endif
834
835     void preferencesDidChange();
836
837 #if ENABLE(CONTEXT_MENUS)
838     // Called by the WebContextMenuProxy.
839     void contextMenuItemSelected(const WebContextMenuItemData&);
840 #endif
841
842     // Called by the WebOpenPanelResultListenerProxy.
843 #if PLATFORM(IOS)
844     void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const API::Data* iconData);
845 #endif
846     void didChooseFilesForOpenPanel(const Vector<String>&);
847     void didCancelForOpenPanel();
848
849     WebPageCreationParameters creationParameters();
850
851 #if USE(COORDINATED_GRAPHICS)
852     void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&);
853 #endif
854
855     void handleDownloadRequest(DownloadProxy*);
856
857     void advanceToNextMisspelling(bool startBeforeSelection);
858     void changeSpellingToWord(const String& word);
859 #if USE(APPKIT)
860     void uppercaseWord();
861     void lowercaseWord();
862     void capitalizeWord();
863 #endif
864
865 #if PLATFORM(COCOA)
866     bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
867     void setSmartInsertDeleteEnabled(bool);
868 #endif
869
870 #if PLATFORM(GTK)
871     String accessibilityPlugID() const { return m_accessibilityPlugID; }
872 #endif
873
874     void setCanRunModal(bool);
875     bool canRunModal();
876
877     void beginPrinting(WebFrameProxy*, const PrintInfo&);
878     void endPrinting();
879     void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<ComputedPagesCallback>);
880 #if PLATFORM(COCOA)
881     void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, PassRefPtr<ImageCallback>);
882     void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, PassRefPtr<DataCallback>);
883 #elif PLATFORM(GTK)
884     void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<PrintFinishedCallback>);
885 #endif
886
887     PageLoadState& pageLoadState() { return m_pageLoadState; }
888
889 #if PLATFORM(COCOA)
890     void handleAlternativeTextUIResult(const String& result);
891 #endif
892
893     void saveDataToFileInDownloadsFolder(const String& suggestedFilename, const String& mimeType, const String& originatingURLString, API::Data*);
894     void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&);
895 #if PLATFORM(COCOA)
896     void savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
897     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID);
898     void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
899 #endif
900
901     WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
902
903     uint64_t renderTreeSize() const { return m_renderTreeSize; }
904
905     void setShouldSendEventsSynchronously(bool sync) { m_shouldSendEventsSynchronously = sync; };
906
907     void printMainFrame();
908     
909     void setMediaVolume(float);
910     void setMuted(bool);
911     void setMayStartMediaWhenInWindow(bool);
912     bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; }
913         
914     // WebPopupMenuProxy::Client
915     virtual NativeWebMouseEvent* currentlyProcessedMouseDownEvent() override;
916
917     void setSuppressVisibilityUpdates(bool flag);
918     bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
919
920 #if PLATFORM(IOS)
921     void willStartUserTriggeredZooming();
922
923     void potentialTapAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
924     void commitPotentialTap();
925     void cancelPotentialTap();
926     void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
927     void handleTap(const WebCore::FloatPoint&);
928
929     void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
930     void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
931
932     void blurAssistedNode();
933 #endif
934
935     void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
936
937 #if ENABLE(INPUT_TYPE_COLOR)
938     void setColorPickerColor(const WebCore::Color&);
939     void endColorPicker();
940 #endif
941
942     WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
943     void setMinimumLayoutSize(const WebCore::IntSize&);
944
945     bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
946     void setAutoSizingShouldExpandToViewHeight(bool);
947
948     void didReceiveAuthenticationChallengeProxy(uint64_t frameID, PassRefPtr<AuthenticationChallengeProxy>);
949
950     int64_t spellDocumentTag();
951     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
952     void didCancelCheckingText(uint64_t requestID);
953
954     void connectionWillOpen(IPC::Connection&);
955     void connectionDidClose(IPC::Connection&);
956
957     void processDidFinishLaunching();
958
959     void didSaveToPageCache();
960         
961     void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
962     WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
963
964     bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
965     void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
966     void recordNavigationSnapshot();
967     void recordNavigationSnapshot(WebBackForwardListItem&);
968
969 #if PLATFORM(COCOA)
970     PassRefPtr<ViewSnapshot> takeViewSnapshot();
971 #endif
972
973 #if ENABLE(SUBTLE_CRYPTO)
974     void wrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
975     void unwrapCryptoKey(const Vector<uint8_t>&, bool& succeeded, Vector<uint8_t>&);
976 #endif
977
978     void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, std::function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>);
979
980     void navigationGestureDidBegin();
981     void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&);
982     void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&);
983     void navigationGestureSnapshotWasRemoved();
984     void willRecordNavigationSnapshot(WebBackForwardListItem&);
985
986     bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; }
987
988     bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::IsPlayingAudio); }
989     void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags);
990
991 #if PLATFORM(MAC)
992     void removeNavigationGestureSnapshot();
993
994     WebHitTestResult* lastMouseMoveHitTestResult() const { return m_lastMouseMoveHitTestResult.get(); }
995     void performActionMenuHitTestAtLocation(WebCore::FloatPoint, bool forImmediateAction);
996     void selectLastActionMenuRange();
997     void focusAndSelectLastActionMenuHitTestResult();
998
999     void immediateActionDidUpdate();
1000     void immediateActionDidCancel();
1001     void immediateActionDidComplete();
1002
1003     void installViewStateChangeCompletionHandler(void(^completionHandler)());
1004 #endif
1005
1006 #if PLATFORM(EFL) && HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
1007     bool accessibilityObjectReadByPoint(const WebCore::IntPoint&);
1008     bool accessibilityObjectReadPrevious();
1009     bool accessibilityObjectReadNext();
1010 #endif
1011
1012 #if USE(UNIFIED_TEXT_CHECKING)
1013     void checkTextOfParagraph(const String& text, uint64_t checkingTypes, Vector<WebCore::TextCheckingResult>& results);
1014 #endif
1015     void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses);
1016
1017     void setShouldDispatchFakeMouseMoveEvents(bool);
1018
1019     // Diagnostic messages logging.
1020     void logDiagnosticMessage(const String& message, const String& description, bool shouldSample);
1021     void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, bool shouldSample);
1022     void logDiagnosticMessageWithValue(const String& message, const String& description, const String& value, bool shouldSample);
1023
1024 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1025     void addPlaybackTargetPickerClient(uint64_t);
1026     void removePlaybackTargetPickerClient(uint64_t);
1027     void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
1028     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
1029
1030     // WebMediaSessionManagerClient
1031     virtual void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;
1032     virtual void externalOutputDeviceAvailableDidChange(uint64_t, bool) override;
1033     virtual void setShouldPlayToPlaybackTarget(uint64_t, bool) override;
1034 #endif
1035
1036     void didChangeBackgroundColor();
1037     void didLayoutForCustomContentProvider();
1038
1039 private:
1040     WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, const WebPageConfiguration&);
1041     void platformInitialize();
1042
1043     void updateViewState(WebCore::ViewState::Flags flagsToUpdate = WebCore::ViewState::AllFlags);
1044     void updateActivityToken();
1045     void updateProccessSuppressionState();
1046
1047     enum class ResetStateReason {
1048         PageInvalidated,
1049         WebProcessExited,
1050     };
1051     void resetState(ResetStateReason);
1052     void resetStateAfterProcessExited();
1053
1054     void setUserAgent(const String&);
1055
1056     // IPC::MessageReceiver
1057     // Implemented in generated WebPageProxyMessageReceiver.cpp
1058     virtual void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override;
1059     virtual void didReceiveSyncMessage(IPC::Connection&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
1060
1061     // IPC::MessageSender
1062     virtual bool sendMessage(std::unique_ptr<IPC::MessageEncoder>, unsigned messageSendFlags) override;
1063     virtual IPC::Connection* messageSenderConnection() override;
1064     virtual uint64_t messageSenderDestinationID() override;
1065
1066     // WebPopupMenuProxy::Client
1067     virtual void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex) override;
1068     virtual void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index) override;
1069 #if PLATFORM(GTK)
1070     virtual void failedToShowPopupMenu() override;
1071 #endif
1072
1073     void didCreateMainFrame(uint64_t frameID);
1074     void didCreateSubframe(uint64_t frameID);
1075
1076     void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& url, const String& unreachableURL, const UserData&);
1077     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String&, const UserData&);
1078     void didFailProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
1079     void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, const UserData&);
1080     void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1081     void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
1082     void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
1083     void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, const String&, const UserData&);
1084     void didReceiveTitleForFrame(uint64_t frameID, const String&, const UserData&);
1085     void didFirstLayoutForFrame(uint64_t frameID, const UserData&);
1086     void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, const UserData&);
1087     void didLayout(uint32_t layoutMilestones, const UserData&);
1088     void didRemoveFrameFromHierarchy(uint64_t frameID, const UserData&);
1089     void didDisplayInsecureContentForFrame(uint64_t frameID, const UserData&);
1090     void didRunInsecureContentForFrame(uint64_t frameID, const UserData&);
1091     void didDetectXSSForFrame(uint64_t frameID, const UserData&);
1092     void frameDidBecomeFrameSet(uint64_t frameID, bool);
1093     void didStartProgress();
1094     void didChangeProgress(double);
1095     void didFinishProgress();
1096     void setNetworkRequestsInProgress(bool);
1097
1098     void didDestroyNavigation(uint64_t navigationID);
1099
1100     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);
1101     void decidePolicyForNewWindowAction(uint64_t frameID, const NavigationActionData&, const WebCore::ResourceRequest&, const String& frameName, uint64_t listenerID, const UserData&);
1102     void decidePolicyForResponse(uint64_t frameID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&);
1103     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);
1104     void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&);
1105
1106     void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&);
1107
1108     // History client
1109     void didNavigateWithNavigationData(const WebNavigationDataStore&, uint64_t frameID);
1110     void didPerformClientRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1111     void didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID);
1112     void didUpdateHistoryTitle(const String& title, const String& url, uint64_t frameID);
1113
1114     // UI client
1115     void createNewPage(uint64_t frameID, const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, const NavigationActionData&, uint64_t& newPageID, WebPageCreationParameters&);
1116     void showPage();
1117     void closePage(bool stopResponsivenessTimer);
1118     void runJavaScriptAlert(uint64_t frameID, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply>);
1119     void runJavaScriptConfirm(uint64_t frameID, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply>);
1120     void runJavaScriptPrompt(uint64_t frameID, const String&, const String&, RefPtr<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply>);
1121     void shouldInterruptJavaScript(bool& result);
1122     void setStatusText(const String&);
1123     void mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t modifiers, const UserData&);
1124
1125     void didBeginTrackingPotentialLongMousePress(const WebCore::IntPoint& mouseDownPosition, const WebHitTestResult::Data& hitTestResultData, const UserData&);
1126     void didRecognizeLongMousePress(const UserData&);
1127     void didCancelTrackingPotentialLongMousePress(const UserData&);
1128
1129 #if ENABLE(NETSCAPE_PLUGIN_API)
1130     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
1131 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1132 #if ENABLE(WEBGL)
1133     void webGLPolicyForURL(const String& url, uint32_t& loadPolicy);
1134     void resolveWebGLPolicyForURL(const String& url, uint32_t& loadPolicy);
1135 #endif // ENABLE(WEBGL)
1136     void setToolbarsAreVisible(bool toolbarsAreVisible);
1137     void getToolbarsAreVisible(bool& toolbarsAreVisible);
1138     void setMenuBarIsVisible(bool menuBarIsVisible);
1139     void getMenuBarIsVisible(bool& menuBarIsVisible);
1140     void setStatusBarIsVisible(bool statusBarIsVisible);
1141     void getStatusBarIsVisible(bool& statusBarIsVisible);
1142     void setIsResizable(bool isResizable);
1143     void getIsResizable(bool& isResizable);
1144     void setWindowFrame(const WebCore::FloatRect&);
1145     void getWindowFrame(WebCore::FloatRect&);
1146     void screenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
1147     void rootViewToScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
1148 #if PLATFORM(IOS)
1149     void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
1150     void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
1151 #endif
1152     void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose);
1153     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
1154     void pageDidScroll();
1155     void runOpenPanel(uint64_t frameID, const WebCore::FileChooserSettings&);
1156     void printFrame(uint64_t frameID);
1157     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>);
1158     void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, PassRefPtr<Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply>);
1159     void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
1160
1161     void requestUserMediaPermissionForFrame(uint64_t userMediaID, uint64_t frameID, String originIdentifier, bool audio, bool video);
1162
1163     void runModal();
1164     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
1165     void recommendedScrollbarStyleDidChange(int32_t newStyle);
1166     void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
1167     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
1168     void didChangePageCount(unsigned);
1169     void pageExtendedBackgroundColorDidChange(const WebCore::Color&);
1170 #if ENABLE(NETSCAPE_PLUGIN_API)
1171     void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
1172     void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
1173 #endif // ENABLE(NETSCAPE_PLUGIN_API)
1174     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
1175
1176     void reattachToWebProcess();
1177     RefPtr<API::Navigation> reattachToWebProcessForReload();
1178     RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem*);
1179
1180     void requestNotificationPermission(uint64_t notificationID, const String& originString);
1181     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);
1182     void cancelNotification(uint64_t notificationID);
1183     void clearNotifications(const Vector<uint64_t>& notificationIDs);
1184     void didDestroyNotification(uint64_t notificationID);
1185
1186 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
1187     void pageDidRequestScroll(const WebCore::IntPoint&);
1188     void pageTransitionViewportReady();
1189     void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
1190 #endif
1191
1192     void didChangeContentSize(const WebCore::IntSize&);
1193
1194 #if ENABLE(INPUT_TYPE_COLOR)
1195     void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&);
1196     virtual void didChooseColor(const WebCore::Color&) override;
1197     virtual void didEndColorPicker() override;
1198 #endif
1199
1200     void editorStateChanged(const EditorState&);
1201     void compositionWasCanceled(const EditorState&);
1202
1203     // Back/Forward list management
1204     void backForwardAddItem(uint64_t itemID);
1205     void backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle&);
1206     void backForwardItemAtIndex(int32_t index, uint64_t& itemID);
1207     void backForwardBackListCount(int32_t& count);
1208     void backForwardForwardListCount(int32_t& count);
1209     void backForwardClear();
1210
1211     // Undo management
1212     void registerEditCommandForUndo(uint64_t commandID, uint32_t editAction);
1213     void registerInsertionUndoGrouping();
1214     void clearAllEditCommands();
1215     void canUndoRedo(uint32_t action, bool& result);
1216     void executeUndoRedo(uint32_t action, bool& result);
1217
1218     // Keyboard handling
1219 #if PLATFORM(COCOA)
1220     void executeSavedCommandBySelector(const String& selector, bool& handled);
1221 #endif
1222
1223 #if PLATFORM(GTK)
1224     void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&);
1225     void bindAccessibilityTree(const String&);
1226 #endif
1227 #if PLATFORM(EFL)
1228     void getEditorCommandsForKeyEvent(Vector<String>&);
1229 #endif
1230
1231     // Popup Menu.
1232     void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
1233     void hidePopupMenu();
1234
1235 #if ENABLE(CONTEXT_MENUS)
1236     enum class ContextMenuClientEligibility {
1237         EligibleForClient,
1238         NotEligibleForClient
1239     };
1240     void showContextMenu(const WebCore::IntPoint& menuLocation, const ContextMenuContextData&, const Vector<WebContextMenuItemData>&, const UserData&);
1241     void internalShowContextMenu(const WebCore::IntPoint& menuLocation, const ContextMenuContextData&, const Vector<WebContextMenuItemData>&, ContextMenuClientEligibility, const UserData&);
1242
1243     void platformInitializeShareMenuItem(WebCore::ContextMenuItem&);
1244 #endif
1245
1246 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
1247 #if PLATFORM(MAC)
1248     void showTelephoneNumberMenu(const String& telephoneNumber, const WebCore::IntPoint&);
1249 #endif
1250 #endif
1251
1252 #if ENABLE(SERVICE_CONTROLS)
1253     void showSelectionServiceMenu(const IPC::DataReference& selectionAsRTFD, const Vector<String>& telephoneNumbers, bool isEditable, const WebCore::IntPoint&);
1254 #endif
1255
1256     // Search popup results
1257     void saveRecentSearches(const String&, const Vector<String>&);
1258     void loadRecentSearches(const String&, Vector<String>&);
1259
1260 #if PLATFORM(COCOA)
1261     // Speech.
1262     void getIsSpeaking(bool&);
1263     void speak(const String&);
1264     void stopSpeaking();
1265
1266     // Spotlight.
1267     void searchWithSpotlight(const String&);
1268         
1269     void searchTheWeb(const String&);
1270
1271     // Dictionary.
1272     void didPerformDictionaryLookup(const DictionaryPopupInfo&);
1273 #endif
1274
1275 #if PLATFORM(MAC)
1276     bool appleMailPaginationQuirkEnabled();
1277 #endif
1278
1279     // Spelling and grammar.
1280     void checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength);
1281     void checkGrammarOfString(const String& text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);
1282     void spellingUIIsShowing(bool&);
1283     void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
1284     void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
1285     void learnWord(const String& word);
1286     void ignoreWord(const String& word);
1287     void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&);
1288
1289     void setFocus(bool focused);
1290     void takeFocus(uint32_t direction);
1291     void setToolTip(const String&);
1292     void setCursor(const WebCore::Cursor&);
1293     void setCursorHiddenUntilMouseMoves(bool);
1294
1295     void didReceiveEvent(uint32_t opaqueType, bool handled);
1296     void stopResponsivenessTimer();
1297
1298     void voidCallback(uint64_t);
1299     void dataCallback(const IPC::DataReference&, uint64_t);
1300     void imageCallback(const ShareableBitmap::Handle&, uint64_t);
1301     void stringCallback(const String&, uint64_t);
1302     void scriptValueCallback(const IPC::DataReference&, uint64_t);
1303     void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, uint64_t);
1304     void validateCommandCallback(const String&, bool, int, uint64_t);
1305     void unsignedCallback(uint64_t, uint64_t);
1306     void editingRangeCallback(const EditingRange&, uint64_t);
1307     void rectForCharacterRangeCallback(const WebCore::IntRect&, const EditingRange&, uint64_t);
1308 #if PLATFORM(MAC)
1309     void attributedStringForCharacterRangeCallback(const AttributedString&, const EditingRange&, uint64_t);
1310     void fontAtSelectionCallback(const String&, double, bool, uint64_t);
1311 #endif
1312 #if PLATFORM(IOS)
1313     void gestureCallback(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, uint64_t);
1314     void touchesCallback(const WebCore::IntPoint&, uint32_t, uint64_t);
1315     void autocorrectionDataCallback(const Vector<WebCore::FloatRect>&, const String&, float, uint64_t, uint64_t);
1316     void autocorrectionContextCallback(const String&, const String&, const String&, const String&, uint64_t, uint64_t, uint64_t);
1317     void dictationContextCallback(const String&, const String&, const String&, uint64_t);
1318     void interpretKeyEvent(const EditorState&, bool isCharEvent, bool& handled);
1319     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect);
1320 #endif
1321 #if PLATFORM(GTK)
1322     void printFinishedCallback(const WebCore::ResourceError&, uint64_t);
1323 #endif
1324
1325     void focusedFrameChanged(uint64_t frameID);
1326     void frameSetLargestFrameChanged(uint64_t frameID);
1327
1328     void canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const WebCore::ProtectionSpace&, bool& canAuthenticate);
1329     void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID);
1330
1331     void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&);
1332
1333 #if PLATFORM(COCOA)
1334     void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
1335     void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
1336 #endif
1337
1338     bool maybeInitializeSandboxExtensionHandle(const WebCore::URL&, SandboxExtension::Handle&);
1339
1340 #if PLATFORM(MAC)
1341     void substitutionsPanelIsShowing(bool&);
1342     void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
1343     void dismissCorrectionPanel(int32_t reason);
1344     void dismissCorrectionPanelSoon(int32_t reason, String& result);
1345     void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
1346
1347 #if USE(DICTATION_ALTERNATIVES)
1348     void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
1349     void removeDictationAlternatives(uint64_t dictationContext);
1350     void dictationAlternatives(uint64_t dictationContext, Vector<String>& result);
1351 #endif
1352 #endif // PLATFORM(MAC)
1353
1354 #if PLATFORM(IOS)
1355     WebCore::FloatSize screenSize();
1356     WebCore::FloatSize availableScreenSize();
1357     float textAutosizingWidth();
1358
1359     void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint& newScrollPosition, uint64_t dynamicViewportSizeUpdateID);
1360     void restorePageState(const WebCore::FloatRect&, double scale);
1361     void restorePageCenterAndScale(const WebCore::FloatPoint&, double scale);
1362
1363     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);
1364
1365     void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, const UserData&);
1366     void stopAssistingNode();
1367
1368     void showInspectorHighlight(const WebCore::Highlight&);
1369     void hideInspectorHighlight();
1370
1371     void showInspectorIndication();
1372     void hideInspectorIndication();
1373
1374     void enableInspectorNodeSearch();
1375     void disableInspectorNodeSearch();
1376
1377     void notifyRevealedSelection();
1378 #endif // PLATFORM(IOS)
1379
1380     void clearLoadDependentCallbacks();
1381
1382     void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
1383
1384     void updateBackingStoreDiscardableState();
1385
1386     void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
1387
1388 #if PLUGIN_ARCHITECTURE(X11)
1389     void createPluginContainer(uint64_t& windowID);
1390     void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
1391     void windowedPluginVisibilityDidChange(bool isVisible, uint64_t windowID);
1392 #endif
1393
1394     void processNextQueuedWheelEvent();
1395     void sendWheelEvent(const WebWheelEvent&);
1396
1397 #if ENABLE(TOUCH_EVENTS)
1398     bool shouldStartTrackingTouchEvents(const WebTouchEvent&) const;
1399 #endif
1400
1401 #if ENABLE(NETSCAPE_PLUGIN_API)
1402     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);
1403 #endif
1404
1405 #if USE(QUICK_LOOK)
1406     void didStartLoadForQuickLookDocumentInMainFrame(const String& fileName, const String& uti);
1407     void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&);
1408 #endif
1409
1410 #if ENABLE(CONTENT_FILTERING)
1411     void contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler&, uint64_t frameID);
1412 #endif
1413
1414     uint64_t generateNavigationID();
1415
1416     WebPreferencesStore preferencesStore() const;
1417
1418     void dispatchViewStateChange();
1419     void viewDidLeaveWindow();
1420     void viewDidEnterWindow();
1421
1422 #if PLATFORM(MAC)
1423     void didPerformActionMenuHitTest(const WebHitTestResult::Data&, bool forImmediateAction, bool contentPreventsDefault, const UserData&);
1424 #endif
1425
1426     void handleAutoFillButtonClick(const UserData&);
1427
1428     void handleMessage(IPC::Connection&, const String& messageName, const UserData& messageBody);
1429     void handleSynchronousMessage(IPC::Connection&, const String& messageName, const UserData& messageBody, UserData& returnUserData);
1430
1431     PageClient& m_pageClient;
1432     std::unique_ptr<API::LoaderClient> m_loaderClient;
1433     std::unique_ptr<API::PolicyClient> m_policyClient;
1434     std::unique_ptr<API::NavigationClient> m_navigationClient;
1435     std::unique_ptr<API::HistoryClient> m_historyClient;
1436     std::unique_ptr<API::FormClient> m_formClient;
1437     std::unique_ptr<API::UIClient> m_uiClient;
1438 #if PLATFORM(EFL)
1439     WebUIPopupMenuClient m_uiPopupMenuClient;
1440 #endif
1441     std::unique_ptr<API::FindClient> m_findClient;
1442     WebFindMatchesClient m_findMatchesClient;
1443     std::unique_ptr<API::DiagnosticLoggingClient> m_diagnosticLoggingClient;
1444 #if ENABLE(CONTEXT_MENUS)
1445     std::unique_ptr<API::ContextMenuClient> m_contextMenuClient;
1446 #endif
1447     std::unique_ptr<WebPageInjectedBundleClient> m_injectedBundleClient;
1448
1449     std::unique_ptr<WebNavigationState> m_navigationState;
1450
1451     std::unique_ptr<DrawingAreaProxy> m_drawingArea;
1452 #if ENABLE(ASYNC_SCROLLING)
1453     std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy;
1454 #endif
1455
1456     Ref<WebProcessProxy> m_process;
1457     Ref<WebPageGroup> m_pageGroup;
1458     Ref<WebPreferences> m_preferences;
1459
1460     WebProcessLifetimeTracker m_webProcessLifetimeTracker { *this };
1461
1462     const RefPtr<WebUserContentControllerProxy> m_userContentController;
1463     Ref<VisitedLinkProvider> m_visitedLinkProvider;
1464     Ref<WebsiteDataStore> m_websiteDataStore;
1465
1466     RefPtr<WebFrameProxy> m_mainFrame;
1467     RefPtr<WebFrameProxy> m_focusedFrame;
1468     RefPtr<WebFrameProxy> m_frameSetLargestFrame;
1469
1470     String m_userAgent;
1471     String m_applicationNameForUserAgent;
1472     String m_customUserAgent;
1473     String m_customTextEncodingName;
1474
1475     bool m_treatsSHA1CertificatesAsInsecure;
1476
1477     RefPtr<WebInspectorProxy> m_inspector;
1478
1479 #if ENABLE(FULLSCREEN_API)
1480     RefPtr<WebFullScreenManagerProxy> m_fullScreenManager;
1481 #endif
1482 #if PLATFORM(IOS)
1483     RefPtr<WebVideoFullscreenManagerProxy> m_videoFullscreenManager;
1484     VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
1485     bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad;
1486     uint64_t m_firstLayerTreeTransactionIdAfterDidCommitLoad;
1487     int32_t m_deviceOrientation;
1488     bool m_dynamicViewportSizeUpdateWaitingForTarget;
1489     bool m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit;
1490     uint64_t m_dynamicViewportSizeUpdateLayerTreeTransactionID;
1491     uint64_t m_layerTreeTransactionIdAtLastTouchStart;
1492     uint64_t m_currentDynamicViewportSizeUpdateID { 0 };
1493 #endif
1494
1495 #if ENABLE(VIBRATION)
1496     RefPtr<WebVibrationProxy> m_vibration;
1497 #endif
1498
1499     CallbackMap m_callbacks;
1500     HashSet<uint64_t> m_loadDependentStringCallbackIDs;
1501
1502     HashSet<WebEditCommandProxy*> m_editCommandSet;
1503
1504 #if PLATFORM(COCOA)
1505     HashSet<String> m_knownKeypressCommandNames;
1506 #endif
1507
1508     RefPtr<WebPopupMenuProxy> m_activePopupMenu;
1509 #if ENABLE(CONTEXT_MENUS)
1510     RefPtr<WebContextMenuProxy> m_activeContextMenu;
1511     ContextMenuContextData m_activeContextMenuContextData;
1512 #endif
1513     RefPtr<WebHitTestResult> m_lastMouseMoveHitTestResult;
1514
1515     RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
1516     GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
1517     NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
1518
1519     UserMediaPermissionRequestManagerProxy m_userMediaPermissionRequestManager;
1520
1521     WebCore::ViewState::Flags m_viewState;
1522     bool m_viewWasEverInWindow;
1523
1524 #if PLATFORM(IOS)
1525     ProcessThrottler::ForegroundActivityToken m_activityToken;
1526 #endif
1527         
1528     Ref<WebBackForwardList> m_backForwardList;
1529         
1530     bool m_maintainsInactiveSelection;
1531
1532     String m_toolTip;
1533
1534     EditorState m_editorState;
1535     bool m_isEditable;
1536 #if PLATFORM(MAC) && !USE(ASYNC_NSTEXTINPUTCLIENT)
1537     bool m_temporarilyClosedComposition; // Editor state changed from hasComposition to !hasComposition, but that was only with shouldIgnoreCompositionSelectionChange yet.
1538 #endif
1539
1540     double m_textZoomFactor;
1541     double m_pageZoomFactor;
1542     double m_pageScaleFactor;
1543     double m_pluginZoomFactor;
1544     double m_pluginScaleFactor;
1545     double m_viewScaleFactor { 1 };
1546     float m_intrinsicDeviceScaleFactor;
1547     float m_customDeviceScaleFactor;
1548     float m_topContentInset;
1549
1550     LayerHostingMode m_layerHostingMode;
1551
1552     bool m_drawsBackground;
1553     bool m_drawsTransparentBackground;
1554
1555     WebCore::Color m_underlayColor;
1556     WebCore::Color m_pageExtendedBackgroundColor;
1557
1558     bool m_useFixedLayout;
1559     WebCore::IntSize m_fixedLayoutSize;
1560
1561     bool m_suppressScrollbarAnimations;
1562
1563     WebCore::Pagination::Mode m_paginationMode;
1564     bool m_paginationBehavesLikeColumns;
1565     double m_pageLength;
1566     double m_gapBetweenPages;
1567
1568     // If the process backing the web page is alive and kicking.
1569     bool m_isValid;
1570
1571     // Whether WebPageProxy::close() has been called on this page.
1572     bool m_isClosed;
1573
1574     // Whether it can run modal child web pages.
1575     bool m_canRunModal;
1576
1577     bool m_isInPrintingMode;
1578     bool m_isPerformingDOMPrintOperation;
1579
1580     bool m_inDecidePolicyForResponseSync;
1581     const WebCore::ResourceRequest* m_decidePolicyForResponseRequest;
1582     bool m_syncMimeTypePolicyActionIsValid;
1583     WebCore::PolicyAction m_syncMimeTypePolicyAction;
1584     uint64_t m_syncMimeTypePolicyDownloadID;
1585
1586     bool m_inDecidePolicyForNavigationAction;
1587     bool m_syncNavigationActionPolicyActionIsValid;
1588     WebCore::PolicyAction m_syncNavigationActionPolicyAction;
1589     uint64_t m_syncNavigationActionPolicyDownloadID;
1590
1591     Deque<NativeWebKeyboardEvent> m_keyEventQueue;
1592     Deque<NativeWebWheelEvent> m_wheelEventQueue;
1593     Deque<std::unique_ptr<Vector<NativeWebWheelEvent>>> m_currentlyProcessedWheelEvents;
1594
1595     bool m_processingMouseMoveEvent;
1596     std::unique_ptr<NativeWebMouseEvent> m_nextMouseMoveEvent;
1597     std::unique_ptr<NativeWebMouseEvent> m_currentlyProcessedMouseDownEvent;
1598
1599 #if ENABLE(TOUCH_EVENTS)
1600     bool m_isTrackingTouchEvents;
1601 #endif
1602 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
1603     Deque<QueuedTouchEvents> m_touchEventQueue;
1604 #endif
1605
1606 #if ENABLE(INPUT_TYPE_COLOR)
1607     RefPtr<WebColorPicker> m_colorPicker;
1608 #endif
1609
1610     const uint64_t m_pageID;
1611     WebCore::SessionID m_sessionID;
1612
1613     bool m_isPageSuspended;
1614     bool m_addsVisitedLinks;
1615
1616 #if ENABLE(REMOTE_INSPECTOR)
1617     bool m_allowsRemoteInspection;
1618 #endif
1619
1620 #if PLATFORM(COCOA)
1621     bool m_isSmartInsertDeleteEnabled;
1622 #endif
1623
1624 #if PLATFORM(GTK)
1625     String m_accessibilityPlugID;
1626     WebCore::Color m_backgroundColor;
1627 #endif
1628
1629     int64_t m_spellDocumentTag;
1630     bool m_hasSpellDocumentTag;
1631     unsigned m_pendingLearnOrIgnoreWordMessageCount;
1632
1633     bool m_mainFrameHasCustomContentProvider;
1634
1635 #if ENABLE(DRAG_SUPPORT)
1636     // Current drag destination details are delivered as an asynchronous response,
1637     // so we preserve them to be used when the next dragging delegate call is made.
1638     WebCore::DragOperation m_currentDragOperation;
1639     bool m_currentDragIsOverFileInput;
1640     unsigned m_currentDragNumberOfFilesToBeAccepted;
1641 #endif
1642
1643     PageLoadState m_pageLoadState;
1644     
1645     bool m_delegatesScrolling;
1646
1647     bool m_mainFrameHasHorizontalScrollbar;
1648     bool m_mainFrameHasVerticalScrollbar;
1649
1650     // Whether horizontal wheel events can be handled directly for swiping purposes.
1651     bool m_canShortCircuitHorizontalWheelEvents;
1652
1653     bool m_mainFrameIsPinnedToLeftSide;
1654     bool m_mainFrameIsPinnedToRightSide;
1655     bool m_mainFrameIsPinnedToTopSide;
1656     bool m_mainFrameIsPinnedToBottomSide;
1657
1658     bool m_shouldUseImplicitRubberBandControl;
1659     bool m_rubberBandsAtLeft;
1660     bool m_rubberBandsAtRight;
1661     bool m_rubberBandsAtTop;
1662     bool m_rubberBandsAtBottom;
1663         
1664     bool m_enableVerticalRubberBanding;
1665     bool m_enableHorizontalRubberBanding;
1666
1667     bool m_backgroundExtendsBeyondPage;
1668
1669     bool m_shouldRecordNavigationSnapshots;
1670     bool m_isShowingNavigationGestureSnapshot;
1671
1672     unsigned m_pageCount;
1673
1674     WebCore::IntRect m_visibleScrollerThumbRect;
1675
1676     uint64_t m_renderTreeSize;
1677     uint64_t m_sessionRestorationRenderTreeSize;
1678     bool m_wantsSessionRestorationRenderTreeSizeThresholdEvent;
1679     bool m_hitRenderTreeSizeThreshold;
1680
1681     bool m_shouldSendEventsSynchronously;
1682
1683     bool m_suppressVisibilityUpdates;
1684     bool m_autoSizingShouldExpandToViewHeight;
1685     WebCore::IntSize m_minimumLayoutSize;
1686
1687     float m_mediaVolume;
1688     bool m_muted;
1689     bool m_mayStartMediaWhenInWindow;
1690
1691     bool m_waitingForDidUpdateViewState;
1692         
1693 #if PLATFORM(COCOA)
1694     HashMap<String, String> m_temporaryPDFFiles;
1695     std::unique_ptr<WebCore::RunLoopObserver> m_viewStateChangeDispatcher;
1696
1697     std::unique_ptr<RemoteLayerTreeScrollingPerformanceData> m_scrollingPerformanceData;
1698     bool m_scrollPerformanceDataCollectionEnabled;
1699 #endif
1700     UserObservablePageToken m_pageIsUserObservableCount;
1701     ProcessSuppressionDisabledToken m_preventProcessSuppressionCount;
1702         
1703     WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1704
1705     uint64_t m_navigationID;
1706
1707     WebPreferencesStore::ValueMap m_configurationPreferenceValues;
1708     WebCore::ViewState::Flags m_potentiallyChangedViewStateFlags;
1709     bool m_viewStateChangeWantsSynchronousReply;
1710     Vector<uint64_t> m_nextViewStateChangeCallbacks;
1711
1712     WebCore::MediaProducer::MediaStateFlags m_mediaState { WebCore::MediaProducer::IsNotPlaying };
1713
1714 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
1715     bool m_requiresTargetMonitoring { false };
1716 #endif
1717
1718 };
1719
1720 } // namespace WebKit
1721
1722 #endif // WebPageProxy_h