9139b482e221be261ea4ee37f02a688b38469f83
[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     const WebLoaderClient& loaderClient() { return m_loaderClient; }
759
760 private:
761     WebPageProxy(PageClient*, PassRefPtr<WebProcessProxy>, WebPageGroup*, uint64_t pageID);
762
763     virtual Type type() const { return APIType; }
764
765     // WebPopupMenuProxy::Client
766     virtual void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex);
767     virtual void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index);
768 #if PLATFORM(GTK)
769     virtual void failedToShowPopupMenu();
770 #endif
771 #if PLATFORM(QT)
772     virtual void changeSelectedIndex(int32_t newSelectedIndex);
773     virtual void closePopupMenu();
774 #endif
775
776     // Implemented in generated WebPageProxyMessageReceiver.cpp
777     void didReceiveWebPageProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
778     void didReceiveSyncWebPageProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
779
780     void didCreateMainFrame(uint64_t frameID);
781     void didCreateSubframe(uint64_t frameID, uint64_t parentFrameID);
782     void didSaveFrameToPageCache(uint64_t frameID);
783     void didRestoreFrameFromPageCache(uint64_t frameID, uint64_t parentFrameID);
784
785     void didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::MessageDecoder&);
786     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String&, CoreIPC::MessageDecoder&);
787     void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::MessageDecoder&);
788     void didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo&, CoreIPC::MessageDecoder&);
789     void didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
790     void didFinishLoadForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
791     void didFailLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::MessageDecoder&);
792     void didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t sameDocumentNavigationType, const String&, CoreIPC::MessageDecoder&);
793     void didReceiveTitleForFrame(uint64_t frameID, const String&, CoreIPC::MessageDecoder&);
794     void didFirstLayoutForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
795     void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
796     void didNewFirstVisuallyNonEmptyLayout(CoreIPC::MessageDecoder&);
797     void didLayout(uint32_t layoutMilestones, CoreIPC::MessageDecoder&);
798     void didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::MessageDecoder&);
799     void didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
800     void didRunInsecureContentForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
801     void didDetectXSSForFrame(uint64_t frameID, CoreIPC::MessageDecoder&);
802     void frameDidBecomeFrameSet(uint64_t frameID, bool);
803     void didStartProgress();
804     void didChangeProgress(double);
805     void didFinishProgress();
806
807 #if ENABLE(WEB_INTENTS)
808     void didReceiveIntentForFrame(uint64_t frameID, const IntentData&, CoreIPC::MessageDecoder&);
809 #endif
810 #if ENABLE(WEB_INTENTS_TAG)
811     void registerIntentServiceForFrame(uint64_t frameID, const IntentServiceInfo&, CoreIPC::MessageDecoder&);
812 #endif
813     
814     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);
815     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&);
816     void decidePolicyForResponse(uint64_t frameID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, uint64_t listenerID, CoreIPC::MessageDecoder&, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
817     void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::MessageDecoder&);
818
819     void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, uint64_t listenerID, CoreIPC::MessageDecoder&);
820
821     // Resource load client
822     void didInitiateLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const WebCore::ResourceRequest&, bool pageIsProvisionallyLoading);
823     void didSendRequestForResource(uint64_t frameID, uint64_t resourceIdentifier, const WebCore::ResourceRequest&, const WebCore::ResourceResponse& redirectResponse);
824     void didReceiveResponseForResource(uint64_t frameID, uint64_t resourceIdentifier, const WebCore::ResourceResponse&);
825     void didReceiveContentLengthForResource(uint64_t frameID, uint64_t resourceIdentifier, uint64_t contentLength);
826     void didFinishLoadForResource(uint64_t frameID, uint64_t resourceIdentifier);
827     void didFailLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const WebCore::ResourceError&);
828
829     // UI client
830     void createNewPage(const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, uint32_t modifiers, int32_t mouseButton, uint64_t& newPageID, WebPageCreationParameters&);
831     void showPage();
832     void closePage(bool stopResponsivenessTimer);
833     void runJavaScriptAlert(uint64_t frameID, const String&);
834     void runJavaScriptConfirm(uint64_t frameID, const String&, bool& result);
835     void runJavaScriptPrompt(uint64_t frameID, const String&, const String&, String& result);
836     void shouldInterruptJavaScript(bool& result);
837     void setStatusText(const String&);
838     void mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t modifiers, CoreIPC::MessageDecoder&);
839     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& url, const String& pluginsPageURL);
840     void setToolbarsAreVisible(bool toolbarsAreVisible);
841     void getToolbarsAreVisible(bool& toolbarsAreVisible);
842     void setMenuBarIsVisible(bool menuBarIsVisible);
843     void getMenuBarIsVisible(bool& menuBarIsVisible);
844     void setStatusBarIsVisible(bool statusBarIsVisible);
845     void getStatusBarIsVisible(bool& statusBarIsVisible);
846     void setIsResizable(bool isResizable);
847     void getIsResizable(bool& isResizable);
848     void setWindowFrame(const WebCore::FloatRect&);
849     void getWindowFrame(WebCore::FloatRect&);
850     void screenToWindow(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
851     void windowToScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
852     void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose);
853     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
854     void pageDidScroll();
855     void runOpenPanel(uint64_t frameID, const WebCore::FileChooserSettings&);
856     void printFrame(uint64_t frameID);
857     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);
858     void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
859     void runModal();
860     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
861     void recommendedScrollbarStyleDidChange(int32_t newStyle);
862     void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
863     void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
864     void didChangePageCount(unsigned);
865     void didFailToInitializePlugin(const String& mimeType);
866     void didBlockInsecurePluginVersion(const String& mimeType, const String& urlString);
867     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
868
869     void reattachToWebProcess();
870     void reattachToWebProcessWithItem(WebBackForwardListItem*);
871
872     void requestNotificationPermission(uint64_t notificationID, const String& originString);
873     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);
874     
875 #if USE(TILED_BACKING_STORE)
876     void pageDidRequestScroll(const WebCore::IntPoint&);
877     void pageTransitionViewportReady();
878 #endif
879 #if PLATFORM(QT)
880     void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
881 #endif
882
883 #if PLATFORM(QT) || PLATFORM(EFL)
884     void didChangeContentsSize(const WebCore::IntSize&);
885 #endif
886
887 #if ENABLE(TOUCH_EVENTS)
888     void needTouchEvents(bool);
889 #endif
890
891 #if ENABLE(INPUT_TYPE_COLOR)
892     void showColorChooser(const WebCore::Color& initialColor, const WebCore::IntRect&);
893     void didChooseColor(const WebCore::Color&);
894     void didEndColorChooser();
895 #endif
896
897     void editorStateChanged(const EditorState&);
898
899     // Back/Forward list management
900     void backForwardAddItem(uint64_t itemID);
901     void backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle&);
902     void backForwardItemAtIndex(int32_t index, uint64_t& itemID);
903     void backForwardBackListCount(int32_t& count);
904     void backForwardForwardListCount(int32_t& count);
905     void backForwardClear();
906
907     // Undo management
908     void registerEditCommandForUndo(uint64_t commandID, uint32_t editAction);
909     void clearAllEditCommands();
910     void canUndoRedo(uint32_t action, bool& result);
911     void executeUndoRedo(uint32_t action, bool& result);
912
913     // Keyboard handling
914 #if PLATFORM(MAC)
915     void interpretQueuedKeyEvent(const EditorState&, bool& handled, Vector<WebCore::KeypressCommand>&);
916     void executeSavedCommandBySelector(const String& selector, bool& handled);
917 #endif
918
919 #if PLATFORM(GTK)
920     void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&);
921     void bindAccessibilityTree(const String&);
922 #endif
923 #if PLATFORM(EFL)
924     void getEditorCommandsForKeyEvent(Vector<String>&);
925 #endif
926
927     // Popup Menu.
928     void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
929     void hidePopupMenu();
930 #if PLATFORM(WIN)
931     void setPopupMenuSelectedIndex(int32_t);
932 #endif
933
934 #if ENABLE(CONTEXT_MENUS)
935     // Context Menu.
936     void showContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector<WebContextMenuItemData>&, CoreIPC::MessageDecoder&);
937     void internalShowContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector<WebContextMenuItemData>&, CoreIPC::MessageDecoder&);
938 #endif
939
940     // Search popup results
941     void saveRecentSearches(const String&, const Vector<String>&);
942     void loadRecentSearches(const String&, Vector<String>&);
943
944 #if PLATFORM(MAC)
945     // Speech.
946     void getIsSpeaking(bool&);
947     void speak(const String&);
948     void stopSpeaking();
949
950     // Spotlight.
951     void searchWithSpotlight(const String&);
952
953     // Dictionary.
954     void didPerformDictionaryLookup(const AttributedString&, const DictionaryPopupInfo&);
955 #endif
956
957     // Spelling and grammar.
958     int64_t spellDocumentTag();
959 #if USE(UNIFIED_TEXT_CHECKING)
960     void checkTextOfParagraph(const String& text, uint64_t checkingTypes, Vector<WebCore::TextCheckingResult>& results);
961 #endif
962     void checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength);
963     void checkGrammarOfString(const String& text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);
964     void spellingUIIsShowing(bool&);
965     void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
966     void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
967     void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses);
968     void learnWord(const String& word);
969     void ignoreWord(const String& word);
970
971     void setFocus(bool focused);
972     void takeFocus(uint32_t direction);
973     void setToolTip(const String&);
974     void setCursor(const WebCore::Cursor&);
975     void setCursorHiddenUntilMouseMoves(bool);
976
977     void didReceiveEvent(uint32_t opaqueType, bool handled);
978     void stopResponsivenessTimer();
979
980     void voidCallback(uint64_t);
981     void dataCallback(const CoreIPC::DataReference&, uint64_t);
982     void imageCallback(const ShareableBitmap::Handle&, uint64_t);
983     void stringCallback(const String&, uint64_t);
984     void scriptValueCallback(const CoreIPC::DataReference&, uint64_t);
985     void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, uint64_t);
986     void validateCommandCallback(const String&, bool, int, uint64_t);
987 #if PLATFORM(GTK)
988     void printFinishedCallback(const WebCore::ResourceError&, uint64_t);
989 #endif
990
991     void focusedFrameChanged(uint64_t frameID);
992     void frameSetLargestFrameChanged(uint64_t frameID);
993
994     void canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const WebCore::ProtectionSpace&, bool& canAuthenticate);
995     void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID);
996
997     void didFinishLoadingDataForCustomRepresentation(const String& suggestedFilename, const CoreIPC::DataReference&);
998
999 #if PLATFORM(MAC)
1000     void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
1001     void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
1002 #endif
1003
1004     void clearPendingAPIRequestURL() { m_pendingAPIRequestURL = String(); }
1005     void setPendingAPIRequestURL(const String& pendingAPIRequestURL) { m_pendingAPIRequestURL = pendingAPIRequestURL; }
1006
1007     bool maybeInitializeSandboxExtensionHandle(const WebCore::KURL&, SandboxExtension::Handle&);
1008
1009 #if PLATFORM(MAC)
1010     void substitutionsPanelIsShowing(bool&);
1011 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
1012     void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
1013     void dismissCorrectionPanel(int32_t reason);
1014     void dismissCorrectionPanelSoon(int32_t reason, String& result);
1015     void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
1016 #endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
1017
1018 #if USE(DICTATION_ALTERNATIVES)
1019     void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
1020     void dismissDictationAlternativeUI();
1021     void removeDictationAlternatives(uint64_t dictationContext);
1022     void dictationAlternatives(uint64_t dictationContext, Vector<String>& result);
1023 #endif
1024 #endif // PLATFORM(MAC)
1025
1026 #if USE(SOUP)
1027     void didReceiveURIRequest(String uriString, uint64_t requestID);
1028 #endif
1029
1030     void clearLoadDependentCallbacks();
1031
1032     void performDragControllerAction(DragControllerAction, WebCore::DragData*, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
1033
1034     void updateBackingStoreDiscardableState();
1035
1036 #if PLATFORM(WIN)
1037     void scheduleChildWindowGeometryUpdate(const WindowGeometry&);
1038 #endif
1039
1040     void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
1041
1042 #if PLUGIN_ARCHITECTURE(X11)
1043     void createPluginContainer(uint64_t& windowID);
1044     void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
1045 #endif
1046
1047     void processNextQueuedWheelEvent();
1048     void sendWheelEvent(const WebWheelEvent&);
1049
1050     PageClient* m_pageClient;
1051     WebLoaderClient m_loaderClient;
1052     WebPolicyClient m_policyClient;
1053     WebFormClient m_formClient;
1054     WebResourceLoadClient m_resourceLoadClient;
1055     WebUIClient m_uiClient;
1056     WebFindClient m_findClient;
1057 #if ENABLE(CONTEXT_MENUS)
1058     WebPageContextMenuClient m_contextMenuClient;
1059 #endif
1060
1061     OwnPtr<DrawingAreaProxy> m_drawingArea;
1062     RefPtr<WebProcessProxy> m_process;
1063     RefPtr<WebPageGroup> m_pageGroup;
1064     RefPtr<WebFrameProxy> m_mainFrame;
1065     RefPtr<WebFrameProxy> m_focusedFrame;
1066     RefPtr<WebFrameProxy> m_frameSetLargestFrame;
1067
1068     String m_userAgent;
1069     String m_applicationNameForUserAgent;
1070     String m_customUserAgent;
1071     String m_customTextEncodingName;
1072
1073 #if ENABLE(INSPECTOR)
1074     RefPtr<WebInspectorProxy> m_inspector;
1075 #endif
1076
1077 #if ENABLE(FULLSCREEN_API)
1078     RefPtr<WebFullScreenManagerProxy> m_fullScreenManager;
1079 #endif
1080
1081 #if ENABLE(VIBRATION)
1082     RefPtr<WebVibrationProxy> m_vibration;
1083 #endif
1084
1085     HashMap<uint64_t, RefPtr<VoidCallback> > m_voidCallbacks;
1086     HashMap<uint64_t, RefPtr<DataCallback> > m_dataCallbacks;
1087     HashMap<uint64_t, RefPtr<ImageCallback> > m_imageCallbacks;
1088     HashMap<uint64_t, RefPtr<StringCallback> > m_stringCallbacks;
1089     HashSet<uint64_t> m_loadDependentStringCallbackIDs;
1090     HashMap<uint64_t, RefPtr<ScriptValueCallback> > m_scriptValueCallbacks;
1091     HashMap<uint64_t, RefPtr<ComputedPagesCallback> > m_computedPagesCallbacks;
1092     HashMap<uint64_t, RefPtr<ValidateCommandCallback> > m_validateCommandCallbacks;
1093 #if PLATFORM(GTK)
1094     HashMap<uint64_t, RefPtr<PrintFinishedCallback> > m_printFinishedCallbacks;
1095 #endif
1096
1097     HashSet<WebEditCommandProxy*> m_editCommandSet;
1098
1099 #if PLATFORM(MAC)
1100     HashSet<String> m_knownKeypressCommandNames;
1101 #endif
1102
1103     RefPtr<WebPopupMenuProxy> m_activePopupMenu;
1104     RefPtr<WebContextMenuProxy> m_activeContextMenu;
1105     WebHitTestResult::Data m_activeContextMenuHitTestResultData;
1106     RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
1107     GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
1108     NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
1109
1110     double m_estimatedProgress;
1111
1112     // Whether the web page is contained in a top-level window.
1113     bool m_isInWindow;
1114
1115     // Whether the page is visible; if the backing view is visible and inserted into a window.
1116     bool m_isVisible;
1117
1118     bool m_canGoBack;
1119     bool m_canGoForward;
1120     RefPtr<WebBackForwardList> m_backForwardList;
1121     
1122     bool m_maintainsInactiveSelection;
1123
1124     String m_toolTip;
1125
1126     String m_urlAtProcessExit;
1127     WebFrameProxy::LoadState m_loadStateAtProcessExit;
1128
1129     EditorState m_editorState;
1130
1131     double m_textZoomFactor;
1132     double m_pageZoomFactor;
1133     double m_pageScaleFactor;
1134     float m_intrinsicDeviceScaleFactor;
1135     float m_customDeviceScaleFactor;
1136
1137     LayerHostingMode m_layerHostingMode;
1138
1139     bool m_drawsBackground;
1140     bool m_drawsTransparentBackground;
1141
1142     bool m_areMemoryCacheClientCallsEnabled;
1143
1144     bool m_useFixedLayout;
1145     WebCore::IntSize m_fixedLayoutSize;
1146
1147     bool m_suppressScrollbarAnimations;
1148
1149     WebCore::Pagination::Mode m_paginationMode;
1150     bool m_paginationBehavesLikeColumns;
1151     double m_pageLength;
1152     double m_gapBetweenPages;
1153
1154     // If the process backing the web page is alive and kicking.
1155     bool m_isValid;
1156
1157     // Whether WebPageProxy::close() has been called on this page.
1158     bool m_isClosed;
1159
1160     // Whether it can run modal child web pages.
1161     bool m_canRunModal;
1162
1163     bool m_isInPrintingMode;
1164     bool m_isPerformingDOMPrintOperation;
1165
1166     bool m_inDecidePolicyForResponse;
1167     bool m_syncMimeTypePolicyActionIsValid;
1168     WebCore::PolicyAction m_syncMimeTypePolicyAction;
1169     uint64_t m_syncMimeTypePolicyDownloadID;
1170
1171     bool m_inDecidePolicyForNavigationAction;
1172     bool m_syncNavigationActionPolicyActionIsValid;
1173     WebCore::PolicyAction m_syncNavigationActionPolicyAction;
1174     uint64_t m_syncNavigationActionPolicyDownloadID;
1175
1176 #if ENABLE(GESTURE_EVENTS)
1177     Deque<WebGestureEvent> m_gestureEventQueue;
1178 #endif
1179     Deque<NativeWebKeyboardEvent> m_keyEventQueue;
1180     Deque<NativeWebWheelEvent> m_wheelEventQueue;
1181     Deque<OwnPtr<Vector<NativeWebWheelEvent> > > m_currentlyProcessedWheelEvents;
1182
1183     bool m_processingMouseMoveEvent;
1184     OwnPtr<NativeWebMouseEvent> m_nextMouseMoveEvent;
1185     OwnPtr<NativeWebMouseEvent> m_currentlyProcessedMouseDownEvent;
1186
1187 #if ENABLE(TOUCH_EVENTS)
1188     bool m_needTouchEvents;
1189     Deque<QueuedTouchEvents> m_touchEventQueue;
1190 #endif
1191 #if ENABLE(INPUT_TYPE_COLOR)
1192     RefPtr<WebColorChooserProxy> m_colorChooser;
1193     RefPtr<WebColorPickerResultListenerProxy> m_colorPickerResultListener;
1194 #endif
1195
1196     uint64_t m_pageID;
1197
1198     bool m_isPageSuspended;
1199
1200 #if PLATFORM(MAC)
1201     bool m_isSmartInsertDeleteEnabled;
1202 #endif
1203
1204 #if PLATFORM(GTK)
1205     String m_accessibilityPlugID;
1206 #endif
1207
1208     int64_t m_spellDocumentTag;
1209     bool m_hasSpellDocumentTag;
1210     unsigned m_pendingLearnOrIgnoreWordMessageCount;
1211
1212     bool m_mainFrameHasCustomRepresentation;
1213
1214 #if ENABLE(DRAG_SUPPORT)
1215     WebCore::DragSession m_currentDragSession;
1216 #endif
1217
1218     String m_pendingAPIRequestURL;
1219
1220     bool m_mainFrameHasHorizontalScrollbar;
1221     bool m_mainFrameHasVerticalScrollbar;
1222
1223     // Whether horizontal wheel events can be handled directly for swiping purposes.
1224     bool m_canShortCircuitHorizontalWheelEvents;
1225
1226     bool m_mainFrameIsPinnedToLeftSide;
1227     bool m_mainFrameIsPinnedToRightSide;
1228     bool m_mainFrameIsPinnedToTopSide;
1229     bool m_mainFrameIsPinnedToBottomSide;
1230
1231     unsigned m_pageCount;
1232
1233     WebCore::IntRect m_visibleScrollerThumbRect;
1234
1235     uint64_t m_renderTreeSize;
1236
1237     static WKPageDebugPaintFlags s_debugPaintFlags;
1238
1239     bool m_shouldSendEventsSynchronously;
1240
1241     bool m_suppressVisibilityUpdates;
1242
1243     float m_mediaVolume;
1244     bool m_mayStartMediaWhenInWindow;
1245
1246 #if PLATFORM(QT)
1247     WTF::HashSet<RefPtr<QtRefCountedNetworkRequestData> > m_applicationSchemeRequests;
1248 #endif
1249
1250 #if ENABLE(PAGE_VISIBILITY_API)
1251     WebCore::PageVisibilityState m_visibilityState;
1252 #endif
1253 };
1254
1255 } // namespace WebKit
1256
1257 #endif // WebPageProxy_h