2 * Copyright (C) 2010, 2011, 2013 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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.
29 #include "APIInjectedBundleFormClient.h"
30 #include "APIInjectedBundlePageUIClient.h"
31 #include "APIObject.h"
32 #include "FindController.h"
33 #include "GeolocationPermissionRequestManager.h"
34 #include "ImageOptions.h"
35 #include "InjectedBundlePageDiagnosticLoggingClient.h"
36 #include "InjectedBundlePageEditorClient.h"
37 #include "InjectedBundlePageFullScreenClient.h"
38 #include "InjectedBundlePageLoaderClient.h"
39 #include "InjectedBundlePagePolicyClient.h"
40 #include "InjectedBundlePageResourceLoadClient.h"
41 #include "LayerTreeHost.h"
42 #include "MessageReceiver.h"
43 #include "MessageSender.h"
44 #include "PageOverlayController.h"
46 #include "SandboxExtension.h"
47 #include "ShareableBitmap.h"
48 #include <WebCore/DictationAlternative.h>
49 #include <WebCore/DragData.h>
50 #include <WebCore/Editor.h>
51 #include <WebCore/FrameLoaderTypes.h>
52 #include <WebCore/IntRect.h>
53 #include <WebCore/IntSizeHash.h>
54 #include <WebCore/Page.h>
55 #include <WebCore/PageVisibilityState.h>
56 #include <WebCore/ScrollTypes.h>
57 #include <WebCore/TextChecking.h>
58 #include <WebCore/UserActivity.h>
59 #include <WebCore/ViewState.h>
60 #include <WebCore/ViewportConfiguration.h>
61 #include <WebCore/WebCoreKeyboardUIMode.h>
63 #include <wtf/HashMap.h>
64 #include <wtf/PassRefPtr.h>
65 #include <wtf/RefPtr.h>
66 #include <wtf/text/WTFString.h>
68 #if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
69 #include "WebPageAccessibilityObject.h"
70 #include <wtf/gobject/GRefPtr.h>
74 #include "ArgumentCodersGtk.h"
75 #include "WebPrintOperationGtk.h"
79 #include "GestureTypes.h"
80 #import "WebPageMessages.h"
83 #if ENABLE(TOUCH_EVENTS)
85 #include <WebKitAdditions/PlatformTouchEventIOS.h>
87 #include <WebCore/PlatformTouchEvent.h>
91 #if ENABLE(CONTEXT_MENUS)
92 #include "InjectedBundlePageContextMenuClient.h"
96 #include "ViewGestureGeometryCollector.h"
97 #include <wtf/RetainPtr.h>
99 OBJC_CLASS NSDictionary;
101 OBJC_CLASS WKAccessibilityWebPageObject;
103 #define ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC 1
111 class ArgumentDecoder;
116 class DocumentLoader;
117 class GraphicsContext;
120 class HTMLPlugInElement;
121 class HTMLPlugInImageElement;
127 class ResourceResponse;
128 class ResourceRequest;
130 class SubstituteData;
131 class TextCheckingRequest;
133 class VisibleSelection;
135 struct KeypressCommand;
136 struct TextCheckingResult;
142 class InjectedBundleBackForwardList;
143 class NotificationPermissionRequestManager;
147 class ServicesOverlayController;
148 class VisibleContentRectUpdateInfo;
149 class WebColorChooser;
150 class WebContextMenu;
151 class WebContextMenuItemData;
154 class WebFullScreenManager;
157 class WebInspectorClient;
158 class WebKeyboardEvent;
160 class WebNotificationClient;
161 class WebOpenPanelResultListener;
162 class WebPageGroupProxy;
165 class WebUserContentController;
166 class WebVideoFullscreenManager;
168 struct AssistedNodeInformation;
169 struct AttributedString;
170 struct BackForwardListItemState;
173 struct InteractionInformationAtPosition;
175 struct WebPageCreationParameters;
176 struct WebPreferencesStore;
179 class RemoteLayerTreeTransaction;
182 #if ENABLE(TOUCH_EVENTS)
186 class WebPage : public API::ObjectImpl<API::Object::Type::BundlePage>, public IPC::MessageReceiver, public IPC::MessageSender {
188 static PassRefPtr<WebPage> create(uint64_t pageID, const WebPageCreationParameters&);
191 void reinitializeWebPage(const WebPageCreationParameters&);
195 static WebPage* fromCorePage(WebCore::Page*);
197 WebCore::Page* corePage() const { return m_page.get(); }
198 uint64_t pageID() const { return m_pageID; }
199 WebCore::SessionID sessionID() const { return m_page->sessionID(); }
200 bool usesEphemeralSession() const { return m_page->usesEphemeralSession(); }
202 void setSessionID(WebCore::SessionID);
204 void setSize(const WebCore::IntSize&);
205 const WebCore::IntSize& size() const { return m_viewSize; }
206 WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
208 InjectedBundleBackForwardList* backForwardList();
209 DrawingArea* drawingArea() const { return m_drawingArea.get(); }
210 const PageOverlayController& pageOverlayController() const { return m_pageOverlayController; }
211 PageOverlayController& pageOverlayController() { return m_pageOverlayController; }
212 #if ENABLE(ASYNC_SCROLLING)
213 WebCore::ScrollingCoordinator* scrollingCoordinator() const;
216 WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
218 void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
220 bool scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
222 void centerSelectionInVisibleArea();
225 void willCommitLayerTree(RemoteLayerTreeTransaction&);
226 void didFlushLayerTreeAtTime(std::chrono::milliseconds);
229 #if ENABLE(INSPECTOR)
230 WebInspector* inspector();
234 WebVideoFullscreenManager* videoFullscreenManager();
237 #if ENABLE(FULLSCREEN_API)
238 WebFullScreenManager* fullScreenManager();
241 // -- Called by the DrawingArea.
242 // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
243 void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
244 void layoutIfNeeded();
246 // -- Called from WebCore clients.
247 bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
249 void didStartPageTransition();
250 void didCompletePageTransition();
251 void didCommitLoad(WebFrame*);
252 void didFinishDocumentLoad(WebFrame*);
253 void didFinishLoad(WebFrame*);
255 String userAgent(const WebCore::URL&) const;
256 String userAgent(WebFrame*, const WebCore::URL&) const;
257 String platformUserAgent(const WebCore::URL&) const;
258 WebCore::IntRect windowResizerRect() const;
259 WebCore::KeyboardUIMode keyboardUIMode();
261 WebUndoStep* webUndoStep(uint64_t);
262 void addWebUndoStep(uint64_t, WebUndoStep*);
263 void removeWebEditCommand(uint64_t);
264 bool isInRedo() const { return m_isInRedo; }
266 void setActivePopupMenu(WebPopupMenu*);
268 #if ENABLE(INPUT_TYPE_COLOR)
269 WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
270 void setActiveColorChooser(WebColorChooser*);
271 void didChooseColor(const WebCore::Color&);
272 void didEndColorPicker();
275 WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
276 void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>);
278 void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override;
279 void didReceiveSyncMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
281 // -- InjectedBundle methods
282 #if ENABLE(CONTEXT_MENUS)
283 void initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClientBase*);
285 void initializeInjectedBundleEditorClient(WKBundlePageEditorClientBase*);
286 void setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient>);
287 void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClientBase*);
288 void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
289 void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClientBase*);
290 void setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>);
291 #if ENABLE(FULLSCREEN_API)
292 void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClientBase*);
294 void initializeInjectedBundleDiagnosticLoggingClient(WKBundlePageDiagnosticLoggingClientBase*);
296 #if ENABLE(CONTEXT_MENUS)
297 InjectedBundlePageContextMenuClient& injectedBundleContextMenuClient() { return m_contextMenuClient; }
299 InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; }
300 API::InjectedBundle::FormClient& injectedBundleFormClient() { return *m_formClient.get(); }
301 InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; }
302 InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
303 InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
304 API::InjectedBundle::PageUIClient& injectedBundleUIClient() { return *m_uiClient.get(); }
305 InjectedBundlePageDiagnosticLoggingClient& injectedBundleDiagnosticLoggingClient() { return m_logDiagnosticMessageClient; }
306 #if ENABLE(FULLSCREEN_API)
307 InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
310 bool findStringFromInjectedBundle(const String&, FindOptions);
312 WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
314 WebCore::Frame* mainFrame() const; // May return 0.
315 WebCore::FrameView* mainFrameView() const; // May return 0.
317 PassRefPtr<WebCore::Range> currentSelectionAsRange();
319 #if ENABLE(NETSCAPE_PLUGIN_API)
320 PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&, String& newMIMEType);
324 WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const String&);
325 WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(WebFrame*, const String&);
326 #endif // ENABLE(WEBGL)
328 EditorState editorState() const;
330 String renderTreeExternalRepresentation() const;
331 String renderTreeExternalRepresentationForPrinting() const;
332 uint64_t renderTreeSize() const;
334 void setTracksRepaints(bool);
335 bool isTrackingRepaints() const;
336 void resetTrackedRepaints();
337 PassRefPtr<API::Array> trackedRepaintRects();
339 void executeEditingCommand(const String& commandName, const String& argument);
340 bool isEditingCommandEnabled(const String& commandName);
341 void clearMainFrameName();
344 void sendSetWindowFrame(const WebCore::FloatRect&);
346 double textZoomFactor() const;
347 void setTextZoomFactor(double);
348 double pageZoomFactor() const;
349 void setPageZoomFactor(double);
350 void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
351 void windowScreenDidChange(uint64_t);
353 void scalePage(double scale, const WebCore::IntPoint& origin);
354 void scalePageInViewCoordinates(double scale, WebCore::IntPoint centerInViewCoordinates);
355 double pageScaleFactor() const;
357 void setUseFixedLayout(bool);
358 bool useFixedLayout() const { return m_useFixedLayout; }
359 void setFixedLayoutSize(const WebCore::IntSize&);
361 void listenForLayoutMilestones(uint32_t /* LayoutMilestones */);
363 void setSuppressScrollbarAnimations(bool);
365 void setEnableVerticalRubberBanding(bool);
366 void setEnableHorizontalRubberBanding(bool);
368 void setBackgroundExtendsBeyondPage(bool);
370 void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
371 void setPaginationBehavesLikeColumns(bool);
372 void setPageLength(double);
373 void setGapBetweenPages(double);
375 void postInjectedBundleMessage(const String& messageName, IPC::MessageDecoder&);
377 bool drawsBackground() const { return m_drawsBackground; }
378 bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
380 void setUnderlayColor(const WebCore::Color& color) { m_underlayColor = color; }
381 WebCore::Color underlayColor() const { return m_underlayColor; }
384 void stopLoadingFrame(uint64_t frameID);
385 bool defersLoading() const;
386 void setDefersLoading(bool deferLoading);
388 void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
389 void exitAcceleratedCompositingMode();
391 void addPluginView(PluginView*);
392 void removePluginView(PluginView*);
394 void setThumbnailScale(double);
396 bool isVisible() const { return m_viewState & WebCore::ViewState::IsVisible; }
397 bool isVisibleOrOccluded() const { return m_viewState & WebCore::ViewState::IsVisibleOrOccluded; }
399 LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
400 void setLayerHostingMode(unsigned);
403 void updatePluginsActiveAndFocusedState();
404 const WebCore::FloatRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
405 const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates() const { return m_windowFrameInUnflippedScreenCoordinates; }
406 const WebCore::FloatRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
408 bool hasCachedWindowFrame() const { return m_hasCachedWindowFrame; }
411 void setTopOverhangImage(PassRefPtr<WebImage>);
412 void setBottomOverhangImage(PassRefPtr<WebImage>);
413 #endif // !PLATFORM(IOS)
415 void updateHeaderAndFooterLayersForDeviceScaleChange(float scaleFactor);
416 #endif // PLATFORM(COCOA)
418 bool windowIsFocused() const;
419 bool windowAndWebPageAreFocused() const;
420 void installPageOverlay(PassRefPtr<PageOverlay>, PageOverlay::FadeMode = PageOverlay::FadeMode::DoNotFade);
421 void uninstallPageOverlay(PageOverlay*, PageOverlay::FadeMode = PageOverlay::FadeMode::DoNotFade);
424 void setHeaderPageBanner(PassRefPtr<PageBanner>);
425 PageBanner* headerPageBanner();
426 void setFooterPageBanner(PassRefPtr<PageBanner>);
427 PageBanner* footerPageBanner();
429 void hidePageBanners();
430 void showPageBanners();
432 #endif // !PLATFORM(IOS)
434 WebCore::IntPoint screenToRootView(const WebCore::IntPoint&);
435 WebCore::IntRect rootViewToScreen(const WebCore::IntRect&);
438 WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&);
439 WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&);
442 PassRefPtr<WebImage> scaledSnapshotWithOptions(const WebCore::IntRect&, double additionalScaleFactor, SnapshotOptions);
443 PassRefPtr<WebImage> snapshotAtSize(const WebCore::IntRect&, const WebCore::IntSize& bitmapSize, SnapshotOptions);
444 PassRefPtr<WebImage> snapshotNode(WebCore::Node&, SnapshotOptions, unsigned maximumPixelCount = std::numeric_limits<unsigned>::max());
446 static const WebEvent* currentEvent();
448 FindController& findController() { return m_findController; }
450 #if ENABLE(GEOLOCATION)
451 GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager; }
455 WebCore::FloatSize screenSize() const;
456 WebCore::FloatSize availableScreenSize() const;
457 int32_t deviceOrientation() const { return m_deviceOrientation; }
458 void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
459 void didReceiveMobileDocType(bool);
460 void savePageState(WebCore::HistoryItem&);
461 void restorePageState(const WebCore::HistoryItem&);
463 void setUseTestingViewportConfiguration(bool useTestingViewport) { m_useTestingViewportConfiguration = useTestingViewport; }
464 bool isUsingTestingViewportConfiguration() const { return m_useTestingViewportConfiguration; }
466 double minimumPageScaleFactor() const;
467 double maximumPageScaleFactor() const;
468 bool allowsUserScaling() const;
469 bool hasStablePageScaleFactor() const { return m_hasStablePageScaleFactor; }
471 void handleTap(const WebCore::IntPoint&);
472 void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
473 void commitPotentialTap();
474 void commitPotentialTapFailed();
475 void cancelPotentialTap();
476 void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
478 void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
479 void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
481 void blurAssistedNode();
482 void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID);
483 void updateSelectionWithTouches(const WebCore::IntPoint& point, uint32_t touches, bool baseIsStart, uint64_t callbackID);
484 void updateBlockSelectionWithTouch(const WebCore::IntPoint&, uint32_t touch, uint32_t handlePosition);
485 void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID);
486 void extendSelection(uint32_t granularity);
487 void selectWordBackward();
488 void elementDidFocus(WebCore::Node*);
489 void elementDidBlur(WebCore::Node*);
490 void requestDictationContext(uint64_t callbackID);
491 void replaceDictatedText(const String& oldText, const String& newText);
492 void replaceSelectedText(const String& oldText, const String& newText);
493 void requestAutocorrectionData(const String& textForAutocorrection, uint64_t callbackID);
494 void applyAutocorrection(const String& correction, const String& originalText, uint64_t callbackID);
495 void syncApplyAutocorrection(const String& correction, const String& originalText, bool& correctionApplied);
496 void requestAutocorrectionContext(uint64_t callbackID);
497 void getAutocorrectionContext(String& beforeText, String& markedText, String& selectedText, String& afterText, uint64_t& location, uint64_t& length);
498 void getPositionInformation(const WebCore::IntPoint&, InteractionInformationAtPosition&);
499 void requestPositionInformation(const WebCore::IntPoint&);
500 void startInteractionWithElementAtPosition(const WebCore::IntPoint&);
501 void stopInteraction();
502 void performActionOnElement(uint32_t action);
503 void focusNextAssistedNode(bool isForward);
504 void setAssistedNodeValue(const String&);
505 void setAssistedNodeValueAsNumber(double);
506 void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection);
507 WebCore::IntRect rectForElementAtInteractionLocation();
508 void updateSelectionAppearance();
510 void dispatchAsynchronousTouchEvents(const Vector<WebTouchEvent, 1>& queue);
511 void contentSizeCategoryDidChange(const String&);
512 void executeEditCommandWithCallback(const String&, uint64_t callbackID);
514 std::chrono::milliseconds eventThrottlingDelay() const;
515 #if ENABLE(INSPECTOR)
516 void showInspectorHighlight(const WebCore::Highlight&);
517 void hideInspectorHighlight();
519 void showInspectorIndication();
520 void hideInspectorIndication();
522 void enableInspectorNodeSearch();
523 void disableInspectorNodeSearch();
527 NotificationPermissionRequestManager* notificationPermissionRequestManager();
529 void pageDidScroll();
530 #if USE(TILED_BACKING_STORE)
531 void pageDidRequestScroll(const WebCore::IntPoint&);
532 void setFixedVisibleContentRect(const WebCore::IntRect&);
533 void sendViewportAttributesChanged();
536 #if ENABLE(CONTEXT_MENUS)
537 WebContextMenu* contextMenu();
538 WebContextMenu* contextMenuAtPointInWindow(const WebCore::IntPoint&);
541 bool hasLocalDataForURL(const WebCore::URL&);
542 String cachedResponseMIMETypeForURL(const WebCore::URL&);
543 String cachedSuggestedFilenameForURL(const WebCore::URL&);
544 PassRefPtr<WebCore::SharedBuffer> cachedResponseDataForURL(const WebCore::URL&);
546 static bool canHandleRequest(const WebCore::ResourceRequest&);
548 class SandboxExtensionTracker {
550 ~SandboxExtensionTracker();
554 void beginLoad(WebFrame*, const SandboxExtension::Handle& handle);
555 void willPerformLoadDragDestinationAction(PassRefPtr<SandboxExtension> pendingDropSandboxExtension);
556 void didStartProvisionalLoad(WebFrame*);
557 void didCommitProvisionalLoad(WebFrame*);
558 void didFailProvisionalLoad(WebFrame*);
561 void setPendingProvisionalSandboxExtension(PassRefPtr<SandboxExtension>);
563 RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
564 RefPtr<SandboxExtension> m_provisionalSandboxExtension;
565 RefPtr<SandboxExtension> m_committedSandboxExtension;
568 SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
571 void setThemePath(const String&);
574 #if USE(TILED_BACKING_STORE)
575 void commitPageTransitionViewport();
579 void setComposition(const String& text, const Vector<WebCore::CompositionUnderline>& underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeLength);
580 void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
581 void cancelComposition();
584 void didChangeSelection();
587 void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
588 WKAccessibilityWebPageObject* accessibilityRemoteObject();
589 NSObject *accessibilityObjectForMainFramePlugin();
590 const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; }
592 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
594 void insertTextAsync(const String& text, const EditingRange& replacementRange, bool registerUndoGroup = false);
595 void getMarkedRangeAsync(uint64_t callbackID);
596 void getSelectedRangeAsync(uint64_t callbackID);
597 void characterIndexForPointAsync(const WebCore::IntPoint&, uint64_t callbackID);
598 void firstRectForCharacterRangeAsync(const EditingRange&, uint64_t callbackID);
599 void setCompositionAsync(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
600 void confirmCompositionAsync();
603 void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool registerUndoGroup = false);
604 void attributedSubstringForCharacterRangeAsync(const EditingRange&, uint64_t callbackID);
605 #if !USE(ASYNC_NSTEXTINPUTCLIENT)
606 void insertText(const String& text, const EditingRange& replacementRange, bool& handled, EditorState& newState);
607 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange, EditorState& newState);
608 void confirmComposition(EditorState& newState);
609 void insertDictatedText(const String& text, const EditingRange& replacementRange, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool& handled, EditorState& newState);
610 void getAttributedSubstringFromRange(const EditingRange&, AttributedString&);
611 void getMarkedRange(EditingRange&);
612 void getSelectedRange(EditingRange&);
613 void characterIndexForPoint(const WebCore::IntPoint point, uint64_t& result);
614 void firstRectForCharacterRange(const EditingRange&, WebCore::IntRect& resultRect);
615 void executeKeypressCommands(const Vector<WebCore::KeypressCommand>&, bool& handled, EditorState& newState);
616 void cancelComposition(EditorState& newState);
620 void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
621 void getStringSelectionForPasteboard(WTF::String& stringValue);
622 void getDataSelectionForPasteboard(const WTF::String pasteboardType, SharedMemory::Handle& handle, uint64_t& size);
623 void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
624 void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
625 bool performNonEditingBehaviorForSelector(const String&, WebCore::KeyboardEvent*);
627 #if ENABLE(SERVICE_CONTROLS)
628 void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&);
632 void confirmComposition(const String& compositionString);
633 void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
634 void cancelComposition();
636 #if USE(TEXTURE_MAPPER_GL)
637 void setAcceleratedCompositingWindowId(uint64_t nativeWindowHandle);
641 #if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
642 void updateAccessibilityTree();
645 void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
646 bool hasCompositionForTesting();
647 void confirmCompositionForTesting(const String& compositionString);
649 // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
650 // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
654 void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&);
657 void speak(const String&);
662 bool isSmartInsertDeleteEnabled();
663 void setSmartInsertDeleteEnabled(bool);
665 bool isSelectTrailingWhitespaceEnabled();
666 void setSelectTrailingWhitespaceEnabled(bool);
668 void replaceSelectionWithText(WebCore::Frame*, const String&);
669 void clearSelection();
671 #if ENABLE(DRAG_SUPPORT)
673 void performDragControllerAction(uint64_t action, WebCore::DragData);
675 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&);
677 void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
679 void willPerformLoadDragDestinationAction();
680 void mayPerformUploadDragDestinationAction();
681 #endif // ENABLE(DRAG_SUPPORT)
683 void beginPrinting(uint64_t frameID, const PrintInfo&);
685 void computePagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
686 void computePagesForPrintingImpl(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& pageRects, double& totalScaleFactor);
688 void drawRectToImage(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, uint64_t callbackID);
689 void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, uint64_t callbackID);
690 void drawPagesToPDFImpl(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, RetainPtr<CFMutableDataRef>& pdfPageData);
692 void computePagesForPrintingAndStartDrawingToPDF(uint64_t frameID, const PrintInfo&, uint32_t firstPage, PassRefPtr<Messages::WebPage::ComputePagesForPrintingAndStartDrawingToPDF::DelayedReply>);
695 void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
696 void didFinishPrintOperation(const WebCore::ResourceError&, uint64_t callbackID);
699 void addResourceRequest(unsigned long, const WebCore::ResourceRequest&);
700 void removeResourceRequest(unsigned long);
702 void setMediaVolume(float);
703 void setMayStartMediaWhenInWindow(bool);
705 void updateMainFrameScrollOffsetPinning();
707 bool mainFrameHasCustomContentProvider() const;
708 void addMIMETypeWithCustomContentProvider(const String&);
710 void mainFrameDidLayout();
712 bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
713 void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
715 bool canRunModal() const { return m_canRunModal; }
716 void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
720 void setDeviceScaleFactor(float);
721 float deviceScaleFactor() const;
723 void forceRepaintWithoutCallback();
725 void unmarkAllMisspellings();
726 void unmarkAllBadGrammar();
728 void handleAlternativeTextUIResult(const String&);
731 // For testing purpose.
732 void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
733 void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
734 void simulateMouseMotion(WebCore::IntPoint, double time);
736 #if ENABLE(CONTEXT_MENUS)
737 void contextMenuShowing() { m_isShowingContextMenu = true; }
740 void wheelEvent(const WebWheelEvent&);
742 void numWheelEventHandlersChanged(unsigned);
743 void recomputeShortCircuitHorizontalWheelEventsState();
745 void updateVisibilityState(bool isInitialState = false);
748 void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&);
749 void setViewportConfigurationMinimumLayoutSizeForMinimalUI(const WebCore::FloatSize&);
750 void setMaximumUnobscuredSize(const WebCore::FloatSize&);
751 void setDeviceOrientation(int32_t);
752 void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& minimumLayoutSizeForMinimalUI, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, double scale, int32_t deviceOrientation);
753 void synchronizeDynamicViewportUpdate(double& newTargetScale, WebCore::FloatPoint& newScrollPosition, uint64_t& nextValidLayerTreeTransactionID);
754 void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, double oldestTimestamp);
755 bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
756 void willStartUserTriggeredZooming();
757 void applicationWillResignActive();
758 void applicationWillEnterForeground();
759 void applicationDidBecomeActive();
760 void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
761 void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
762 void completePendingSyntheticClickForContentChangeObserver();
765 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
766 uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }
769 bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
770 bool canPluginHandleResponse(const WebCore::ResourceResponse& response);
772 bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
773 void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
774 bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
775 void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
776 bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
777 void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
778 void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; }
779 bool tabToLinksEnabled() const { return m_tabToLinks; }
781 bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; }
782 void setScrollingPerformanceLoggingEnabled(bool);
785 bool shouldUsePDFPlugin() const;
786 bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
787 void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
790 void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size);
792 void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
795 bool mainFrameIsScrollable() const { return m_mainFrameIsScrollable; }
797 void setMinimumLayoutSize(const WebCore::IntSize&);
798 WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
800 void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
801 bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
803 bool canShowMIMEType(const String& MIMEType) const;
805 void addTextCheckingRequest(uint64_t requestID, PassRefPtr<WebCore::TextCheckingRequest>);
806 void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
807 void didCancelCheckingText(uint64_t requestID);
809 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
810 void determinePrimarySnapshottedPlugIn();
811 void determinePrimarySnapshottedPlugInTimerFired();
812 void resetPrimarySnapshottedPlugIn();
813 bool matchesPrimaryPlugIn(const String& pageOrigin, const String& pluginOrigin, const String& mimeType) const;
814 bool plugInIntersectsSearchRect(WebCore::HTMLPlugInImageElement& pluginImageElement);
815 bool plugInIsPrimarySize(WebCore::HTMLPlugInImageElement& pluginImageElement, unsigned &pluginArea);
818 unsigned extendIncrementalRenderingSuppression();
819 void stopExtendingIncrementalRenderingSuppression(unsigned token);
820 bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
822 WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
823 void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
825 WKTypeRef pageOverlayCopyAccessibilityAttributeValue(WKStringRef attribute, WKTypeRef parameter);
826 WKArrayRef pageOverlayCopyAccessibilityAttributesNames(bool parameterizedNames);
828 PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
830 void getBytecodeProfile(uint64_t callbackID);
832 // Some platforms require accessibility-enabled processes to spin the run loop so that the WebProcess doesn't hang.
833 // While this is not ideal, it does not have to be applied to every platform at the moment.
834 static bool synchronousMessagesShouldSpinRunLoop();
836 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
837 ServicesOverlayController& servicesOverlayController();
838 void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&);
839 void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
840 bool serviceControlsEnabled() const { return m_serviceControlsEnabled; }
843 void didChangeScrollOffsetForFrame(WebCore::Frame*);
845 void willChangeCurrentHistoryItem();
848 WebPage(uint64_t pageID, const WebPageCreationParameters&);
850 // IPC::MessageSender
851 virtual IPC::Connection* messageSenderConnection() override;
852 virtual uint64_t messageSenderDestinationID() override;
854 void platformInitialize();
856 void didReceiveWebPageMessage(IPC::Connection*, IPC::MessageDecoder&);
857 void didReceiveSyncWebPageMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&);
860 void resetViewportDefaultConfiguration(WebFrame* mainFrame);
861 void viewportConfigurationChanged();
862 void updateViewportSizeForCSSViewportUnits();
864 static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&);
865 PassRefPtr<WebCore::Range> rangeForWebSelectionAtPosition(const WebCore::IntPoint&, const WebCore::VisiblePosition&, SelectionFlags&);
866 PassRefPtr<WebCore::Range> rangeForBlockAtPoint(const WebCore::IntPoint&);
867 void computeExpandAndShrinkThresholdsForHandle(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold);
868 PassRefPtr<WebCore::Range> changeBlockSelection(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold, SelectionFlags&);
869 PassRefPtr<WebCore::Range> expandedRangeFromHandle(WebCore::Range*, SelectionHandlePosition);
870 PassRefPtr<WebCore::Range> contractedRangeFromHandle(WebCore::Range* currentRange, SelectionHandlePosition, SelectionFlags&);
871 void getAssistedNodeInformation(AssistedNodeInformation&);
872 void platformInitializeAccessibility();
873 void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
874 void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
875 void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
876 void resetTextAutosizingBeforeLayoutIfNeeded(const WebCore::FloatSize& oldSize, const WebCore::FloatSize& newSize);
879 static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
881 bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
884 bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
887 String sourceForFrame(WebFrame*);
889 void loadDataImpl(uint64_t navigationID, PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::URL& baseURL, const WebCore::URL& failingURL, IPC::MessageDecoder&);
890 void loadString(uint64_t navigationID, const String&, const String& MIMEType, const WebCore::URL& baseURL, const WebCore::URL& failingURL, IPC::MessageDecoder&);
892 bool platformHasLocalDataForURL(const WebCore::URL&);
896 void loadRequest(uint64_t navigationID, const WebCore::ResourceRequest&, const SandboxExtension::Handle&, IPC::MessageDecoder&);
897 void loadData(const IPC::DataReference&, const String& MIMEType, const String& encodingName, const String& baseURL, IPC::MessageDecoder&);
898 void loadHTMLString(uint64_t navigationID, const String& htmlString, const String& baseURL, IPC::MessageDecoder&);
899 void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, IPC::MessageDecoder&);
900 void loadPlainTextString(const String&, IPC::MessageDecoder&);
901 void loadWebArchiveData(const IPC::DataReference&, IPC::MessageDecoder&);
902 void reload(uint64_t navigationID, bool reloadFromOrigin, const SandboxExtension::Handle&);
903 void goForward(uint64_t navigationID, uint64_t);
904 void goBack(uint64_t navigationID, uint64_t);
905 void goToBackForwardItem(uint64_t navigationID, uint64_t);
906 void tryRestoreScrollPosition();
907 void setActive(bool);
908 void setFocused(bool);
909 void setViewIsVisible(bool);
910 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&);
911 void setWindowResizerSize(const WebCore::IntSize&);
912 void updateIsInWindow(bool isInitialState = false);
913 void setViewState(WebCore::ViewState::Flags, bool wantsDidUpdateViewState = false);
914 void validateCommand(const String&, uint64_t);
915 void executeEditCommand(const String&);
917 void mouseEvent(const WebMouseEvent&);
918 void mouseEventSyncForTesting(const WebMouseEvent&, bool&);
919 void wheelEventSyncForTesting(const WebWheelEvent&, bool&);
920 void keyEvent(const WebKeyboardEvent&);
921 void keyEventSyncForTesting(const WebKeyboardEvent&, bool&);
922 #if ENABLE(IOS_TOUCH_EVENTS)
923 void touchEventSync(const WebTouchEvent&, bool& handled);
924 #elif ENABLE(TOUCH_EVENTS)
925 void touchEvent(const WebTouchEvent&);
926 void touchEventSyncForTesting(const WebTouchEvent&, bool& handled);
928 #if ENABLE(CONTEXT_MENUS)
929 void contextMenuHidden() { m_isShowingContextMenu = false; }
932 static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
933 static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
935 void loadURLInFrame(const String&, uint64_t frameID);
937 void restoreSession(const Vector<BackForwardListItemState>&);
938 void didRemoveBackForwardItem(uint64_t);
940 #if ENABLE(REMOTE_INSPECTOR)
941 void setAllowsRemoteInspection(bool);
944 void setDrawsBackground(bool);
945 void setDrawsTransparentBackground(bool);
947 void setTopContentInset(float);
949 void viewWillStartLiveResize();
950 void viewWillEndLiveResize();
952 void getContentsAsString(uint64_t callbackID);
954 void getContentsAsMHTMLData(uint64_t callbackID, bool useBinaryEncoding);
956 void getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID);
957 void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, uint64_t callbackID);
958 void getRenderTreeExternalRepresentation(uint64_t callbackID);
959 void getSelectionOrContentsAsString(uint64_t callbackID);
960 void getSelectionAsWebArchiveData(uint64_t callbackID);
961 void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
962 void getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID);
963 void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
964 void forceRepaint(uint64_t callbackID);
965 void takeSnapshot(WebCore::IntRect snapshotRect, WebCore::IntSize bitmapSize, uint32_t options, uint64_t callbackID);
967 void preferencesDidChange(const WebPreferencesStore&);
968 void platformPreferencesDidChange(const WebPreferencesStore&);
969 void updatePreferences(const WebPreferencesStore&);
971 void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t navigationID, uint64_t downloadID);
972 void setUserAgent(const String&);
973 void setCustomTextEncodingName(const String&);
974 void suspendActiveDOMObjectsAndAnimations();
975 void resumeActiveDOMObjectsAndAnimations();
978 void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
979 void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range&, NSDictionary *options);
981 void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
983 RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
984 void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
985 void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
986 void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
989 void setMainFrameIsScrollable(bool);
991 void unapplyEditCommand(uint64_t commandID);
992 void reapplyEditCommand(uint64_t commandID);
993 void didRemoveEditCommand(uint64_t commandID);
995 void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
996 void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
997 void getImageForFindMatch(uint32_t matchIndex);
998 void selectFindMatch(uint32_t matchIndex);
1000 void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
1002 #if USE(COORDINATED_GRAPHICS)
1003 void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area);
1006 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
1007 void setTextForActivePopupMenu(int32_t index);
1010 void failedToShowPopupMenu();
1014 void didChooseFilesForOpenPanelWithDisplayStringAndIcon(const Vector<String>&, const String& displayString, const IPC::DataReference& iconData);
1016 void didChooseFilesForOpenPanel(const Vector<String>&);
1017 void didCancelForOpenPanel();
1018 #if ENABLE(SANDBOX_EXTENSIONS)
1019 void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
1022 void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
1024 void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
1026 void advanceToNextMisspelling(bool startBeforeSelection);
1027 void changeSpellingToWord(const String& word);
1029 void uppercaseWord();
1030 void lowercaseWord();
1031 void capitalizeWord();
1034 #if ENABLE(CONTEXT_MENUS)
1035 void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
1038 void changeSelectedIndex(int32_t index);
1039 void setCanStartMediaTimerFired();
1041 bool canHandleUserEvents() const;
1043 static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
1045 static PluginView* focusedPluginViewForFrame(WebCore::Frame&);
1046 static PluginView* pluginViewForFrame(WebCore::Frame*);
1048 static PassRefPtr<WebCore::Range> rangeFromEditingRange(WebCore::Frame&, const EditingRange&);
1050 void reportUsedFeatures();
1054 std::unique_ptr<WebCore::Page> m_page;
1055 RefPtr<WebFrame> m_mainFrame;
1056 RefPtr<InjectedBundleBackForwardList> m_backForwardList;
1058 RefPtr<WebPageGroupProxy> m_pageGroup;
1062 WebCore::IntSize m_viewSize;
1063 std::unique_ptr<DrawingArea> m_drawingArea;
1065 HashSet<PluginView*> m_pluginViews;
1066 bool m_hasSeenPlugin;
1068 HashMap<uint64_t, RefPtr<WebCore::TextCheckingRequest>> m_pendingTextCheckingRequestMap;
1070 bool m_useFixedLayout;
1072 bool m_drawsBackground;
1073 bool m_drawsTransparentBackground;
1075 WebCore::Color m_underlayColor;
1082 bool m_asynchronousPluginInitializationEnabled;
1083 bool m_asynchronousPluginInitializationEnabledForAllPlugins;
1084 bool m_artificialPluginInitializationDelayEnabled;
1086 bool m_scrollingPerformanceLoggingEnabled;
1088 bool m_mainFrameIsScrollable;
1090 #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
1091 bool m_readyToFindPrimarySnapshottedPlugin;
1092 bool m_didFindPrimarySnapshottedPlugin;
1093 unsigned m_numberOfPrimarySnapshotDetectionAttempts;
1094 String m_primaryPlugInPageOrigin;
1095 String m_primaryPlugInOrigin;
1096 String m_primaryPlugInMimeType;
1097 RunLoop::Timer<WebPage> m_determinePrimarySnapshottedPlugInTimer;
1100 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
1101 bool m_serviceControlsEnabled;
1104 // The layer hosting mode.
1105 LayerHostingMode m_layerHostingMode;
1108 bool m_pdfPluginEnabled;
1110 bool m_hasCachedWindowFrame;
1112 // The frame of the containing window in screen coordinates.
1113 WebCore::FloatRect m_windowFrameInScreenCoordinates;
1115 // The frame of the containing window in unflipped screen coordinates.
1116 WebCore::FloatRect m_windowFrameInUnflippedScreenCoordinates;
1118 // The frame of the view in window coordinates.
1119 WebCore::FloatRect m_viewFrameInWindowCoordinates;
1121 // The accessibility position of the view.
1122 WebCore::FloatPoint m_accessibilityPosition;
1124 RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1126 ViewGestureGeometryCollector m_viewGestureGeometryCollector;
1128 #elif HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
1129 GRefPtr<WebPageAccessibilityObject> m_accessibilityObject;
1132 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
1133 // Our view's window in the UI process.
1134 uint64_t m_nativeWindowHandle;
1138 RefPtr<PageBanner> m_headerBanner;
1139 RefPtr<PageBanner> m_footerBanner;
1140 #endif // !PLATFORM(IOS)
1142 RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1143 bool m_mayStartMediaWhenInWindow;
1145 HashMap<uint64_t, RefPtr<WebUndoStep>> m_undoStepMap;
1147 WebCore::IntSize m_windowResizerSize;
1149 #if ENABLE(CONTEXT_MENUS)
1150 InjectedBundlePageContextMenuClient m_contextMenuClient;
1152 InjectedBundlePageEditorClient m_editorClient;
1153 std::unique_ptr<API::InjectedBundle::FormClient> m_formClient;
1154 InjectedBundlePageLoaderClient m_loaderClient;
1155 InjectedBundlePagePolicyClient m_policyClient;
1156 InjectedBundlePageResourceLoadClient m_resourceLoadClient;
1157 std::unique_ptr<API::InjectedBundle::PageUIClient> m_uiClient;
1158 #if ENABLE(FULLSCREEN_API)
1159 InjectedBundlePageFullScreenClient m_fullScreenClient;
1161 InjectedBundlePageDiagnosticLoggingClient m_logDiagnosticMessageClient;
1163 FindController m_findController;
1165 #if ENABLE(INSPECTOR)
1166 RefPtr<WebInspector> m_inspector;
1169 RefPtr<WebVideoFullscreenManager> m_videoFullscreenManager;
1171 #if ENABLE(FULLSCREEN_API)
1172 RefPtr<WebFullScreenManager> m_fullScreenManager;
1174 RefPtr<WebPopupMenu> m_activePopupMenu;
1175 #if ENABLE(CONTEXT_MENUS)
1176 RefPtr<WebContextMenu> m_contextMenu;
1178 #if ENABLE(INPUT_TYPE_COLOR)
1179 WebColorChooser* m_activeColorChooser;
1181 RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1182 RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1184 RefPtr<WebUserContentController> m_userContentController;
1186 #if ENABLE(GEOLOCATION)
1187 GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
1190 std::unique_ptr<WebCore::PrintContext> m_printContext;
1192 RefPtr<WebPrintOperationGtk> m_printOperation;
1195 SandboxExtensionTracker m_sandboxExtensionTracker;
1197 RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1198 Vector<RefPtr<SandboxExtension>> m_pendingDropExtensionsForFileUpload;
1200 bool m_canRunBeforeUnloadConfirmPanel;
1203 bool m_isRunningModal;
1205 bool m_cachedMainFrameIsPinnedToLeftSide;
1206 bool m_cachedMainFrameIsPinnedToRightSide;
1207 bool m_cachedMainFrameIsPinnedToTopSide;
1208 bool m_cachedMainFrameIsPinnedToBottomSide;
1209 bool m_canShortCircuitHorizontalWheelEvents;
1210 unsigned m_numWheelEventHandlers;
1212 unsigned m_cachedPageCount;
1214 HashSet<unsigned long> m_networkResourceRequestIdentifiers;
1216 WebCore::IntSize m_minimumLayoutSize;
1217 bool m_autoSizingShouldExpandToViewHeight;
1219 #if ENABLE(CONTEXT_MENUS)
1220 bool m_isShowingContextMenu;
1224 RefPtr<WebCore::Node> m_assistedNode;
1225 RefPtr<WebCore::Range> m_currentWordRange;
1226 RefPtr<WebCore::Node> m_interactionNode;
1227 WebCore::IntPoint m_lastInteractionLocation;
1229 RefPtr<WebCore::Node> m_potentialTapNode;
1230 WebCore::FloatPoint m_potentialTapLocation;
1232 WebCore::ViewportConfiguration m_viewportConfiguration;
1233 uint64_t m_firstLayerTreeTransactionIDAfterDidCommitLoad;
1234 bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad;
1235 bool m_scaleWasSetByUIProcess;
1236 bool m_userHasChangedPageScaleFactor;
1237 bool m_hasStablePageScaleFactor;
1238 bool m_userIsInteracting;
1239 bool m_hasPendingBlurNotification;
1240 bool m_useTestingViewportConfiguration;
1241 bool m_isInStableState;
1242 std::chrono::milliseconds m_oldestNonStableUpdateVisibleContentRectsTimestamp;
1243 std::chrono::milliseconds m_estimatedLatency;
1244 WebCore::FloatSize m_screenSize;
1245 WebCore::FloatSize m_availableScreenSize;
1246 RefPtr<WebCore::Range> m_currentBlockSelection;
1247 WebCore::IntSize m_blockSelectionDesiredSize;
1248 WebCore::FloatSize m_maximumUnobscuredSize;
1249 int32_t m_deviceOrientation;
1250 bool m_inDynamicSizeUpdate;
1251 HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
1252 RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
1253 WebCore::FloatPoint m_pendingSyntheticClickLocation;
1256 WebInspectorClient* m_inspectorClient;
1258 HashSet<String, CaseFoldingHash> m_mimeTypesWithCustomContentProviders;
1259 WebCore::Color m_backgroundColor;
1261 HashSet<unsigned> m_activeRenderingSuppressionTokens;
1262 unsigned m_maximumRenderingSuppressionToken;
1264 WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1266 bool m_useAsyncScrolling;
1268 WebCore::ViewState::Flags m_viewState;
1270 UserActivity m_processSuppressionDisabledByWebPreference;
1272 uint64_t m_pendingNavigationID;
1274 double m_pageScaleWithoutThumbnailScale;
1275 WebCore::IntPoint m_scrollPositionIgnoringThumbnailScale;
1276 double m_thumbnailScale;
1279 WebCore::WebGLLoadPolicy m_systemWebGLPolicy;
1282 #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
1283 std::unique_ptr<ServicesOverlayController> m_servicesOverlayController;
1286 PageOverlayController m_pageOverlayController;
1289 } // namespace WebKit