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