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