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