[Cocoa] Navigation action information for policy decisions is missing the original...
[WebKit-https.git] / Source / WebKit2 / UIProcess / WebPageProxy.h
1 /*
2  * Copyright (C) 2010, 2011 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 "AutoCorrectionCallback.h"
31 #include "Connection.h"
32 #include "DragControllerAction.h"
33 #include "DrawingAreaProxy.h"
34 #include "EditorState.h"
35 #include "GeolocationPermissionRequestManagerProxy.h"
36 #include "LayerTreeContext.h"
37 #include "NotificationPermissionRequestManagerProxy.h"
38 #include "PageLoadState.h"
39 #include "PlatformProcessIdentifier.h"
40 #include "SandboxExtension.h"
41 #include "ShareableBitmap.h"
42 #include "ViewState.h"
43 #include "WKBase.h"
44 #include "WKPagePrivate.h"
45 #include "WebColorPicker.h"
46 #include "WebContextMenuItemData.h"
47 #include "WebCoreArgumentCoders.h"
48 #include "WebFindClient.h"
49 #include "WebFormClient.h"
50 #include "WebFrameProxy.h"
51 #include "WebHistoryClient.h"
52 #include "WebHitTestResult.h"
53 #include "WebLoaderClient.h"
54 #include "WebPageContextMenuClient.h"
55 #include "WebPageCreationParameters.h"
56 #include <WebCore/AlternativeTextClient.h> // FIXME: Needed by WebPageProxyMessages.h for DICTATION_ALTERNATIVES.
57 #include "WebPageProxyMessages.h"
58 #include "WebPolicyClient.h"
59 #include "WebPopupMenuProxy.h"
60 #include "WebUIClient.h"
61 #include <WebCore/Color.h>
62 #include <WebCore/DragActions.h>
63 #include <WebCore/DragSession.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 <wtf/HashMap.h>
71 #include <wtf/HashSet.h>
72 #include <wtf/OwnPtr.h>
73 #include <wtf/PassOwnPtr.h>
74 #include <wtf/PassRefPtr.h>
75 #include <wtf/RefPtr.h>
76 #include <wtf/Vector.h>
77 #include <wtf/text/WTFString.h>
78
79 #if ENABLE(DRAG_SUPPORT)
80 #include <WebCore/DragActions.h>
81 #include <WebCore/DragSession.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(MAC)
95 #include <WebCore/PlatformLayer.h>
96 #endif
97
98 namespace CoreIPC {
99 class ArgumentDecoder;
100 class Connection;
101 }
102
103 namespace WebCore {
104 class AuthenticationChallenge;
105 class Cursor;
106 class DragData;
107 class FloatRect;
108 class GraphicsLayer;
109 class IntSize;
110 class ProtectionSpace;
111 class SharedBuffer;
112 struct FileChooserSettings;
113 struct TextAlternativeWithRange;
114 struct TextCheckingResult;
115 struct ViewportAttributes;
116 struct WindowFeatures;
117 }
118
119 #if USE(APPKIT)
120 OBJC_CLASS WKView;
121 #endif
122
123 #if PLATFORM(GTK)
124 typedef GtkWidget* PlatformWidget;
125 #endif
126
127 namespace WebKit {
128
129 class CertificateInfo;
130 class NativeWebKeyboardEvent;
131 class NativeWebMouseEvent;
132 class NativeWebWheelEvent;
133 class PageClient;
134 class StringPairVector;
135 class WebBackForwardList;
136 class WebBackForwardListItem;
137 class WebColorPickerResultListenerProxy;
138 class WebContextMenuProxy;
139 class WebData;
140 class WebEditCommandProxy;
141 class WebFullScreenManagerProxy;
142 class WebKeyboardEvent;
143 class WebMouseEvent;
144 class WebOpenPanelResultListenerProxy;
145 class WebPageGroup;
146 class WebProcessProxy;
147 class WebURLRequest;
148 class WebWheelEvent;
149 struct AttributedString;
150 struct ColorSpaceData;
151 struct DictionaryPopupInfo;
152 struct EditorState;
153 struct PlatformPopupMenuData;
154 struct PrintInfo;
155 struct WebPopupItem;
156
157 #if ENABLE(VIBRATION)
158 class WebVibrationProxy;
159 #endif
160
161 typedef GenericCallback<WKStringRef, StringImpl*> StringCallback;
162 typedef GenericCallback<WKSerializedScriptValueRef, WebSerializedScriptValue*> ScriptValueCallback;
163
164 #if PLATFORM(GTK)
165 typedef GenericCallback<WKErrorRef> PrintFinishedCallback;
166 #endif
167
168 #if ENABLE(TOUCH_EVENTS)
169 struct QueuedTouchEvents {
170     QueuedTouchEvents(const NativeWebTouchEvent& event)
171         : forwardedEvent(event)
172     {
173     }
174     NativeWebTouchEvent forwardedEvent;
175     Vector<NativeWebTouchEvent> deferredTouchEvents;
176 };
177 #endif
178
179 // FIXME: Make a version of CallbackBase with three arguments, and define ValidateCommandCallback as a specialization.
180 class ValidateCommandCallback : public CallbackBase {
181 public:
182     typedef void (*CallbackFunction)(WKStringRef, bool, int32_t, WKErrorRef, void*);
183
184     static PassRefPtr<ValidateCommandCallback> create(void* context, CallbackFunction callback)
185     {
186         return adoptRef(new ValidateCommandCallback(context, callback));
187     }
188
189     virtual ~ValidateCommandCallback()
190     {
191         ASSERT(!m_callback);
192     }
193
194     void performCallbackWithReturnValue(StringImpl* returnValue1, bool returnValue2, int returnValue3)
195     {
196         ASSERT(m_callback);
197
198         m_callback(toAPI(returnValue1), returnValue2, returnValue3, 0, context());
199
200         m_callback = 0;
201     }
202     
203     void invalidate()
204     {
205         ASSERT(m_callback);
206
207         RefPtr<WebError> error = WebError::create();
208         m_callback(0, 0, 0, toAPI(error.get()), context());
209         
210         m_callback = 0;
211     }
212
213 private:
214
215     ValidateCommandCallback(void* context, CallbackFunction callback)
216         : CallbackBase(context)
217         , m_callback(callback)
218     {
219     }
220
221     CallbackFunction m_callback;
222 };
223
224 #if PLATFORM(IOS)
225 class GestureCallback : public CallbackBase {
226 public:
227     typedef void (*CallbackFunction)(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, WKErrorRef, void*);
228
229     static PassRefPtr<GestureCallback> create(void* context, CallbackFunction callback)
230     {
231         return adoptRef(new GestureCallback(context, callback));
232     }
233
234     virtual ~GestureCallback()
235     {
236         ASSERT(!m_callback);
237     }
238
239     void performCallbackWithReturnValue(const WebCore::IntPoint& returnValue1, uint32_t returnValue2, uint32_t returnValue3, uint32_t returnValue4)
240     {
241         ASSERT(m_callback);
242
243         m_callback(returnValue1, returnValue2, returnValue3, returnValue4, 0, context());
244
245         m_callback = 0;
246     }
247
248     void invalidate()
249     {
250         ASSERT(m_callback);
251
252         RefPtr<WebError> error = WebError::create();
253         m_callback(WebCore::IntPoint(), 0, 0, 0, toAPI(error.get()), context());
254
255         m_callback = 0;
256     }
257
258 private:
259
260     GestureCallback(void* context, CallbackFunction callback)
261         : CallbackBase(context)
262         , m_callback(callback)
263     {
264         ASSERT(m_callback);
265     }
266
267     CallbackFunction m_callback;
268 };
269
270 class TouchesCallback : public CallbackBase {
271 public:
272     typedef void (*CallbackFunction)(const WebCore::IntPoint&, uint32_t, WKErrorRef, void*);
273
274     static PassRefPtr<TouchesCallback> create(void* context, CallbackFunction callback)
275     {
276         return adoptRef(new TouchesCallback(context, callback));
277     }
278
279     virtual ~TouchesCallback()
280     {
281         ASSERT(!m_callback);
282     }
283
284     void performCallbackWithReturnValue(const WebCore::IntPoint& returnValue1, uint32_t returnValue2)
285     {
286         ASSERT(m_callback);
287
288         m_callback(returnValue1, returnValue2, 0, context());
289
290         m_callback = 0;
291     }
292
293     void invalidate()
294     {
295         ASSERT(m_callback);
296
297         RefPtr<WebError> error = WebError::create();
298         m_callback(WebCore::IntPoint(), 0, toAPI(error.get()), context());
299         
300         m_callback = 0;
301     }
302     
303 private:
304     
305     TouchesCallback(void* context, CallbackFunction callback)
306         : CallbackBase(context)
307         , m_callback(callback)
308     {
309         ASSERT(m_callback);
310     }
311     
312     CallbackFunction m_callback;
313 };
314 #endif
315
316 class WebPageProxy
317     : public API::ObjectImpl<API::Object::Type::Page>
318 #if ENABLE(INPUT_TYPE_COLOR)
319     , public WebColorPicker::Client
320 #endif
321     , public WebPopupMenuProxy::Client
322     , public CoreIPC::MessageReceiver {
323 public:
324
325     static PassRefPtr<WebPageProxy> create(PageClient&, WebProcessProxy&, WebPageGroup&, uint64_t pageID);
326     virtual ~WebPageProxy();
327
328     uint64_t pageID() const { return m_pageID; }
329
330     WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
331     WebFrameProxy* focusedFrame() const { return m_focusedFrame.get(); }
332     WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
333
334     DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); }
335
336     WebBackForwardList& backForwardList() { return m_backForwardList.get(); }
337
338 #if ENABLE(INSPECTOR)
339     WebInspectorProxy* inspector();
340 #endif
341
342 #if ENABLE(VIBRATION)
343     WebVibrationProxy* vibration() { return m_vibration.get(); }
344 #endif
345
346 #if ENABLE(FULLSCREEN_API)
347     WebFullScreenManagerProxy* fullScreenManager();
348 #endif
349
350 #if ENABLE(CONTEXT_MENUS)
351     void initializeContextMenuClient(const WKPageContextMenuClientBase*);
352 #endif
353     void initializeFindClient(const WKPageFindClientBase*);
354     void initializeFindMatchesClient(const WKPageFindMatchesClientBase*);
355     void initializeFormClient(const WKPageFormClientBase*);
356     void initializeLoaderClient(const WKPageLoaderClientBase*);
357     void initializePolicyClient(const WKPagePolicyClientBase*);
358     void initializeUIClient(const WKPageUIClientBase*);
359 #if PLATFORM(EFL)
360     void initializeUIPopupMenuClient(const WKPageUIPopupMenuClientBase*);
361 #endif
362
363     void initializeWebPage();
364
365     void close();
366     bool tryClose();
367     bool isClosed() const { return m_isClosed; }
368
369     void loadURL(const String&, API::Object* userData = nullptr);
370     void loadURLRequest(WebURLRequest*, API::Object* userData = nullptr);
371     void loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
372     void loadData(WebData*, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
373     void loadHTMLString(const String& htmlString, const String& baseURL, API::Object* userData = nullptr);
374     void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, API::Object* userData = nullptr);
375     void loadPlainTextString(const String&, API::Object* userData = nullptr);
376     void loadWebArchiveData(const WebData*, API::Object* userData = nullptr);
377
378     void stopLoading();
379     void reload(bool reloadFromOrigin);
380
381     void goForward();
382     bool canGoForward() const;
383     void goBack();
384     bool canGoBack() const;
385
386     void goToBackForwardItem(WebBackForwardListItem*);
387     void tryRestoreScrollPosition();
388     void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<RefPtr<API::Object>>* removedItems);
389     void shouldGoToBackForwardListItem(uint64_t itemID, bool& shouldGoToBackForwardListItem);
390     void willGoToBackForwardListItem(uint64_t itemID, CoreIPC::MessageDecoder&);
391
392     bool willHandleHorizontalScrollEvents() const;
393
394     bool canShowMIMEType(const String& mimeType);
395
396     bool drawsBackground() const { return m_drawsBackground; }
397     void setDrawsBackground(bool);
398
399     bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
400     void setDrawsTransparentBackground(bool);
401
402     WebCore::Color underlayColor() const { return m_underlayColor; }
403     void setUnderlayColor(const WebCore::Color&);
404
405     void viewWillStartLiveResize();
406     void viewWillEndLiveResize();
407
408     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&);
409     void setWindowResizerSize(const WebCore::IntSize&);
410     
411     void clearSelection();
412
413     void setViewNeedsDisplay(const WebCore::IntRect&);
414     void displayView();
415     bool canScrollView();
416     void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
417
418     enum class WantsReplyOrNot { DoesNotWantReply, DoesWantReply };
419     void viewStateDidChange(ViewState::Flags mayHaveChanged, WantsReplyOrNot = WantsReplyOrNot::DoesNotWantReply);
420     bool isInWindow() const { return m_viewState & ViewState::IsInWindow; }
421     void waitForDidUpdateViewState();
422
423     WebCore::IntSize viewSize() const;
424     bool isViewVisible() const { return m_viewState & ViewState::IsVisible; }
425     bool isViewWindowActive() const;
426
427     void executeEditCommand(const String& commandName);
428     void validateCommand(const String& commandName, PassRefPtr<ValidateCommandCallback>);
429 #if PLATFORM(IOS)
430     void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, PassRefPtr<GestureCallback>);
431     void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, PassRefPtr<TouchesCallback>);
432     void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, PassRefPtr<GestureCallback>);
433     void extendSelection(WebCore::TextGranularity);
434     void requestAutocorrectionData(const String& textForAutocorrection, PassRefPtr<AutocorrectionDataCallback>);
435     void applyAutocorrection(const String& correction, const String& originalText, PassRefPtr<StringCallback>);
436 #endif
437
438     const EditorState& editorState() const { return m_editorState; }
439     bool canDelete() const { return hasSelectedRange() && isContentEditable(); }
440     bool hasSelectedRange() const { return m_editorState.selectionIsRange; }
441     bool isContentEditable() const { return m_editorState.isContentEditable; }
442     
443     bool maintainsInactiveSelection() const { return m_maintainsInactiveSelection; }
444     void setMaintainsInactiveSelection(bool);
445 #if USE(TILED_BACKING_STORE) 
446     void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
447 #endif
448 #if PLATFORM(EFL)
449     void setThemePath(const String&);
450 #endif
451
452 #if PLATFORM(GTK)
453     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
454     void confirmComposition(const String& compositionString, int64_t selectionStart, int64_t selectionLength);
455     void cancelComposition();
456 #endif
457
458 #if PLATFORM(GTK)
459     void setInputMethodState(bool enabled);
460 #endif
461
462 #if PLATFORM(MAC)
463     void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
464     void viewExposedRectChanged(const WebCore::FloatRect& exposedRect, bool);
465     void exposedRectChangedTimerFired(WebCore::Timer<WebPageProxy>*);
466     void setMainFrameIsScrollable(bool);
467
468     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
469     void confirmComposition();
470     void cancelComposition();
471     bool insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
472     bool insertDictatedText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives);
473     void getMarkedRange(uint64_t& location, uint64_t& length);
474     void getSelectedRange(uint64_t& location, uint64_t& length);
475     void getAttributedSubstringFromRange(uint64_t location, uint64_t length, AttributedString&);
476     uint64_t characterIndexForPoint(const WebCore::IntPoint);
477     WebCore::IntRect firstRectForCharacterRange(uint64_t, uint64_t);
478     bool executeKeypressCommands(const Vector<WebCore::KeypressCommand>&);
479
480     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
481     bool shouldDelayWindowOrderingForEvent(const WebMouseEvent&);
482     bool acceptsFirstMouse(int eventNumber, const WebMouseEvent&);
483
484     void setAcceleratedCompositingRootLayer(PlatformLayer* rootLayer);
485
486 #if USE(APPKIT)
487     WKView* wkView() const;
488     void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize);
489 #endif
490 #endif // PLATFORM(MAC)
491 #if PLATFORM(EFL)
492     void handleInputMethodKeydown(bool& handled);
493     void confirmComposition(const String&);
494     void setComposition(const String&, Vector<WebCore::CompositionUnderline>&, int);
495     void cancelComposition();
496 #endif
497 #if PLATFORM(GTK)
498     PlatformWidget viewWidget();
499 #endif
500 #if USE(TILED_BACKING_STORE)
501     void commitPageTransitionViewport();
502 #endif
503
504     void handleMouseEvent(const NativeWebMouseEvent&);
505     void handleWheelEvent(const NativeWebWheelEvent&);
506     void handleKeyboardEvent(const NativeWebKeyboardEvent&);
507 #if ENABLE(TOUCH_EVENTS)
508     void handleTouchEvent(const NativeWebTouchEvent&);
509 #endif
510
511     void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
512     void centerSelectionInVisibleArea();
513
514     const String& toolTip() const { return m_toolTip; }
515
516     void setUserAgent(const String&);
517     const String& userAgent() const { return m_userAgent; }
518     void setApplicationNameForUserAgent(const String&);
519     const String& applicationNameForUserAgent() const { return m_applicationNameForUserAgent; }
520     void setCustomUserAgent(const String&);
521     const String& customUserAgent() const { return m_customUserAgent; }
522     static String standardUserAgent(const String& applicationName = String());
523
524     bool supportsTextEncoding() const;
525     void setCustomTextEncodingName(const String&);
526     String customTextEncodingName() const { return m_customTextEncodingName; }
527
528     bool areActiveDOMObjectsAndAnimationsSuspended() const { return m_isPageSuspended; }
529     void resumeActiveDOMObjectsAndAnimations();
530     void suspendActiveDOMObjectsAndAnimations();
531
532     double estimatedProgress() const;
533
534     void terminateProcess();
535
536     typedef bool (*WebPageProxySessionStateFilterCallback)(WKPageRef, WKStringRef type, WKTypeRef object, void* context);
537     PassRefPtr<WebData> sessionStateData(WebPageProxySessionStateFilterCallback, void* context) const;
538     void restoreFromSessionStateData(WebData*);
539
540     bool supportsTextZoom() const;
541     double textZoomFactor() const { return m_textZoomFactor; }
542     void setTextZoomFactor(double);
543     double pageZoomFactor() const { return m_pageZoomFactor; }
544     void setPageZoomFactor(double);
545     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
546
547     void scalePage(double scale, const WebCore::IntPoint& origin);
548     double pageScaleFactor() const { return m_pageScaleFactor; }
549
550     float deviceScaleFactor() const;
551     void setIntrinsicDeviceScaleFactor(float);
552     void setCustomDeviceScaleFactor(float);
553     void windowScreenDidChange(PlatformDisplayID);
554
555     LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
556
557     void setUseFixedLayout(bool);
558     void setFixedLayoutSize(const WebCore::IntSize&);
559     bool useFixedLayout() const { return m_useFixedLayout; };
560     const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
561
562     void listenForLayoutMilestones(WebCore::LayoutMilestones);
563
564     void setVisibilityState(WebCore::PageVisibilityState, bool isInitialState);
565     void didUpdateViewState() { m_waitingForDidUpdateViewState = false; }
566
567     bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
568     bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
569
570     void setSuppressScrollbarAnimations(bool);
571     bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
572
573     bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
574     bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
575     bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
576     bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
577
578     bool rubberBandsAtLeft() const;
579     void setRubberBandsAtLeft(bool);
580     bool rubberBandsAtRight() const;
581     void setRubberBandsAtRight(bool);
582     bool rubberBandsAtTop() const;
583     void setRubberBandsAtTop(bool);
584     bool rubberBandsAtBottom() const;
585     void setRubberBandsAtBottom(bool);
586
587     void setBackgroundExtendsBeyondPage(bool);
588     bool backgroundExtendsBeyondPage() const;
589
590     void setPaginationMode(WebCore::Pagination::Mode);
591     WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
592     void setPaginationBehavesLikeColumns(bool);
593     bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
594     void setPageLength(double);
595     double pageLength() const { return m_pageLength; }
596     void setGapBetweenPages(double);
597     double gapBetweenPages() const { return m_gapBetweenPages; }
598     unsigned pageCount() const { return m_pageCount; }
599
600 #if PLATFORM(MAC)
601     // Called by the web process through a message.
602     void registerWebProcessAccessibilityToken(const CoreIPC::DataReference&);
603     // Called by the UI process when it is ready to send its tokens to the web process.
604     void registerUIProcessAccessibilityTokens(const CoreIPC::DataReference& elemenToken, const CoreIPC::DataReference& windowToken);
605     bool readSelectionFromPasteboard(const String& pasteboardName);
606     String stringSelectionForPasteboard();
607     PassRefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
608     void makeFirstResponder();
609
610     ColorSpaceData colorSpace();
611 #endif
612
613     void pageScaleFactorDidChange(double);
614     void pageZoomFactorDidChange(double);
615
616     void setMemoryCacheClientCallsEnabled(bool);
617
618     // Find.
619     void findString(const String&, FindOptions, unsigned maxMatchCount);
620     void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
621     void getImageForFindMatch(int32_t matchIndex);
622     void selectFindMatch(int32_t matchIndex);
623     void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
624     void hideFindUI();
625     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
626     void didCountStringMatches(const String&, uint32_t matchCount);
627     void setFindIndicator(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut, bool animate);
628     void didFindString(const String&, uint32_t matchCount);
629     void didFailToFindString(const String&);
630     void didFindStringMatches(const String&, Vector<Vector<WebCore::IntRect>> matchRects, int32_t firstIndexAfterSelection);
631
632     void getContentsAsString(PassRefPtr<StringCallback>);
633 #if ENABLE(MHTML)
634     void getContentsAsMHTMLData(PassRefPtr<DataCallback>, bool useBinaryEncoding);
635 #endif
636     void getMainResourceDataOfFrame(WebFrameProxy*, PassRefPtr<DataCallback>);
637     void getResourceDataFromFrame(WebFrameProxy*, WebURL*, PassRefPtr<DataCallback>);
638     void getRenderTreeExternalRepresentation(PassRefPtr<StringCallback>);
639     void getSelectionOrContentsAsString(PassRefPtr<StringCallback>);
640     void getSelectionAsWebArchiveData(PassRefPtr<DataCallback>);
641     void getSourceForFrame(WebFrameProxy*, PassRefPtr<StringCallback>);
642     void getWebArchiveOfFrame(WebFrameProxy*, PassRefPtr<DataCallback>);
643     void runJavaScriptInMainFrame(const String&, PassRefPtr<ScriptValueCallback>);
644     void forceRepaint(PassRefPtr<VoidCallback>);
645
646     float headerHeight(WebFrameProxy*);
647     float footerHeight(WebFrameProxy*);
648     void drawHeader(WebFrameProxy*, const WebCore::FloatRect&);
649     void drawFooter(WebFrameProxy*, const WebCore::FloatRect&);
650
651 #if PLATFORM(MAC)
652     // Dictionary.
653     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
654 #endif
655
656     void receivedPolicyDecision(WebCore::PolicyAction, WebFrameProxy*, uint64_t listenerID);
657
658     void backForwardRemovedItem(uint64_t itemID);
659
660 #if ENABLE(DRAG_SUPPORT)    
661     // Drag and drop support.
662     void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
663     void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
664     void dragExited(WebCore::DragData&, const String& dragStorageName = String());
665     void performDrag(WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
666
667     void didPerformDragControllerAction(WebCore::DragSession);
668     void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
669 #if PLATFORM(MAC)
670     void setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, bool isLinkDrag);
671     void setPromisedData(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
672                          const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
673 #endif
674 #if PLATFORM(GTK)
675     void startDrag(const WebCore::DragData&, const ShareableBitmap::Handle& dragImage);
676 #endif
677 #endif
678
679     void processDidBecomeUnresponsive();
680     void interactionOccurredWhileProcessUnresponsive();
681     void processDidBecomeResponsive();
682     void processDidCrash();
683
684 #if USE(ACCELERATED_COMPOSITING)
685     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
686     virtual void exitAcceleratedCompositingMode();
687     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
688 #endif
689     
690     void didDraw();
691
692     enum UndoOrRedo { Undo, Redo };
693     void addEditCommand(WebEditCommandProxy*);
694     void removeEditCommand(WebEditCommandProxy*);
695     bool isValidEditCommand(WebEditCommandProxy*);
696     void registerEditCommand(PassRefPtr<WebEditCommandProxy>, UndoOrRedo);
697
698 #if PLATFORM(MAC)
699     void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
700     bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
701 #endif
702
703     WebProcessProxy& process() { return m_process.get(); }
704     PlatformProcessIdentifier processIdentifier() const;
705
706     WebPageGroup& pageGroup() { return m_pageGroup.get(); }
707
708     bool isValid() const;
709
710     PassRefPtr<API::Array> relatedPages() const;
711
712     const String& urlAtProcessExit() const { return m_urlAtProcessExit; }
713     FrameLoadState::State loadStateAtProcessExit() const { return m_loadStateAtProcessExit; }
714
715 #if ENABLE(DRAG_SUPPORT)
716     WebCore::DragSession dragSession() const { return m_currentDragSession; }
717     void resetDragOperation() { m_currentDragSession = WebCore::DragSession(); }
718 #endif
719
720     void preferencesDidChange();
721
722 #if ENABLE(CONTEXT_MENUS)
723     // Called by the WebContextMenuProxy.
724     void contextMenuItemSelected(const WebContextMenuItemData&);
725 #endif
726
727     // Called by the WebOpenPanelResultListenerProxy.
728     void didChooseFilesForOpenPanel(const Vector<String>&);
729     void didCancelForOpenPanel();
730
731     WebPageCreationParameters creationParameters() const
732     {
733         return m_creationParameters;
734     }
735
736 #if USE(COORDINATED_GRAPHICS)
737     void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&);
738 #endif
739
740 #if PLATFORM(EFL) || PLATFORM(GTK)
741     void handleDownloadRequest(DownloadProxy*);
742 #endif
743
744     void advanceToNextMisspelling(bool startBeforeSelection);
745     void changeSpellingToWord(const String& word);
746 #if USE(APPKIT)
747     void uppercaseWord();
748     void lowercaseWord();
749     void capitalizeWord();
750 #endif
751
752 #if PLATFORM(MAC)
753     bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
754     void setSmartInsertDeleteEnabled(bool);
755 #endif
756
757 #if PLATFORM(GTK)
758     String accessibilityPlugID() const { return m_accessibilityPlugID; }
759 #endif
760
761     void setCanRunModal(bool);
762     bool canRunModal();
763
764     void beginPrinting(WebFrameProxy*, const PrintInfo&);
765     void endPrinting();
766     void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<ComputedPagesCallback>);
767 #if PLATFORM(MAC)
768     void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, PassRefPtr<ImageCallback>);
769     void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, PassRefPtr<DataCallback>);
770 #elif PLATFORM(GTK)
771     void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<PrintFinishedCallback>);
772 #endif
773
774     PageLoadState& pageLoadState() { return m_pageLoadState; }
775
776 #if PLATFORM(MAC)
777     void handleAlternativeTextUIResult(const String& result);
778 #endif
779
780     void saveDataToFileInDownloadsFolder(const String& suggestedFilename, const String& mimeType, const String& originatingURLString, WebData*);
781     void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const CoreIPC::DataReference&);
782 #if PLATFORM(MAC)
783     void savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
784     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const CoreIPC::DataReference&, const String& pdfUUID);
785     void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
786 #endif
787
788     void linkClicked(const String&, const WebMouseEvent&);
789
790     WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
791
792     uint64_t renderTreeSize() const { return m_renderTreeSize; }
793
794     void setShouldSendEventsSynchronously(bool sync) { m_shouldSendEventsSynchronously = sync; };
795
796     void printMainFrame();
797     
798     void setMediaVolume(float);
799     void setMayStartMediaWhenInWindow(bool);
800
801     // WebPopupMenuProxy::Client
802     virtual NativeWebMouseEvent* currentlyProcessedMouseDownEvent();
803
804 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
805     void setAcceleratedCompositingWindowId(uint64_t nativeWindowId);
806 #endif
807
808     void setSuppressVisibilityUpdates(bool flag) { m_suppressVisibilityUpdates = flag; }
809     bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
810
811 #if PLATFORM(IOS)
812     void didFinishScrolling(const WebCore::FloatPoint& contentOffset);
813     void didFinishZooming(float newScale);
814
815     void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
816
817     void blurAssistedNode();
818 #endif
819
820     void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
821
822 #if ENABLE(INPUT_TYPE_COLOR)
823     void setColorPickerColor(const WebCore::Color&);
824     void endColorPicker();
825 #endif
826
827     const WebLoaderClient& loaderClient() { return m_loaderClient; }
828
829     WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
830     void setMinimumLayoutSize(const WebCore::IntSize&);
831
832     bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
833     void setAutoSizingShouldExpandToViewHeight(bool);
834
835     bool mainFrameInViewSourceMode() const { return m_mainFrameInViewSourceMode; }
836     void setMainFrameInViewSourceMode(bool);
837
838     void didReceiveAuthenticationChallengeProxy(uint64_t frameID, PassRefPtr<AuthenticationChallengeProxy>);
839
840     int64_t spellDocumentTag();
841     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
842     void didCancelCheckingText(uint64_t requestID);
843
844     void connectionWillOpen(CoreIPC::Connection*);
845     void connectionWillClose(CoreIPC::Connection*);
846
847     void didSaveToPageCache();
848         
849     void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
850     WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
851         
852 private:
853     WebPageProxy(PageClient&, WebProcessProxy&, WebPageGroup&, uint64_t pageID);
854     void platformInitialize();
855     void initializeCreationParameters();
856
857     void updateViewState(ViewState::Flags flagsToUpdate = ViewState::AllFlags);
858
859     void resetState();
860     void resetStateAfterProcessExited();
861
862     // CoreIPC::MessageReceiver
863     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE;
864     virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&, std::unique_ptr<CoreIPC::MessageEncoder>&) OVERRIDE;
865
866     // WebPopupMenuProxy::Client
867     virtual void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex);
868     virtual void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index);
869 #if PLATFORM(GTK)
870     virtual void failedToShowPopupMenu();
871 #endif
872
873     // Implemented in generated WebPageProxyMessageReceiver.cpp
874     void didReceiveWebPageProxyMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&);
875     void didReceiveSyncWebPageProxyMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&, std::unique_ptr<CoreIPC::MessageEncoder>&);
876
877     void didCreateMainFrame(uint64_t frameID);
878     void didCreateSubframe(uint64_t frameID);
879
880     void didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::MessageDecoder&);
881     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String&, CoreIPC::MessageDecoder&);
882     void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::MessageDecoder&);
883     void didCommitLoadForFrame(uint64_t frameID, const String& mimeType, uint32_t frameLoadType, const WebCore::CertificateInfo&, CoreIPC::MessageDecoder&);
884     void didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
885     void didFinishLoadForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
886     void didFailLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::MessageDecoder&);
887     void didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t sameDocumentNavigationType, const String&, CoreIPC::MessageDecoder&);
888     void didReceiveTitleForFrame(uint64_t frameID, const String&, CoreIPC::MessageDecoder&);
889     void didFirstLayoutForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
890     void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
891     void didLayout(uint32_t layoutMilestones, CoreIPC::MessageDecoder&);
892     void didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::MessageDecoder&);
893     void didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
894     void didRunInsecureContentForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
895     void didDetectXSSForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
896     void frameDidBecomeFrameSet(uint64_t frameID, bool);
897     void didStartProgress();
898     void didChangeProgress(double);
899     void didFinishProgress();
900
901     void decidePolicyForNavigationAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, uint64_t originatingFrameID, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest& request, uint64_t listenerID, CoreIPC::MessageDecoder&, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
902     void decidePolicyForNewWindowAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, const WebCore::ResourceRequest&, const String& frameName, uint64_t listenerID, CoreIPC::MessageDecoder&);
903     void decidePolicyForResponse(uint64_t frameID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, CoreIPC::MessageDecoder&);
904     void decidePolicyForResponseSync(uint64_t frameID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, CoreIPC::MessageDecoder&, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
905     void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::MessageDecoder&);
906
907     void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, CoreIPC::MessageDecoder&);
908
909     // UI client
910     void createNewPage(const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, uint32_t modifiers, int32_t mouseButton, uint64_t& newPageID, WebPageCreationParameters&);
911     void showPage();
912     void closePage(bool stopResponsivenessTimer);
913     void runJavaScriptAlert(uint64_t frameID, const String&);
914     void runJavaScriptConfirm(uint64_t frameID, const String&, bool& result);
915     void runJavaScriptPrompt(uint64_t frameID, const String&, const String&, String& result);
916     void shouldInterruptJavaScript(bool& result);
917     void setStatusText(const String&);
918     void mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t modifiers, CoreIPC::MessageDecoder&);
919 #if ENABLE(NETSCAPE_PLUGIN_API)
920     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
921 #endif // ENABLE(NETSCAPE_PLUGIN_API)
922     void setToolbarsAreVisible(bool toolbarsAreVisible);
923     void getToolbarsAreVisible(bool& toolbarsAreVisible);
924     void setMenuBarIsVisible(bool menuBarIsVisible);
925     void getMenuBarIsVisible(bool& menuBarIsVisible);
926     void setStatusBarIsVisible(bool statusBarIsVisible);
927     void getStatusBarIsVisible(bool& statusBarIsVisible);
928     void setIsResizable(bool isResizable);
929     void getIsResizable(bool& isResizable);
930     void setWindowFrame(const WebCore::FloatRect&);
931     void getWindowFrame(WebCore::FloatRect&);
932     void screenToWindow(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
933     void windowToScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
934     void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose);
935     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
936     void pageDidScroll();
937     void runOpenPanel(uint64_t frameID, const WebCore::FileChooserSettings&);
938     void printFrame(uint64_t frameID);
939     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>);
940     void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
941     void runModal();
942     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
943     void recommendedScrollbarStyleDidChange(int32_t newStyle);
944     void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
945     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
946     void didChangePageCount(unsigned);
947 #if ENABLE(NETSCAPE_PLUGIN_API)
948     void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
949     void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
950 #endif // ENABLE(NETSCAPE_PLUGIN_API)
951     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
952
953     void reattachToWebProcess();
954     void reattachToWebProcessWithItem(WebBackForwardListItem*);
955
956     void requestNotificationPermission(uint64_t notificationID, const String& originString);
957     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);
958     void cancelNotification(uint64_t notificationID);
959     void clearNotifications(const Vector<uint64_t>& notificationIDs);
960     void didDestroyNotification(uint64_t notificationID);
961
962 #if USE(TILED_BACKING_STORE)
963     void pageDidRequestScroll(const WebCore::IntPoint&);
964     void pageTransitionViewportReady();
965 #endif
966 #if USE(COORDINATED_GRAPHICS)
967     void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
968 #endif
969 #if PLATFORM(EFL) || PLATFORM(IOS)
970     void didChangeContentSize(const WebCore::IntSize&);
971 #endif
972
973 #if ENABLE(TOUCH_EVENTS)
974     void needTouchEvents(bool);
975 #endif
976
977 #if ENABLE(INPUT_TYPE_COLOR)
978     void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&);
979     void didChooseColor(const WebCore::Color&);
980     void didEndColorPicker();
981 #endif
982
983     void editorStateChanged(const EditorState&);
984
985     // Back/Forward list management
986     void backForwardAddItem(uint64_t itemID);
987     void backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle&);
988     void backForwardItemAtIndex(int32_t index, uint64_t& itemID);
989     void backForwardBackListCount(int32_t& count);
990     void backForwardForwardListCount(int32_t& count);
991     void backForwardClear();
992
993     // Undo management
994     void registerEditCommandForUndo(uint64_t commandID, uint32_t editAction);
995     void clearAllEditCommands();
996     void canUndoRedo(uint32_t action, bool& result);
997     void executeUndoRedo(uint32_t action, bool& result);
998
999     // Keyboard handling
1000 #if PLATFORM(MAC)
1001     void interpretQueuedKeyEvent(const EditorState&, bool& handled, Vector<WebCore::KeypressCommand>&);
1002     void executeSavedCommandBySelector(const String& selector, bool& handled);
1003 #endif
1004
1005 #if PLATFORM(GTK)
1006     void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&);
1007     void bindAccessibilityTree(const String&);
1008 #endif
1009 #if PLATFORM(EFL)
1010     void getEditorCommandsForKeyEvent(Vector<String>&);
1011 #endif
1012
1013     // Popup Menu.
1014     void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
1015     void hidePopupMenu();
1016
1017 #if ENABLE(CONTEXT_MENUS)
1018     // Context Menu.
1019     void showContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector<WebContextMenuItemData>&, CoreIPC::MessageDecoder&);
1020     void internalShowContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector<WebContextMenuItemData>&, CoreIPC::MessageDecoder&);
1021 #endif
1022
1023     // Search popup results
1024     void saveRecentSearches(const String&, const Vector<String>&);
1025     void loadRecentSearches(const String&, Vector<String>&);
1026
1027 #if PLATFORM(MAC)
1028     // Speech.
1029     void getIsSpeaking(bool&);
1030     void speak(const String&);
1031     void stopSpeaking();
1032
1033     // Spotlight.
1034     void searchWithSpotlight(const String&);
1035         
1036     void searchTheWeb(const String&);
1037
1038     // Dictionary.
1039     void didPerformDictionaryLookup(const AttributedString&, const DictionaryPopupInfo&);
1040 #endif
1041
1042     // Spelling and grammar.
1043 #if USE(UNIFIED_TEXT_CHECKING)
1044     void checkTextOfParagraph(const String& text, uint64_t checkingTypes, Vector<WebCore::TextCheckingResult>& results);
1045 #endif
1046     void checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength);
1047     void checkGrammarOfString(const String& text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);
1048     void spellingUIIsShowing(bool&);
1049     void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
1050     void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
1051     void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses);
1052     void learnWord(const String& word);
1053     void ignoreWord(const String& word);
1054     void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&);
1055
1056     void setFocus(bool focused);
1057     void takeFocus(uint32_t direction);
1058     void setToolTip(const String&);
1059     void setCursor(const WebCore::Cursor&);
1060     void setCursorHiddenUntilMouseMoves(bool);
1061
1062     void didReceiveEvent(uint32_t opaqueType, bool handled);
1063     void stopResponsivenessTimer();
1064
1065     void voidCallback(uint64_t);
1066     void dataCallback(const CoreIPC::DataReference&, uint64_t);
1067     void imageCallback(const ShareableBitmap::Handle&, uint64_t);
1068     void stringCallback(const String&, uint64_t);
1069     void scriptValueCallback(const CoreIPC::DataReference&, uint64_t);
1070     void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, uint64_t);
1071     void validateCommandCallback(const String&, bool, int, uint64_t);
1072 #if PLATFORM(IOS)
1073     void gestureCallback(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, uint64_t);
1074     void touchesCallback(const WebCore::IntPoint&, uint32_t, uint64_t);
1075     void autocorrectionDataCallback(const Vector<WebCore::FloatRect>&, const String&, float, uint64_t, uint64_t);
1076     void interpretKeyEvent(const EditorState&, bool isCharEvent, bool& handled);
1077 #endif
1078 #if PLATFORM(GTK)
1079     void printFinishedCallback(const WebCore::ResourceError&, uint64_t);
1080 #endif
1081
1082     void focusedFrameChanged(uint64_t frameID);
1083     void frameSetLargestFrameChanged(uint64_t frameID);
1084
1085     void canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const WebCore::ProtectionSpace&, bool& canAuthenticate);
1086     void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID);
1087
1088 #if PLATFORM(MAC)
1089     void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
1090     void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
1091 #endif
1092
1093     bool maybeInitializeSandboxExtensionHandle(const WebCore::URL&, SandboxExtension::Handle&);
1094
1095 #if PLATFORM(MAC) && !PLATFORM(IOS)
1096     void substitutionsPanelIsShowing(bool&);
1097     void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
1098     void dismissCorrectionPanel(int32_t reason);
1099     void dismissCorrectionPanelSoon(int32_t reason, String& result);
1100     void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
1101
1102 #if USE(DICTATION_ALTERNATIVES)
1103     void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
1104     void removeDictationAlternatives(uint64_t dictationContext);
1105     void dictationAlternatives(uint64_t dictationContext, Vector<String>& result);
1106 #endif
1107 #endif // PLATFORM(MAC) && !PLATFORM(IOS)
1108
1109 #if PLATFORM(IOS)
1110     void mainDocumentDidReceiveMobileDocType();
1111
1112     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);
1113
1114     void didChangeViewportArguments(const WebCore::ViewportArguments& viewportArguments);
1115
1116     void startAssistingNode(const WebCore::IntRect&, bool hasNextFocusable, bool hasPreviousFocusable);
1117     void stopAssistingNode();
1118 #endif // PLATFORM(IOS)
1119
1120 #if USE(SOUP)
1121     void didReceiveURIRequest(String uriString, uint64_t requestID);
1122 #endif
1123
1124     void clearLoadDependentCallbacks();
1125
1126     void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
1127
1128     void updateBackingStoreDiscardableState();
1129
1130     void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
1131
1132 #if PLUGIN_ARCHITECTURE(X11)
1133     void createPluginContainer(uint64_t& windowID);
1134     void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
1135 #endif
1136
1137     void processNextQueuedWheelEvent();
1138     void sendWheelEvent(const WebWheelEvent&);
1139
1140 #if ENABLE(NETSCAPE_PLUGIN_API)
1141     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);
1142 #endif
1143
1144     PageClient& m_pageClient;
1145     WebLoaderClient m_loaderClient;
1146     WebPolicyClient m_policyClient;
1147     WebFormClient m_formClient;
1148     WebUIClient m_uiClient;
1149 #if PLATFORM(EFL)
1150     WebUIPopupMenuClient m_uiPopupMenuClient;
1151 #endif
1152     WebFindClient m_findClient;
1153     WebFindMatchesClient m_findMatchesClient;
1154 #if ENABLE(CONTEXT_MENUS)
1155     WebPageContextMenuClient m_contextMenuClient;
1156 #endif
1157
1158     std::unique_ptr<DrawingAreaProxy> m_drawingArea;
1159     Ref<WebProcessProxy> m_process;
1160     Ref<WebPageGroup> m_pageGroup;
1161     RefPtr<WebFrameProxy> m_mainFrame;
1162     RefPtr<WebFrameProxy> m_focusedFrame;
1163     RefPtr<WebFrameProxy> m_frameSetLargestFrame;
1164
1165     String m_userAgent;
1166     String m_applicationNameForUserAgent;
1167     String m_customUserAgent;
1168     String m_customTextEncodingName;
1169
1170 #if ENABLE(INSPECTOR)
1171     RefPtr<WebInspectorProxy> m_inspector;
1172 #endif
1173
1174 #if ENABLE(FULLSCREEN_API)
1175     RefPtr<WebFullScreenManagerProxy> m_fullScreenManager;
1176 #endif
1177
1178 #if ENABLE(VIBRATION)
1179     RefPtr<WebVibrationProxy> m_vibration;
1180 #endif
1181
1182     HashMap<uint64_t, RefPtr<VoidCallback>> m_voidCallbacks;
1183     HashMap<uint64_t, RefPtr<DataCallback>> m_dataCallbacks;
1184     HashMap<uint64_t, RefPtr<ImageCallback>> m_imageCallbacks;
1185     HashMap<uint64_t, RefPtr<StringCallback>> m_stringCallbacks;
1186     HashSet<uint64_t> m_loadDependentStringCallbackIDs;
1187     HashMap<uint64_t, RefPtr<ScriptValueCallback>> m_scriptValueCallbacks;
1188     HashMap<uint64_t, RefPtr<ComputedPagesCallback>> m_computedPagesCallbacks;
1189     HashMap<uint64_t, RefPtr<ValidateCommandCallback>> m_validateCommandCallbacks;
1190 #if PLATFORM(IOS)
1191     HashMap<uint64_t, RefPtr<GestureCallback>> m_gestureCallbacks;
1192     HashMap<uint64_t, RefPtr<TouchesCallback>> m_touchesCallbacks;
1193     HashMap<uint64_t, RefPtr<AutocorrectionDataCallback>> m_autocorrectionCallbacks;
1194 #endif
1195 #if PLATFORM(GTK)
1196     HashMap<uint64_t, RefPtr<PrintFinishedCallback>> m_printFinishedCallbacks;
1197 #endif
1198
1199     HashSet<WebEditCommandProxy*> m_editCommandSet;
1200
1201 #if PLATFORM(MAC)
1202     HashSet<String> m_knownKeypressCommandNames;
1203 #endif
1204
1205     RefPtr<WebPopupMenuProxy> m_activePopupMenu;
1206     RefPtr<WebContextMenuProxy> m_activeContextMenu;
1207     WebHitTestResult::Data m_activeContextMenuHitTestResultData;
1208     RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
1209     GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
1210     NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
1211
1212     ViewState::Flags m_viewState;
1213
1214     bool m_canGoBack;
1215     bool m_canGoForward;
1216     Ref<WebBackForwardList> m_backForwardList;
1217     
1218     bool m_maintainsInactiveSelection;
1219
1220     String m_toolTip;
1221
1222     String m_urlAtProcessExit;
1223     FrameLoadState::State m_loadStateAtProcessExit;
1224
1225     EditorState m_editorState;
1226     bool m_temporarilyClosedComposition; // Editor state changed from hasComposition to !hasComposition, but that was only with shouldIgnoreCompositionSelectionChange yet.
1227
1228     double m_textZoomFactor;
1229     double m_pageZoomFactor;
1230     double m_pageScaleFactor;
1231     float m_intrinsicDeviceScaleFactor;
1232     float m_customDeviceScaleFactor;
1233
1234     LayerHostingMode m_layerHostingMode;
1235
1236     bool m_drawsBackground;
1237     bool m_drawsTransparentBackground;
1238
1239     WebCore::Color m_underlayColor;
1240
1241     bool m_areMemoryCacheClientCallsEnabled;
1242
1243     bool m_useFixedLayout;
1244     WebCore::IntSize m_fixedLayoutSize;
1245
1246     bool m_suppressScrollbarAnimations;
1247
1248     WebCore::Pagination::Mode m_paginationMode;
1249     bool m_paginationBehavesLikeColumns;
1250     double m_pageLength;
1251     double m_gapBetweenPages;
1252
1253     // If the process backing the web page is alive and kicking.
1254     bool m_isValid;
1255
1256     // Whether WebPageProxy::close() has been called on this page.
1257     bool m_isClosed;
1258
1259     // Whether it can run modal child web pages.
1260     bool m_canRunModal;
1261
1262     bool m_isInPrintingMode;
1263     bool m_isPerformingDOMPrintOperation;
1264
1265     bool m_inDecidePolicyForResponseSync;
1266     const WebCore::ResourceRequest* m_decidePolicyForResponseRequest;
1267     bool m_syncMimeTypePolicyActionIsValid;
1268     WebCore::PolicyAction m_syncMimeTypePolicyAction;
1269     uint64_t m_syncMimeTypePolicyDownloadID;
1270
1271     bool m_inDecidePolicyForNavigationAction;
1272     bool m_syncNavigationActionPolicyActionIsValid;
1273     WebCore::PolicyAction m_syncNavigationActionPolicyAction;
1274     uint64_t m_syncNavigationActionPolicyDownloadID;
1275
1276     Deque<NativeWebKeyboardEvent> m_keyEventQueue;
1277     Deque<NativeWebWheelEvent> m_wheelEventQueue;
1278     Deque<OwnPtr<Vector<NativeWebWheelEvent>>> m_currentlyProcessedWheelEvents;
1279
1280     bool m_processingMouseMoveEvent;
1281     OwnPtr<NativeWebMouseEvent> m_nextMouseMoveEvent;
1282     OwnPtr<NativeWebMouseEvent> m_currentlyProcessedMouseDownEvent;
1283
1284 #if ENABLE(TOUCH_EVENTS)
1285     bool m_needTouchEvents;
1286     Deque<QueuedTouchEvents> m_touchEventQueue;
1287 #endif
1288 #if ENABLE(INPUT_TYPE_COLOR)
1289     RefPtr<WebColorPicker> m_colorPicker;
1290     RefPtr<WebColorPickerResultListenerProxy> m_colorPickerResultListener;
1291 #endif
1292
1293     uint64_t m_pageID;
1294
1295     bool m_isPageSuspended;
1296
1297 #if PLATFORM(MAC)
1298     bool m_isSmartInsertDeleteEnabled;
1299 #endif
1300
1301 #if PLATFORM(GTK)
1302     String m_accessibilityPlugID;
1303 #endif
1304
1305     int64_t m_spellDocumentTag;
1306     bool m_hasSpellDocumentTag;
1307     unsigned m_pendingLearnOrIgnoreWordMessageCount;
1308
1309 #if ENABLE(DRAG_SUPPORT)
1310     WebCore::DragSession m_currentDragSession;
1311 #endif
1312
1313     PageLoadState m_pageLoadState;
1314
1315     bool m_mainFrameHasHorizontalScrollbar;
1316     bool m_mainFrameHasVerticalScrollbar;
1317
1318     // Whether horizontal wheel events can be handled directly for swiping purposes.
1319     bool m_canShortCircuitHorizontalWheelEvents;
1320
1321     bool m_mainFrameIsPinnedToLeftSide;
1322     bool m_mainFrameIsPinnedToRightSide;
1323     bool m_mainFrameIsPinnedToTopSide;
1324     bool m_mainFrameIsPinnedToBottomSide;
1325
1326     bool m_useLegacyImplicitRubberBandControl;
1327     bool m_rubberBandsAtLeft;
1328     bool m_rubberBandsAtRight;
1329     bool m_rubberBandsAtTop;
1330     bool m_rubberBandsAtBottom;
1331
1332     bool m_backgroundExtendsBeyondPage;
1333
1334     bool m_mainFrameInViewSourceMode;
1335         
1336     unsigned m_pageCount;
1337
1338     WebCore::IntRect m_visibleScrollerThumbRect;
1339
1340     uint64_t m_renderTreeSize;
1341
1342     bool m_shouldSendEventsSynchronously;
1343
1344     bool m_suppressVisibilityUpdates;
1345     bool m_autoSizingShouldExpandToViewHeight;
1346     WebCore::IntSize m_minimumLayoutSize;
1347
1348     float m_mediaVolume;
1349     bool m_mayStartMediaWhenInWindow;
1350
1351     bool m_waitingForDidUpdateViewState;
1352
1353 #if PLATFORM(MAC)
1354 #if !PLATFORM(IOS)
1355     WebCore::Timer<WebPageProxy> m_exposedRectChangedTimer;
1356 #endif // PLATFORM(IOS)
1357     WebCore::FloatRect m_exposedRect;
1358     WebCore::FloatRect m_lastSentExposedRect;
1359     bool m_clipsToExposedRect;
1360     bool m_lastSentClipsToExposedRect;
1361 #endif
1362
1363 #if ENABLE(PAGE_VISIBILITY_API)
1364     WebCore::PageVisibilityState m_visibilityState;
1365 #endif
1366
1367 #if PLATFORM(MAC)
1368     HashMap<String, String> m_temporaryPDFFiles;
1369 #endif
1370         
1371     WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1372
1373     WebPageCreationParameters m_creationParameters;
1374 };
1375
1376 } // namespace WebKit
1377
1378 #endif // WebPageProxy_h