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