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