3322ad93cec6e060e1f76e3df3c969a1df69a086
[WebKit-https.git] / Source / WebKit2 / WebProcess / WebPage / WebPage.h
1 /*
2  * Copyright (C) 2010, 2011, 2013 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 WebPage_h
27 #define WebPage_h
28
29 #include "APIObject.h"
30 #include "DrawingArea.h"
31 #include "FindController.h"
32 #include "GeolocationPermissionRequestManager.h"
33 #include "ImageOptions.h"
34 #include "InjectedBundlePageDiagnosticLoggingClient.h"
35 #include "InjectedBundlePageEditorClient.h"
36 #include "InjectedBundlePageFormClient.h"
37 #include "InjectedBundlePageFullScreenClient.h"
38 #include "InjectedBundlePageLoaderClient.h"
39 #include "InjectedBundlePagePolicyClient.h"
40 #include "InjectedBundlePageResourceLoadClient.h"
41 #include "InjectedBundlePageUIClient.h"
42 #include "MessageReceiver.h"
43 #include "MessageSender.h"
44 #include "TapHighlightController.h"
45 #include "Plugin.h"
46 #include "SandboxExtension.h"
47 #include "ShareableBitmap.h"
48 #include "WebUndoStep.h"
49 #include <WebCore/DictationAlternative.h>
50 #include <WebCore/DragData.h>
51 #include <WebCore/Editor.h>
52 #include <WebCore/FrameLoaderTypes.h>
53 #include <WebCore/IntRect.h>
54 #include <WebCore/Page.h>
55 #include <WebCore/PageVisibilityState.h>
56 #include <WebCore/PlatformScreen.h>
57 #include <WebCore/ScrollTypes.h>
58 #include <WebCore/TextChecking.h>
59 #include <WebCore/UserActivity.h>
60 #include <WebCore/ViewState.h>
61 #include <WebCore/ViewportConfiguration.h>
62 #include <WebCore/WebCoreKeyboardUIMode.h>
63 #include <wtf/HashMap.h>
64 #include <wtf/OwnPtr.h>
65 #include <wtf/PassRefPtr.h>
66 #include <wtf/RefPtr.h>
67 #include <wtf/text/WTFString.h>
68
69 #if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
70 #include "WebPageAccessibilityObject.h"
71 #include <wtf/gobject/GRefPtr.h>
72 #endif
73
74 #if PLATFORM(GTK)
75 #include "ArgumentCodersGtk.h"
76 #include "WebPrintOperationGtk.h"
77 #endif
78
79 #if PLATFORM(IOS)
80 #include "WKGestureTypes.h"
81 #endif
82
83 #if ENABLE(TOUCH_EVENTS)
84 #if PLATFORM(IOS)
85 #include <WebKitAdditions/PlatformTouchEventIOS.h>
86 #else
87 #include <WebCore/PlatformTouchEvent.h>
88 #endif
89 #endif
90
91 #if ENABLE(CONTEXT_MENUS)
92 #include "InjectedBundlePageContextMenuClient.h"
93 #endif
94
95 #if PLATFORM(COCOA)
96 #include "DictionaryPopupInfo.h"
97 #include "LayerHostingContext.h"
98 #include "ViewGestureGeometryCollector.h"
99 #include <wtf/RetainPtr.h>
100 OBJC_CLASS CALayer;
101 OBJC_CLASS NSDictionary;
102 OBJC_CLASS NSObject;
103 OBJC_CLASS WKAccessibilityWebPageObject;
104
105 #define ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC 1
106 #endif
107
108 namespace API {
109 class Array;
110 }
111
112 namespace IPC {
113     class ArgumentDecoder;
114     class Connection;
115 }
116
117 namespace WebCore {
118     class GraphicsContext;
119     class Frame;
120     class FrameView;
121     class HTMLPlugInElement;
122     class IntPoint;
123     class KeyboardEvent;
124     class Page;
125     class PrintContext;
126     class Range;
127     class ResourceResponse;
128     class ResourceRequest;
129     class SharedBuffer;
130     class SubstituteData;
131     class TextCheckingRequest;
132     class VisibleSelection;
133     struct KeypressCommand;
134     struct TextCheckingResult;
135 }
136
137 namespace WebKit {
138
139 class DrawingArea;
140 class InjectedBundleBackForwardList;
141 class NotificationPermissionRequestManager;
142 class PageBanner;
143 class PageOverlay;
144 class PluginView;
145 class SessionState;
146 class VisibleContentRectUpdateInfo;
147 class WebColorChooser;
148 class WebContextMenu;
149 class WebContextMenuItemData;
150 class WebEvent;
151 class WebFrame;
152 class WebFullScreenManager;
153 class WebImage;
154 class WebInspector;
155 class WebInspectorClient;
156 class WebKeyboardEvent;
157 class WebMouseEvent;
158 class WebNotificationClient;
159 class WebOpenPanelResultListener;
160 class WebPageGroupProxy;
161 class WebPopupMenu;
162 class WebVideoFullscreenManager;
163 class WebWheelEvent;
164 struct AssistedNodeInformation;
165 struct AttributedString;
166 struct EditingRange;
167 struct EditorState;
168 struct InteractionInformationAtPosition;
169 struct PrintInfo;
170 struct WebPageCreationParameters;
171 struct WebPreferencesStore;
172
173 #if PLATFORM(COCOA)
174 class RemoteLayerTreeTransaction;
175 #endif
176
177 #if ENABLE(TOUCH_EVENTS)
178 class WebTouchEvent;
179 #endif
180
181 typedef Vector<RefPtr<PageOverlay>> PageOverlayList;
182
183 class WebPage : public API::ObjectImpl<API::Object::Type::BundlePage>, public IPC::MessageReceiver, public IPC::MessageSender {
184 public:
185     static PassRefPtr<WebPage> create(uint64_t pageID, const WebPageCreationParameters&);
186     virtual ~WebPage();
187
188     void reinitializeWebPage(const WebPageCreationParameters&);
189
190     void close();
191
192     static WebPage* fromCorePage(WebCore::Page*);
193
194     WebCore::Page* corePage() const { return m_page.get(); }
195     uint64_t pageID() const { return m_pageID; }
196     WebCore::SessionID sessionID() const;
197     bool isUsingEphemeralSession() const;
198     void setSessionID(WebCore::SessionID);
199
200     void setSize(const WebCore::IntSize&);
201     const WebCore::IntSize& size() const { return m_viewSize; }
202     WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
203     
204     InjectedBundleBackForwardList* backForwardList();
205     DrawingArea* drawingArea() const { return m_drawingArea.get(); }
206 #if ENABLE(ASYNC_SCROLLING)
207     WebCore::ScrollingCoordinator* scrollingCoordinator() const;
208 #endif
209
210     WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
211
212     void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
213
214     bool scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
215
216     void centerSelectionInVisibleArea();
217     
218 #if PLATFORM(COCOA)
219     void willCommitLayerTree(RemoteLayerTreeTransaction&);
220 #endif
221
222 #if ENABLE(INSPECTOR)
223     WebInspector* inspector();
224 #endif
225     
226 #if PLATFORM(IOS)
227     WebVideoFullscreenManager* videoFullscreenManager();
228 #endif
229
230 #if ENABLE(FULLSCREEN_API)
231     WebFullScreenManager* fullScreenManager();
232 #endif
233
234     // -- Called by the DrawingArea.
235     // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
236     void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
237     void drawPageOverlay(PageOverlay*, WebCore::GraphicsContext&, const WebCore::IntRect&);
238     void layoutIfNeeded();
239
240     // -- Called from WebCore clients.
241     bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
242
243     void didStartPageTransition();
244     void didCompletePageTransition();
245     void didCommitLoad(WebFrame*);
246     void didFinishLoad(WebFrame*);
247     void show();
248     String userAgent() const { return m_userAgent; }
249     WebCore::IntRect windowResizerRect() const;
250     WebCore::KeyboardUIMode keyboardUIMode();
251
252     WebUndoStep* webUndoStep(uint64_t);
253     void addWebUndoStep(uint64_t, WebUndoStep*);
254     void removeWebEditCommand(uint64_t);
255     bool isInRedo() const { return m_isInRedo; }
256
257     void setActivePopupMenu(WebPopupMenu*);
258
259 #if ENABLE(INPUT_TYPE_COLOR)
260     WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
261     void setActiveColorChooser(WebColorChooser*);
262     void didChooseColor(const WebCore::Color&);
263     void didEndColorPicker();
264 #endif
265
266     WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
267     void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>);
268
269     void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override;
270     void didReceiveSyncMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
271
272     // -- InjectedBundle methods
273 #if ENABLE(CONTEXT_MENUS)
274     void initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClientBase*);
275 #endif
276     void initializeInjectedBundleEditorClient(WKBundlePageEditorClientBase*);
277     void initializeInjectedBundleFormClient(WKBundlePageFormClientBase*);
278     void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClientBase*);
279     void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
280     void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClientBase*);
281     void initializeInjectedBundleUIClient(WKBundlePageUIClientBase*);
282 #if ENABLE(FULLSCREEN_API)
283     void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClientBase*);
284 #endif
285     void initializeInjectedBundleDiagnosticLoggingClient(WKBundlePageDiagnosticLoggingClientBase*);
286
287 #if ENABLE(CONTEXT_MENUS)
288     InjectedBundlePageContextMenuClient& injectedBundleContextMenuClient() { return m_contextMenuClient; }
289 #endif
290     InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; }
291     InjectedBundlePageFormClient& injectedBundleFormClient() { return m_formClient; }
292     InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; }
293     InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
294     InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
295     InjectedBundlePageUIClient& injectedBundleUIClient() { return m_uiClient; }
296     InjectedBundlePageDiagnosticLoggingClient& injectedBundleDiagnosticLoggingClient() { return m_logDiagnosticMessageClient; }
297 #if ENABLE(FULLSCREEN_API)
298     InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
299 #endif
300
301     bool findStringFromInjectedBundle(const String&, FindOptions);
302
303     WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
304
305     WebCore::Frame* mainFrame() const; // May return 0.
306     WebCore::FrameView* mainFrameView() const; // May return 0.
307
308     PassRefPtr<WebCore::Range> currentSelectionAsRange();
309
310 #if ENABLE(NETSCAPE_PLUGIN_API)
311     PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&, String& newMIMEType);
312 #endif
313
314 #if ENABLE(WEBGL)
315     WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const String&);
316     WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(WebFrame*, const String&);
317 #endif // ENABLE(WEBGL)
318     
319     EditorState editorState() const;
320
321     String renderTreeExternalRepresentation() const;
322     String renderTreeExternalRepresentationForPrinting() const;
323     uint64_t renderTreeSize() const;
324
325     void setTracksRepaints(bool);
326     bool isTrackingRepaints() const;
327     void resetTrackedRepaints();
328     PassRefPtr<API::Array> trackedRepaintRects();
329
330     void executeEditingCommand(const String& commandName, const String& argument);
331     bool isEditingCommandEnabled(const String& commandName);
332     void clearMainFrameName();
333     void sendClose();
334
335     void sendSetWindowFrame(const WebCore::FloatRect&);
336
337     double textZoomFactor() const;
338     void setTextZoomFactor(double);
339     double pageZoomFactor() const;
340     void setPageZoomFactor(double);
341     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
342     void windowScreenDidChange(uint64_t);
343
344     void scalePage(double scale, const WebCore::IntPoint& origin);
345     double pageScaleFactor() const;
346
347     void setUseFixedLayout(bool);
348     bool useFixedLayout() const { return m_useFixedLayout; }
349     void setFixedLayoutSize(const WebCore::IntSize&);
350
351     void listenForLayoutMilestones(uint32_t /* LayoutMilestones */);
352
353     void setSuppressScrollbarAnimations(bool);
354
355     void setBackgroundExtendsBeyondPage(bool);
356
357     void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
358     void setPaginationBehavesLikeColumns(bool);
359     void setPageLength(double);
360     void setGapBetweenPages(double);
361
362     void postInjectedBundleMessage(const String& messageName, IPC::MessageDecoder&);
363
364     bool drawsBackground() const { return m_drawsBackground; }
365     bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
366
367     void setUnderlayColor(const WebCore::Color& color) { m_underlayColor = color; }
368     WebCore::Color underlayColor() const { return m_underlayColor; }
369
370     void stopLoading();
371     void stopLoadingFrame(uint64_t frameID);
372     void setDefersLoading(bool deferLoading);
373
374     void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
375     void exitAcceleratedCompositingMode();
376
377     void addPluginView(PluginView*);
378     void removePluginView(PluginView*);
379
380     void setThumbnailScale(double);
381
382     bool isVisible() const { return m_viewState & WebCore::ViewState::IsVisible; }
383     bool isVisibleOrOccluded() const { return m_viewState & WebCore::ViewState::IsVisibleOrOccluded; }
384
385     LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
386     void setLayerHostingMode(unsigned);
387
388 #if PLATFORM(COCOA)
389     void updatePluginsActiveAndFocusedState();
390     const WebCore::FloatRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
391     const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates() const { return m_windowFrameInUnflippedScreenCoordinates; }
392     const WebCore::FloatRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
393
394     bool hasCachedWindowFrame() const { return m_hasCachedWindowFrame; }
395
396 #if !PLATFORM(IOS)
397     void setTopOverhangImage(PassRefPtr<WebImage>);
398     void setBottomOverhangImage(PassRefPtr<WebImage>);
399 #endif // !PLATFORM(IOS)
400
401     void updateHeaderAndFooterLayersForDeviceScaleChange(float scaleFactor);
402 #endif // PLATFORM(COCOA)
403
404     bool windowIsFocused() const;
405     bool windowAndWebPageAreFocused() const;
406     void installPageOverlay(PassRefPtr<PageOverlay>, bool shouldFadeIn = false);
407     void uninstallPageOverlay(PageOverlay*, bool shouldFadeOut = false);
408     bool hasPageOverlay() const { return m_pageOverlays.size(); }
409     PageOverlayList& pageOverlays() { return m_pageOverlays; }
410
411 #if !PLATFORM(IOS)
412     void setHeaderPageBanner(PassRefPtr<PageBanner>);
413     PageBanner* headerPageBanner();
414     void setFooterPageBanner(PassRefPtr<PageBanner>);
415     PageBanner* footerPageBanner();
416
417     void hidePageBanners();
418     void showPageBanners();
419 #endif // !PLATFORM(IOS)
420
421     WebCore::IntPoint screenToRootView(const WebCore::IntPoint&);
422     WebCore::IntRect rootViewToScreen(const WebCore::IntRect&);
423
424     PassRefPtr<WebImage> scaledSnapshotWithOptions(const WebCore::IntRect&, double scaleFactor, SnapshotOptions);
425     PassRefPtr<WebImage> snapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
426
427     static const WebEvent* currentEvent();
428
429     FindController& findController() { return m_findController; }
430
431 #if ENABLE(GEOLOCATION)
432     GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager; }
433 #endif
434
435 #if PLATFORM(IOS)
436     WebCore::FloatSize viewportScreenSize() const;
437     void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
438     void didReceiveMobileDocType(bool);
439
440     double minimumPageScaleFactor() const;
441     double maximumPageScaleFactor() const;
442     bool allowsUserScaling() const;
443
444     void handleTap(const WebCore::IntPoint&);
445     void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
446
447     void blurAssistedNode();
448     void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID);
449     void updateSelectionWithTouches(const WebCore::IntPoint& point, uint32_t touches, bool baseIsStart, uint64_t callbackID);
450     void updateBlockSelectionWithTouch(const WebCore::IntPoint&, uint32_t touch, uint32_t handlePosition);
451     void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID);
452     void extendSelection(uint32_t granularity);
453     void elementDidFocus(WebCore::Node*);
454     void elementDidBlur(WebCore::Node*);
455     void requestAutocorrectionData(const String& textForAutocorrection, uint64_t callbackID);
456     void applyAutocorrection(const String& correction, const String& originalText, uint64_t callbackID);
457     void syncApplyAutocorrection(const String& correction, const String& originalText, bool& correctionApplied);
458     void requestAutocorrectionContext(uint64_t callbackID);
459     void getAutocorrectionContext(String& beforeText, String& markedText, String& selectedText, String& afterText, uint64_t& location, uint64_t& length);
460     void getPositionInformation(const WebCore::IntPoint&, InteractionInformationAtPosition&);
461     void requestPositionInformation(const WebCore::IntPoint&);
462     void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
463     void stopInteraction();
464     void performActionOnElement(uint32_t action);
465     void focusNextAssistedNode(bool isForward);
466     void setAssistedNodeValue(const String&);
467     void setAssistedNodeValueAsNumber(double);
468     void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection);
469 #endif
470
471     NotificationPermissionRequestManager* notificationPermissionRequestManager();
472
473     void pageDidScroll();
474 #if USE(TILED_BACKING_STORE)
475     void pageDidRequestScroll(const WebCore::IntPoint&);
476     void setFixedVisibleContentRect(const WebCore::IntRect&);
477     void sendViewportAttributesChanged();
478 #endif
479
480 #if ENABLE(CONTEXT_MENUS)
481     WebContextMenu* contextMenu();
482     WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
483 #endif
484     
485     bool hasLocalDataForURL(const WebCore::URL&);
486     String cachedResponseMIMETypeForURL(const WebCore::URL&);
487     String cachedSuggestedFilenameForURL(const WebCore::URL&);
488     PassRefPtr<WebCore::SharedBuffer> cachedResponseDataForURL(const WebCore::URL&);
489
490     static bool canHandleRequest(const WebCore::ResourceRequest&);
491
492     class SandboxExtensionTracker {
493     public:
494         ~SandboxExtensionTracker();
495
496         void invalidate();
497
498         void beginLoad(WebFrame*, const SandboxExtension::Handle& handle);
499         void willPerformLoadDragDestinationAction(PassRefPtr<SandboxExtension> pendingDropSandboxExtension);
500         void didStartProvisionalLoad(WebFrame*);
501         void didCommitProvisionalLoad(WebFrame*);
502         void didFailProvisionalLoad(WebFrame*);
503
504     private:
505         void setPendingProvisionalSandboxExtension(PassRefPtr<SandboxExtension>);
506
507         RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
508         RefPtr<SandboxExtension> m_provisionalSandboxExtension;
509         RefPtr<SandboxExtension> m_committedSandboxExtension;
510     };
511
512     SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
513
514 #if PLATFORM(EFL)
515     void setThemePath(const String&);
516 #endif
517
518 #if USE(TILED_BACKING_STORE)
519     void commitPageTransitionViewport();
520 #endif
521
522 #if PLATFORM(GTK)
523     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeLength);
524     void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
525     void cancelComposition();
526 #endif
527
528     void didChangeSelection();
529
530 #if PLATFORM(COCOA)
531     void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
532     WKAccessibilityWebPageObject* accessibilityRemoteObject();
533     NSObject *accessibilityObjectForMainFramePlugin();
534     const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; }
535     
536     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
537
538     void insertTextAsync(const String& text, const EditingRange& replacementRange);
539     void getMarkedRangeAsync(uint64_t callbackID);
540     void getSelectedRangeAsync(uint64_t callbackID);
541     void characterIndexForPointAsync(const WebCore::IntPoint&, uint64_t callbackID);
542     void firstRectForCharacterRangeAsync(const EditingRange&, uint64_t callbackID);
543     void setCompositionAsync(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
544     void confirmCompositionAsync();
545
546 #if PLATFORM(MAC)
547     void cancelComposition(EditorState& newState);
548     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations);
549     void attributedSubstringForCharacterRangeAsync(const EditingRange&, uint64_t callbackID);
550 #if !USE(ASYNC_NSTEXTINPUTCLIENT)
551     void insertText(const String& text, const EditingRange& replacementRange, bool& handled, EditorState& newState);
552     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange, EditorState& newState);
553     void confirmComposition(EditorState& newState);
554     void insertDictatedText(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool& handled, EditorState& newState);
555     void getAttributedSubstringFromRange(const EditingRange&, AttributedString&);
556     void getMarkedRange(EditingRange&);
557     void getSelectedRange(EditingRange&);
558     void characterIndexForPoint(const WebCore::IntPoint point, uint64_t& result);
559     void firstRectForCharacterRange(const EditingRange&, WebCore::IntRect& resultRect);
560     void executeKeypressCommands(const Vector<WebCore::KeypressCommand>&, bool& handled, EditorState& newState);
561 #endif
562 #endif
563
564     void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
565     void getStringSelectionForPasteboard(WTF::String& stringValue);
566     void getDataSelectionForPasteboard(const WTF::String pasteboardType, SharedMemory::Handle& handle, uint64_t& size);
567     void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
568     void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
569     bool performNonEditingBehaviorForSelector(const String&, WebCore::KeyboardEvent*);
570 #elif PLATFORM(EFL)
571     void confirmComposition(const String& compositionString);
572     void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
573     void cancelComposition();
574 #elif PLATFORM(GTK)
575 #if USE(TEXTURE_MAPPER_GL)
576     void setAcceleratedCompositingWindowId(int64_t nativeWindowHandle);
577 #endif
578 #endif
579
580 #if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
581     void updateAccessibilityTree();
582 #endif
583
584     void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
585     bool hasCompositionForTesting();
586     void confirmCompositionForTesting(const String& compositionString);
587
588     // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
589     // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
590     void dummy(bool&);
591
592 #if PLATFORM(COCOA)
593     void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&);
594
595     bool isSpeaking();
596     void speak(const String&);
597     void stopSpeaking();
598
599 #endif
600
601     bool isSmartInsertDeleteEnabled();
602     void setSmartInsertDeleteEnabled(bool);
603
604     bool isSelectTrailingWhitespaceEnabled();
605     void setSelectTrailingWhitespaceEnabled(bool);
606
607     void replaceSelectionWithText(WebCore::Frame*, const String&);
608     void clearSelection();
609
610 #if ENABLE(DRAG_SUPPORT)
611 #if PLATFORM(GTK)
612     void performDragControllerAction(uint64_t action, WebCore::DragData);
613 #else
614     void performDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, const WTF::String& dragStorageName, uint32_t flags, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
615 #endif
616     void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
617
618     void willPerformLoadDragDestinationAction();
619     void mayPerformUploadDragDestinationAction();
620 #endif // ENABLE(DRAG_SUPPORT)
621
622     void beginPrinting(uint64_t frameID, const PrintInfo&);
623     void endPrinting();
624     void computePagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
625 #if PLATFORM(COCOA)
626     void drawRectToImage(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, uint64_t callbackID);
627     void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, uint64_t callbackID);
628 #elif PLATFORM(GTK)
629     void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
630     void didFinishPrintOperation(const WebCore::ResourceError&, uint64_t callbackID);
631 #endif
632
633     void setMediaVolume(float);
634     void setMayStartMediaWhenInWindow(bool);
635
636     void updateMainFrameScrollOffsetPinning();
637
638     bool mainFrameHasCustomContentProvider() const;
639     void addMIMETypeWithCustomContentProvider(const String&);
640
641     void mainFrameDidLayout();
642
643     bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
644     void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
645
646     bool canRunModal() const { return m_canRunModal; }
647     void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
648
649     void runModal();
650
651     void setDeviceScaleFactor(float);
652     float deviceScaleFactor() const;
653
654     void setMemoryCacheMessagesEnabled(bool);
655
656     void forceRepaintWithoutCallback();
657
658     void unmarkAllMisspellings();
659     void unmarkAllBadGrammar();
660 #if PLATFORM(COCOA)
661     void handleAlternativeTextUIResult(const String&);
662 #endif
663
664     // For testing purpose.
665     void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
666     void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
667     void simulateMouseMotion(WebCore::IntPoint, double time);
668
669 #if ENABLE(CONTEXT_MENUS)
670     void contextMenuShowing() { m_isShowingContextMenu = true; }
671 #endif
672
673     void wheelEvent(const WebWheelEvent&);
674
675     void numWheelEventHandlersChanged(unsigned);
676     void recomputeShortCircuitHorizontalWheelEventsState();
677
678     void updateVisibilityState(bool isInitialState = false);
679
680 #if PLATFORM(IOS)
681     void setViewportConfigurationMinimumLayoutSize(const WebCore::IntSize&);
682     void viewportConfigurationChanged();
683     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
684     bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
685     void willStartUserTriggeredZooming();
686     void applicationWillResignActive();
687     void applicationWillEnterForeground();
688     void applicationDidBecomeActive();
689 #endif
690
691 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
692     uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }
693 #endif
694
695     bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
696     bool canPluginHandleResponse(const WebCore::ResourceResponse& response);
697
698     bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
699     void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
700     bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
701     void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
702     bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
703     void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
704     void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
705     bool tabToLinksEnabled() const { return m_tabToLinks; }
706
707     bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
708     void setScrollingPerformanceLoggingEnabled(bool);
709
710 #if PLATFORM(COCOA)
711     bool shouldUsePDFPlugin() const;
712     bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
713     void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
714 #endif
715
716     void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size);
717 #if PLATFORM(COCOA)
718     void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
719 #endif
720
721     bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
722
723     void setMinimumLayoutSize(const WebCore::IntSize&);
724     WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
725
726     void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
727     bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
728
729     bool canShowMIMEType(const String& MIMEType) const;
730
731     void addTextCheckingRequest(uint64_t requestID, PassRefPtr<WebCore::TextCheckingRequest>);
732     void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
733     void didCancelCheckingText(uint64_t requestID);
734
735 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
736     void determinePrimarySnapshottedPlugIn();
737     void determinePrimarySnapshottedPlugInTimerFired();
738     void resetPrimarySnapshottedPlugIn();
739     bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
740 #endif
741
742     unsigned extendIncrementalRenderingSuppression();
743     void stopExtendingIncrementalRenderingSuppression(unsigned token);
744     bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
745
746     WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
747     void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
748
749     WKTypeRef pageOverlayCopyAccessibilityAttributeValue(WKStringRef attribute, WKTypeRef parameter);
750     WKArrayRef pageOverlayCopyAccessibilityAttributesNames(bool parameterizedNames);
751
752     PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
753
754     void getBytecodeProfile(uint64_t callbackID);
755
756 #if ENABLE(IMAGE_CONTROLS)
757     void replaceControlledImage(const ShareableBitmap::Handle&);
758 #endif
759
760 private:
761     WebPage(uint64_t pageID, const WebPageCreationParameters&);
762
763     // IPC::MessageSender
764     virtual IPC::Connection* messageSenderConnection() override;
765     virtual uint64_t messageSenderDestinationID() override;
766
767     void platformInitialize();
768
769     void didReceiveWebPageMessage(IPC::Connection*, IPC::MessageDecoder&);
770     void didReceiveSyncWebPageMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&);
771
772 #if PLATFORM(IOS)
773     static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
774     PassRefPtr<WebCore::Range> rangeForWebSelectionAtPosition(const WebCore::IntPoint&, const WebCore::VisiblePosition&, WKSelectionFlags&);
775     PassRefPtr<WebCore::Range> rangeForBlockAtPoint(const WebCore::IntPoint&);
776     void computeExpandAndShrinkThresholdsForHandle(const WebCore::IntPoint&, WKHandlePosition, float& growThreshold, float& shrinkThreshold);
777     PassRefPtr<WebCore::Range> changeBlockSelection(const WebCore::IntPoint&, WKHandlePosition, float& growThreshold, float& shrinkThreshold, WKSelectionFlags&);
778     PassRefPtr<WebCore::Range> expandedRangeFromHandle(WebCore::Range*, WKHandlePosition);
779     PassRefPtr<WebCore::Range> contractedRangeFromHandle(WebCore::Range* currentRange, WKHandlePosition, WKSelectionFlags&);
780     void getAssistedNodeInformation(AssistedNodeInformation&);
781     void platformInitializeAccessibility();
782     RefPtr<WebCore::Range> m_currentBlockSelection;
783 #endif
784 #if !PLATFORM(COCOA)
785     static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
786 #endif
787     bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
788
789 #if PLATFORM(MAC)
790     bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
791 #endif
792
793     String sourceForFrame(WebFrame*);
794
795     void loadDataImpl(PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::URL& baseURL, const WebCore::URL& failingURL, IPC::MessageDecoder&);
796     void loadString(const String&, const String& MIMEType, const WebCore::URL& baseURL, const WebCore::URL& failingURL, IPC::MessageDecoder&);
797
798     bool platformHasLocalDataForURL(const WebCore::URL&);
799
800     // Actions
801     void tryClose();
802     void loadRequest(uint64_t navigationID, const WebCore::ResourceRequest&, const SandboxExtension::Handle&, IPC::MessageDecoder&);
803     void loadData(const IPC::DataReference&, const String& MIMEType, const String& encodingName, const String& baseURL, IPC::MessageDecoder&);
804     void loadHTMLString(const String& htmlString, const String& baseURL, IPC::MessageDecoder&);
805     void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, IPC::MessageDecoder&);
806     void loadPlainTextString(const String&, IPC::MessageDecoder&);
807     void loadWebArchiveData(const IPC::DataReference&, IPC::MessageDecoder&);
808     void reload(uint64_t navigationID, bool reloadFromOrigin, const SandboxExtension::Handle&);
809     void goForward(uint64_t);
810     void goBack(uint64_t);
811     void goToBackForwardItem(uint64_t);
812     void tryRestoreScrollPosition();
813     void setActive(bool);
814     void setFocused(bool);
815     void setViewIsVisible(bool);
816     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&);
817     void setWindowResizerSize(const WebCore::IntSize&);
818     void updateIsInWindow(bool isInitialState = false);
819     void setViewState(WebCore::ViewState::Flags, bool wantsDidUpdateViewState = false);
820     void validateCommand(const String&, uint64_t);
821     void executeEditCommand(const String&);
822
823     void mouseEvent(const WebMouseEvent&);
824     void mouseEventSyncForTesting(const WebMouseEvent&, bool&);
825     void wheelEventSyncForTesting(const WebWheelEvent&, bool&);
826     void keyEvent(const WebKeyboardEvent&);
827     void keyEventSyncForTesting(const WebKeyboardEvent&, bool&);
828 #if ENABLE(TOUCH_EVENTS)
829     void touchEvent(const WebTouchEvent&);
830     void touchEventSyncForTesting(const WebTouchEvent&, bool& handled);
831 #endif
832 #if ENABLE(CONTEXT_MENUS)
833     void contextMenuHidden() { m_isShowingContextMenu = false; }
834 #endif
835
836     static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
837     static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
838
839     void loadURLInFrame(const String&, uint64_t frameID);
840
841     uint64_t restoreSession(const SessionState&);
842     void restoreSessionAndNavigateToCurrentItem(const SessionState&);
843
844     void didRemoveBackForwardItem(uint64_t);
845
846 #if ENABLE(REMOTE_INSPECTOR)
847     void setAllowsRemoteInspection(bool);
848 #endif
849
850     void setDrawsBackground(bool);
851     void setDrawsTransparentBackground(bool);
852
853     void viewWillStartLiveResize();
854     void viewWillEndLiveResize();
855
856     void getContentsAsString(uint64_t callbackID);
857 #if ENABLE(MHTML)
858     void getContentsAsMHTMLData(uint64_t callbackID, bool useBinaryEncoding);
859 #endif
860     void getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID);
861     void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, uint64_t callbackID);
862     void getRenderTreeExternalRepresentation(uint64_t callbackID);
863     void getSelectionOrContentsAsString(uint64_t callbackID);
864     void getSelectionAsWebArchiveData(uint64_t callbackID);
865     void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
866     void getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID);
867     void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
868     void forceRepaint(uint64_t callbackID);
869     void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, uint64_t callbackID);
870
871     void preferencesDidChange(const WebPreferencesStore&);
872     void platformPreferencesDidChange(const WebPreferencesStore&);
873     void updatePreferences(const WebPreferencesStore&);
874
875     void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID);
876     void setUserAgent(const String&);
877     void setCustomTextEncodingName(const String&);
878     void suspendActiveDOMObjectsAndAnimations();
879     void resumeActiveDOMObjectsAndAnimations();
880
881 #if PLATFORM(COCOA)
882     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
883     void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range*, NSDictionary *options);
884
885     void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
886
887     RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
888     void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
889     void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
890     void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
891 #endif
892
893     void setMainFrameIsScrollable(bool);
894
895     void unapplyEditCommand(uint64_t commandID);
896     void reapplyEditCommand(uint64_t commandID);
897     void didRemoveEditCommand(uint64_t commandID);
898
899     void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
900     void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
901     void getImageForFindMatch(uint32_t matchIndex);
902     void selectFindMatch(uint32_t matchIndex);
903     void hideFindUI();
904     void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
905
906 #if USE(COORDINATED_GRAPHICS)
907     void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area);
908 #endif
909
910     void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
911     void setTextForActivePopupMenu(int32_t index);
912
913 #if PLATFORM(GTK)
914     void failedToShowPopupMenu();
915 #endif
916
917     void didChooseFilesForOpenPanel(const Vector<String>&);
918     void didCancelForOpenPanel();
919 #if ENABLE(WEB_PROCESS_SANDBOX)
920     void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
921 #endif
922
923     void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
924
925     void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
926
927     void advanceToNextMisspelling(bool startBeforeSelection);
928     void changeSpellingToWord(const String& word);
929 #if USE(APPKIT)
930     void uppercaseWord();
931     void lowercaseWord();
932     void capitalizeWord();
933 #endif
934
935 #if ENABLE(CONTEXT_MENUS)
936     void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
937 #endif
938
939     void changeSelectedIndex(int32_t index);
940     void setCanStartMediaTimerFired();
941     void didUpdateViewStateTimerFired();
942
943     bool canHandleUserEvents() const;
944
945     static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
946
947     static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
948     static PluginView* pluginViewForFrame(WebCore::Frame*);
949
950     static PassRefPtr<WebCore::Range> rangeFromEditingRange(WebCore::Frame&, const EditingRange&);
951
952     void reportUsedFeatures();
953
954     uint64_t m_pageID;
955
956     OwnPtr<WebCore::Page> m_page;
957     RefPtr<WebFrame> m_mainFrame;
958     RefPtr<InjectedBundleBackForwardList> m_backForwardList;
959
960     RefPtr<WebPageGroupProxy> m_pageGroup;
961
962     String m_userAgent;
963
964     WebCore::IntSize m_viewSize;
965     std::unique_ptr<DrawingArea> m_drawingArea;
966
967     HashSet<PluginView*> m_pluginViews;
968     bool m_hasSeenPlugin;
969
970     HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
971
972     bool m_useFixedLayout;
973
974     bool m_drawsBackground;
975     bool m_drawsTransparentBackground;
976
977     WebCore::Color m_underlayColor;
978
979     bool m_isInRedo;
980     bool m_isClosed;
981
982     bool m_tabToLinks;
983     
984     bool m_asynchronousPluginInitializationEnabled;
985     bool m_asynchronousPluginInitializationEnabledForAllPlugins;
986     bool m_artificialPluginInitializationDelayEnabled;
987
988     bool m_scrollingPerformanceLoggingEnabled;
989
990     bool m_mainFrameIsScrollable;
991
992 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
993     bool m_readyToFindPrimarySnapshottedPlugin;
994     bool m_didFindPrimarySnapshottedPlugin;
995     unsigned m_numberOfPrimarySnapshotDetectionAttempts;
996     String m_primaryPlugInPageOrigin;
997     String m_primaryPlugInOrigin;
998     String m_primaryPlugInMimeType;
999     RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
1000 #endif
1001
1002     // The layer hosting mode.
1003     LayerHostingMode m_layerHostingMode;
1004
1005 #if PLATFORM(COCOA)
1006     bool m_pdfPluginEnabled;
1007
1008     bool m_hasCachedWindowFrame;
1009
1010     // The frame of the containing window in screen coordinates.
1011     WebCore::FloatRect m_windowFrameInScreenCoordinates;
1012
1013     // The frame of the containing window in unflipped screen coordinates.
1014     WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
1015
1016     // The frame of the view in window coordinates.
1017     WebCore::FloatRect m_viewFrameInWindowCoordinates;
1018
1019     // The accessibility position of the view.
1020     WebCore::FloatPoint m_accessibilityPosition;
1021     
1022     RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1023
1024     ViewGestureGeometryCollector m_viewGestureGeometryCollector;
1025
1026 #elif HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
1027     GRefPtr<WebPageAccessibilityObject> m_accessibilityObject;
1028 #endif
1029
1030 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
1031     // Our view's window in the UI process.
1032     uint64_t m_nativeWindowHandle;
1033 #endif
1034
1035 #if !PLATFORM(IOS)
1036     RefPtr<PageBanner> m_headerBanner;
1037     RefPtr<PageBanner> m_footerBanner;
1038 #endif // !PLATFORM(IOS)
1039
1040     RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1041     RunLoop::Timer<WebPage> m_sendDidUpdateViewStateTimer;
1042     bool m_mayStartMediaWhenInWindow;
1043
1044     HashMap<uint64_t, RefPtr<WebUndoStep>> m_undoStepMap;
1045
1046     WebCore::IntSize m_windowResizerSize;
1047
1048 #if ENABLE(CONTEXT_MENUS)
1049     InjectedBundlePageContextMenuClient m_contextMenuClient;
1050 #endif
1051     InjectedBundlePageEditorClient m_editorClient;
1052     InjectedBundlePageFormClient m_formClient;
1053     InjectedBundlePageLoaderClient m_loaderClient;
1054     InjectedBundlePagePolicyClient m_policyClient;
1055     InjectedBundlePageResourceLoadClient m_resourceLoadClient;
1056     InjectedBundlePageUIClient m_uiClient;
1057 #if ENABLE(FULLSCREEN_API)
1058     InjectedBundlePageFullScreenClient m_fullScreenClient;
1059 #endif
1060     InjectedBundlePageDiagnosticLoggingClient m_logDiagnosticMessageClient;
1061
1062     FindController m_findController;
1063     PageOverlayList m_pageOverlays;
1064
1065 #if ENABLE(INSPECTOR)
1066     RefPtr<WebInspector> m_inspector;
1067 #endif
1068 #if PLATFORM(IOS)
1069     RefPtr<WebVideoFullscreenManager> m_videoFullscreenManager;
1070 #endif
1071 #if ENABLE(FULLSCREEN_API)
1072     RefPtr<WebFullScreenManager> m_fullScreenManager;
1073 #endif
1074     RefPtr<WebPopupMenu> m_activePopupMenu;
1075 #if ENABLE(CONTEXT_MENUS)
1076     RefPtr<WebContextMenu> m_contextMenu;
1077 #endif
1078 #if ENABLE(INPUT_TYPE_COLOR)
1079     WebColorChooser* m_activeColorChooser;
1080 #endif
1081     RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1082     RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1083
1084 #if ENABLE(GEOLOCATION)
1085     GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
1086 #endif
1087
1088     OwnPtr<WebCore::PrintContext> m_printContext;
1089 #if PLATFORM(GTK)
1090     RefPtr<WebPrintOperationGtk> m_printOperation;
1091 #endif
1092
1093     SandboxExtensionTracker m_sandboxExtensionTracker;
1094
1095     RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1096     Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1097
1098     bool m_canRunBeforeUnloadConfirmPanel;
1099
1100     bool m_canRunModal;
1101     bool m_isRunningModal;
1102
1103     bool m_cachedMainFrameIsPinnedToLeftSide;
1104     bool m_cachedMainFrameIsPinnedToRightSide;
1105     bool m_cachedMainFrameIsPinnedToTopSide;
1106     bool m_cachedMainFrameIsPinnedToBottomSide;
1107     bool m_canShortCircuitHorizontalWheelEvents;
1108     unsigned m_numWheelEventHandlers;
1109
1110     unsigned m_cachedPageCount;
1111
1112     WebCore::IntSize m_minimumLayoutSize;
1113     bool m_autoSizingShouldExpandToViewHeight;
1114
1115 #if ENABLE(CONTEXT_MENUS)
1116     bool m_isShowingContextMenu;
1117 #endif
1118     
1119 #if PLATFORM(IOS)
1120     RefPtr<WebCore::Node> m_assistedNode;
1121     RefPtr<WebCore::Range> m_currentWordRange;
1122     RefPtr<WebCore::Node> m_interactionNode;
1123     bool m_shouldReturnWordAtSelection;
1124
1125     WebCore::ViewportConfiguration m_viewportConfiguration;
1126     uint64_t m_lastVisibleContentRectUpdateID;
1127     bool m_scaleWasSetByUIProcess;
1128     bool m_userHasChangedPageScaleFactor;
1129     WebCore::FloatSize m_viewportScreenSize;
1130     WebCore::IntSize m_blockSelectionDesiredSize;
1131 #endif
1132
1133     WebInspectorClient* m_inspectorClient;
1134
1135     HashSet<String, CaseFoldingHash> m_mimeTypesWithCustomContentProviders;
1136     WebCore::Color m_backgroundColor;
1137
1138     HashSet<unsigned> m_activeRenderingSuppressionTokens;
1139     unsigned m_maximumRenderingSuppressionToken;
1140     
1141     WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1142
1143     bool m_useAsyncScrolling;
1144
1145     WebCore::ViewState::Flags m_viewState;
1146
1147     UserActivity m_processSuppressionDisabledByWebPreference;
1148
1149     uint64_t m_pendingNavigationID;
1150
1151     double m_pageScaleWithoutThumbnailScale;
1152     WebCore::IntPoint m_scrollPositionIgnoringThumbnailScale;
1153     double m_thumbnailScale;
1154
1155 #if ENABLE(WEBGL)
1156     WebCore::WebGLLoadPolicy m_systemWebGLPolicy;
1157 #endif
1158 };
1159
1160 } // namespace WebKit
1161
1162 #endif // WebPage_h