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