2 * Copyright (C) 2010, 2011 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.
26 #ifndef WebPageProxy_h
27 #define WebPageProxy_h
29 #include "APIObject.h"
30 #include "APISession.h"
31 #include "AutoCorrectionCallback.h"
32 #include "Connection.h"
33 #include "DragControllerAction.h"
34 #include "DrawingAreaProxy.h"
35 #include "EditorState.h"
36 #include "GeolocationPermissionRequestManagerProxy.h"
37 #include "InteractionInformationAtPosition.h"
38 #include "LayerTreeContext.h"
39 #include "MessageSender.h"
40 #include "NotificationPermissionRequestManagerProxy.h"
41 #include "PageLoadState.h"
42 #include "PlatformProcessIdentifier.h"
43 #include "SandboxExtension.h"
44 #include "ShareableBitmap.h"
46 #include "WKPagePrivate.h"
47 #include "WebColorPicker.h"
48 #include "WebContextMenuItemData.h"
49 #include "WebCoreArgumentCoders.h"
50 #include "WebFindClient.h"
51 #include "WebFormClient.h"
52 #include "WebFrameProxy.h"
53 #include "WebHistoryClient.h"
54 #include "WebHitTestResult.h"
55 #include "WebPageContextMenuClient.h"
56 #include "WebPageCreationParameters.h"
57 #include <WebCore/AlternativeTextClient.h> // FIXME: Needed by WebPageProxyMessages.h for DICTATION_ALTERNATIVES.
58 #include "WebPageProxyMessages.h"
59 #include "WebPopupMenuProxy.h"
60 #include "WebUIClient.h"
61 #include <WebCore/Color.h>
62 #include <WebCore/DragActions.h>
63 #include <WebCore/DragSession.h>
64 #include <WebCore/HitTestResult.h>
65 #include <WebCore/Page.h>
66 #include <WebCore/PlatformScreen.h>
67 #include <WebCore/ScrollTypes.h>
68 #include <WebCore/TextChecking.h>
69 #include <WebCore/TextGranularity.h>
70 #include <WebCore/ViewState.h>
71 #include <wtf/HashMap.h>
72 #include <wtf/HashSet.h>
73 #include <wtf/OwnPtr.h>
74 #include <wtf/PassOwnPtr.h>
75 #include <wtf/PassRefPtr.h>
77 #include <wtf/RefPtr.h>
78 #include <wtf/Vector.h>
79 #include <wtf/text/WTFString.h>
81 #if ENABLE(DRAG_SUPPORT)
82 #include <WebCore/DragActions.h>
83 #include <WebCore/DragSession.h>
86 #if ENABLE(TOUCH_EVENTS)
87 #include "NativeWebTouchEvent.h"
91 #include "WKPageEfl.h"
92 #include "WebUIPopupMenuClient.h"
97 #include <WebCore/PlatformLayer.h>
107 class ArgumentDecoder;
112 class AuthenticationChallenge;
118 class ProtectionSpace;
120 struct FileChooserSettings;
121 struct TextAlternativeWithRange;
122 struct TextCheckingResult;
123 struct ViewportAttributes;
124 struct WindowFeatures;
132 typedef GtkWidget* PlatformWidget;
137 class CertificateInfo;
138 class NativeWebKeyboardEvent;
139 class NativeWebMouseEvent;
140 class NativeWebWheelEvent;
142 class RemoteScrollingCoordinatorProxy;
143 class StringPairVector;
144 class WebBackForwardList;
145 class WebBackForwardListItem;
146 class WebColorPickerResultListenerProxy;
147 class WebContextMenuProxy;
148 class WebEditCommandProxy;
149 class WebFullScreenManagerProxy;
150 class WebKeyboardEvent;
152 class WebOpenPanelResultListenerProxy;
154 class WebProcessProxy;
156 struct AttributedString;
157 struct ColorSpaceData;
158 struct DictionaryPopupInfo;
160 struct PlatformPopupMenuData;
164 #if ENABLE(VIBRATION)
165 class WebVibrationProxy;
168 typedef GenericCallback<WKStringRef, StringImpl*> StringCallback;
169 typedef GenericCallback<WKSerializedScriptValueRef, WebSerializedScriptValue*> ScriptValueCallback;
172 typedef GenericCallback<WKErrorRef> PrintFinishedCallback;
175 #if ENABLE(TOUCH_EVENTS)
176 struct QueuedTouchEvents {
177 QueuedTouchEvents(const NativeWebTouchEvent& event)
178 : forwardedEvent(event)
181 NativeWebTouchEvent forwardedEvent;
182 Vector<NativeWebTouchEvent> deferredTouchEvents;
186 // FIXME: Make a version of CallbackBase with three arguments, and define ValidateCommandCallback as a specialization.
187 class ValidateCommandCallback : public CallbackBase {
189 typedef void (*CallbackFunction)(WKStringRef, bool, int32_t, WKErrorRef, void*);
191 static PassRefPtr<ValidateCommandCallback> create(void* context, CallbackFunction callback)
193 return adoptRef(new ValidateCommandCallback(context, callback));
196 virtual ~ValidateCommandCallback()
201 void performCallbackWithReturnValue(StringImpl* returnValue1, bool returnValue2, int returnValue3)
205 m_callback(toAPI(returnValue1), returnValue2, returnValue3, 0, context());
214 RefPtr<API::Error> error = API::Error::create();
215 m_callback(0, 0, 0, toAPI(error.get()), context());
222 ValidateCommandCallback(void* context, CallbackFunction callback)
223 : CallbackBase(context)
224 , m_callback(callback)
228 CallbackFunction m_callback;
232 class GestureCallback : public CallbackBase {
234 typedef void (*CallbackFunction)(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, WKErrorRef, void*);
236 static PassRefPtr<GestureCallback> create(void* context, CallbackFunction callback)
238 return adoptRef(new GestureCallback(context, callback));
241 virtual ~GestureCallback()
246 void performCallbackWithReturnValue(const WebCore::IntPoint& returnValue1, uint32_t returnValue2, uint32_t returnValue3, uint32_t returnValue4)
250 m_callback(returnValue1, returnValue2, returnValue3, returnValue4, 0, context());
259 RefPtr<API::Error> error = API::Error::create();
260 m_callback(WebCore::IntPoint(), 0, 0, 0, toAPI(error.get()), context());
267 GestureCallback(void* context, CallbackFunction callback)
268 : CallbackBase(context)
269 , m_callback(callback)
274 CallbackFunction m_callback;
277 class TouchesCallback : public CallbackBase {
279 typedef void (*CallbackFunction)(const WebCore::IntPoint&, uint32_t, WKErrorRef, void*);
281 static PassRefPtr<TouchesCallback> create(void* context, CallbackFunction callback)
283 return adoptRef(new TouchesCallback(context, callback));
286 virtual ~TouchesCallback()
291 void performCallbackWithReturnValue(const WebCore::IntPoint& returnValue1, uint32_t returnValue2)
295 m_callback(returnValue1, returnValue2, 0, context());
304 RefPtr<API::Error> error = API::Error::create();
305 m_callback(WebCore::IntPoint(), 0, toAPI(error.get()), context());
312 TouchesCallback(void* context, CallbackFunction callback)
313 : CallbackBase(context)
314 , m_callback(callback)
319 CallbackFunction m_callback;
323 class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page>
324 #if ENABLE(INPUT_TYPE_COLOR)
325 , public WebColorPicker::Client
327 , public WebPopupMenuProxy::Client
328 , public IPC::MessageReceiver
329 , public IPC::MessageSender {
332 static PassRefPtr<WebPageProxy> create(PageClient&, WebProcessProxy&, WebPageGroup&, API::Session&, uint64_t pageID);
333 virtual ~WebPageProxy();
335 void setSession(API::Session&);
337 uint64_t pageID() const { return m_pageID; }
338 uint64_t sessionID() const { return m_session->getID(); }
340 WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
341 WebFrameProxy* focusedFrame() const { return m_focusedFrame.get(); }
342 WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
344 DrawingAreaProxy* drawingArea() const { return m_drawingArea.get(); }
346 #if ENABLE(ASYNC_SCROLLING)
347 RemoteScrollingCoordinatorProxy* scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy.get(); }
350 WebBackForwardList& backForwardList() { return m_backForwardList.get(); }
352 #if ENABLE(INSPECTOR)
353 WebInspectorProxy* inspector();
356 #if ENABLE(VIBRATION)
357 WebVibrationProxy* vibration() { return m_vibration.get(); }
360 #if ENABLE(FULLSCREEN_API)
361 WebFullScreenManagerProxy* fullScreenManager();
364 #if ENABLE(CONTEXT_MENUS)
365 void initializeContextMenuClient(const WKPageContextMenuClientBase*);
367 void initializeFindClient(const WKPageFindClientBase*);
368 void initializeFindMatchesClient(const WKPageFindMatchesClientBase*);
369 void initializeFormClient(const WKPageFormClientBase*);
370 void setLoaderClient(std::unique_ptr<API::LoaderClient>);
371 void setPolicyClient(std::unique_ptr<API::PolicyClient>);
372 void initializeUIClient(const WKPageUIClientBase*);
374 void initializeUIPopupMenuClient(const WKPageUIPopupMenuClientBase*);
377 void initializeWebPage();
381 bool isClosed() const { return m_isClosed; }
383 void loadURL(const String&, API::Object* userData = nullptr);
384 void loadURLRequest(API::URLRequest*, API::Object* userData = nullptr);
385 void loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
386 void loadData(API::Data*, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
387 void loadHTMLString(const String& htmlString, const String& baseURL, API::Object* userData = nullptr);
388 void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, API::Object* userData = nullptr);
389 void loadPlainTextString(const String&, API::Object* userData = nullptr);
390 void loadWebArchiveData(API::Data*, API::Object* userData = nullptr);
393 void reload(bool reloadFromOrigin);
396 bool canGoForward() const;
398 bool canGoBack() const;
400 void goToBackForwardItem(WebBackForwardListItem*);
401 void tryRestoreScrollPosition();
402 void didChangeBackForwardList(WebBackForwardListItem* addedItem, Vector<RefPtr<API::Object>>* removedItems);
403 void willGoToBackForwardListItem(uint64_t itemID, IPC::MessageDecoder&);
405 bool willHandleHorizontalScrollEvents() const;
407 bool canShowMIMEType(const String& mimeType);
409 bool drawsBackground() const { return m_drawsBackground; }
410 void setDrawsBackground(bool);
412 bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
413 void setDrawsTransparentBackground(bool);
415 WebCore::Color underlayColor() const { return m_underlayColor; }
416 void setUnderlayColor(const WebCore::Color&);
418 void viewWillStartLiveResize();
419 void viewWillEndLiveResize();
421 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&);
422 void setWindowResizerSize(const WebCore::IntSize&);
424 void clearSelection();
426 void setViewNeedsDisplay(const WebCore::IntRect&);
428 bool canScrollView();
429 void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
431 enum class WantsReplyOrNot { DoesNotWantReply, DoesWantReply };
432 void viewStateDidChange(WebCore::ViewState::Flags mayHaveChanged, WantsReplyOrNot = WantsReplyOrNot::DoesNotWantReply);
433 bool isInWindow() const { return m_viewState & WebCore::ViewState::IsInWindow; }
434 void waitForDidUpdateViewState();
436 WebCore::IntSize viewSize() const;
437 bool isViewVisible() const { return m_viewState & WebCore::ViewState::IsVisible; }
438 bool isViewWindowActive() const;
439 bool isProcessSuppressible() const;
441 void executeEditCommand(const String& commandName);
442 void validateCommand(const String& commandName, PassRefPtr<ValidateCommandCallback>);
444 void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, PassRefPtr<GestureCallback>);
445 void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, PassRefPtr<TouchesCallback>);
446 void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, PassRefPtr<GestureCallback>);
447 void extendSelection(WebCore::TextGranularity);
448 void requestAutocorrectionData(const String& textForAutocorrection, PassRefPtr<AutocorrectionDataCallback>);
449 void applyAutocorrection(const String& correction, const String& originalText, PassRefPtr<StringCallback>);
450 void requestAutocorrectionContext(PassRefPtr<AutocorrectionContextCallback>);
451 void getAutocorrectionContext(String& contextBefore, String& markedText, String& selectedText, String& contextAfter, uint64_t& location, uint64_t& length);
452 void didReceivePositionInformation(const InteractionInformationAtPosition&);
453 void getPositionInformation(const WebCore::IntPoint&, InteractionInformationAtPosition&);
454 void requestPositionInformation(const WebCore::IntPoint&);
457 const EditorState& editorState() const { return m_editorState; }
458 bool canDelete() const { return hasSelectedRange() && isContentEditable(); }
459 bool hasSelectedRange() const { return m_editorState.selectionIsRange; }
460 bool isContentEditable() const { return m_editorState.isContentEditable; }
462 bool maintainsInactiveSelection() const { return m_maintainsInactiveSelection; }
463 void setMaintainsInactiveSelection(bool);
464 #if USE(TILED_BACKING_STORE)
465 void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
468 void setThemePath(const String&);
472 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
473 void confirmComposition(const String& compositionString, int64_t selectionStart, int64_t selectionLength);
474 void cancelComposition();
478 void setInputMethodState(bool enabled);
482 void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
483 void setMainFrameIsScrollable(bool);
485 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
486 void confirmComposition();
487 void cancelComposition();
488 bool insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
489 bool insertDictatedText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives);
490 void getMarkedRange(uint64_t& location, uint64_t& length);
491 void getSelectedRange(uint64_t& location, uint64_t& length);
492 void getAttributedSubstringFromRange(uint64_t location, uint64_t length, AttributedString&);
493 uint64_t characterIndexForPoint(const WebCore::IntPoint);
494 WebCore::IntRect firstRectForCharacterRange(uint64_t, uint64_t);
495 bool executeKeypressCommands(const Vector<WebCore::KeypressCommand>&);
497 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
498 bool shouldDelayWindowOrderingForEvent(const WebMouseEvent&);
499 bool acceptsFirstMouse(int eventNumber, const WebMouseEvent&);
501 void setAcceleratedCompositingRootLayer(PlatformLayer* rootLayer);
502 PlatformLayer* acceleratedCompositingRootLayer() const;
505 WKView* wkView() const;
506 void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize);
508 #endif // PLATFORM(MAC)
510 void handleInputMethodKeydown(bool& handled);
511 void confirmComposition(const String&);
512 void setComposition(const String&, Vector<WebCore::CompositionUnderline>&, int);
513 void cancelComposition();
516 PlatformWidget viewWidget();
518 #if USE(TILED_BACKING_STORE)
519 void commitPageTransitionViewport();
522 void handleMouseEvent(const NativeWebMouseEvent&);
523 void handleWheelEvent(const NativeWebWheelEvent&);
524 void handleKeyboardEvent(const NativeWebKeyboardEvent&);
525 #if ENABLE(TOUCH_EVENTS)
526 void handleTouchEvent(const NativeWebTouchEvent&);
529 void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
530 void centerSelectionInVisibleArea();
532 const String& toolTip() const { return m_toolTip; }
534 const String& userAgent() const { return m_userAgent; }
535 void setApplicationNameForUserAgent(const String&);
536 const String& applicationNameForUserAgent() const { return m_applicationNameForUserAgent; }
537 void setCustomUserAgent(const String&);
538 const String& customUserAgent() const { return m_customUserAgent; }
539 static String standardUserAgent(const String& applicationName = String());
541 bool supportsTextEncoding() const;
542 void setCustomTextEncodingName(const String&);
543 String customTextEncodingName() const { return m_customTextEncodingName; }
545 bool areActiveDOMObjectsAndAnimationsSuspended() const { return m_isPageSuspended; }
546 void resumeActiveDOMObjectsAndAnimations();
547 void suspendActiveDOMObjectsAndAnimations();
549 double estimatedProgress() const;
551 void terminateProcess();
553 typedef bool (*WebPageProxySessionStateFilterCallback)(WKPageRef, WKStringRef type, WKTypeRef object, void* context);
554 PassRefPtr<API::Data> sessionStateData(WebPageProxySessionStateFilterCallback, void* context) const;
555 void restoreFromSessionStateData(API::Data*);
557 bool supportsTextZoom() const;
558 double textZoomFactor() const { return m_textZoomFactor; }
559 void setTextZoomFactor(double);
560 double pageZoomFactor() const { return m_pageZoomFactor; }
561 void setPageZoomFactor(double);
562 void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
564 void scalePage(double scale, const WebCore::IntPoint& origin);
565 double pageScaleFactor() const { return m_pageScaleFactor; }
567 float deviceScaleFactor() const;
568 void setIntrinsicDeviceScaleFactor(float);
569 void setCustomDeviceScaleFactor(float);
570 void windowScreenDidChange(PlatformDisplayID);
572 void setUseFixedLayout(bool);
573 void setFixedLayoutSize(const WebCore::IntSize&);
574 bool useFixedLayout() const { return m_useFixedLayout; };
575 const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; };
577 void listenForLayoutMilestones(WebCore::LayoutMilestones);
579 void setVisibilityStatePrerender();
580 void didUpdateViewState() { m_waitingForDidUpdateViewState = false; }
582 bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
583 bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; }
585 void setSuppressScrollbarAnimations(bool);
586 bool areScrollbarAnimationsSuppressed() const { return m_suppressScrollbarAnimations; }
588 bool isPinnedToLeftSide() const { return m_mainFrameIsPinnedToLeftSide; }
589 bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
590 bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
591 bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
593 bool rubberBandsAtLeft() const;
594 void setRubberBandsAtLeft(bool);
595 bool rubberBandsAtRight() const;
596 void setRubberBandsAtRight(bool);
597 bool rubberBandsAtTop() const;
598 void setRubberBandsAtTop(bool);
599 bool rubberBandsAtBottom() const;
600 void setRubberBandsAtBottom(bool);
602 void setBackgroundExtendsBeyondPage(bool);
603 bool backgroundExtendsBeyondPage() const;
605 void setPaginationMode(WebCore::Pagination::Mode);
606 WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
607 void setPaginationBehavesLikeColumns(bool);
608 bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
609 void setPageLength(double);
610 double pageLength() const { return m_pageLength; }
611 void setGapBetweenPages(double);
612 double gapBetweenPages() const { return m_gapBetweenPages; }
613 unsigned pageCount() const { return m_pageCount; }
616 // Called by the web process through a message.
617 void registerWebProcessAccessibilityToken(const IPC::DataReference&);
618 // Called by the UI process when it is ready to send its tokens to the web process.
619 void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken);
620 bool readSelectionFromPasteboard(const String& pasteboardName);
621 String stringSelectionForPasteboard();
622 PassRefPtr<WebCore::SharedBuffer> dataSelectionForPasteboard(const String& pasteboardType);
623 void makeFirstResponder();
625 ColorSpaceData colorSpace();
628 void pageScaleFactorDidChange(double);
629 void pageZoomFactorDidChange(double);
631 void setMemoryCacheClientCallsEnabled(bool);
634 void findString(const String&, FindOptions, unsigned maxMatchCount);
635 void findStringMatches(const String&, FindOptions, unsigned maxMatchCount);
636 void getImageForFindMatch(int32_t matchIndex);
637 void selectFindMatch(int32_t matchIndex);
638 void didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex);
640 void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
641 void didCountStringMatches(const String&, uint32_t matchCount);
642 void setFindIndicator(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut, bool animate);
643 void didFindString(const String&, uint32_t matchCount);
644 void didFailToFindString(const String&);
645 void didFindStringMatches(const String&, Vector<Vector<WebCore::IntRect>> matchRects, int32_t firstIndexAfterSelection);
647 void getContentsAsString(PassRefPtr<StringCallback>);
649 void getContentsAsMHTMLData(PassRefPtr<DataCallback>, bool useBinaryEncoding);
651 void getMainResourceDataOfFrame(WebFrameProxy*, PassRefPtr<DataCallback>);
652 void getResourceDataFromFrame(WebFrameProxy*, API::URL*, PassRefPtr<DataCallback>);
653 void getRenderTreeExternalRepresentation(PassRefPtr<StringCallback>);
654 void getSelectionOrContentsAsString(PassRefPtr<StringCallback>);
655 void getSelectionAsWebArchiveData(PassRefPtr<DataCallback>);
656 void getSourceForFrame(WebFrameProxy*, PassRefPtr<StringCallback>);
657 void getWebArchiveOfFrame(WebFrameProxy*, PassRefPtr<DataCallback>);
658 void runJavaScriptInMainFrame(const String&, PassRefPtr<ScriptValueCallback>);
659 void forceRepaint(PassRefPtr<VoidCallback>);
661 float headerHeight(WebFrameProxy*);
662 float footerHeight(WebFrameProxy*);
663 void drawHeader(WebFrameProxy*, const WebCore::FloatRect&);
664 void drawFooter(WebFrameProxy*, const WebCore::FloatRect&);
668 void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
671 void receivedPolicyDecision(WebCore::PolicyAction, WebFrameProxy*, uint64_t listenerID);
673 void backForwardRemovedItem(uint64_t itemID);
675 #if ENABLE(DRAG_SUPPORT)
676 // Drag and drop support.
677 void dragEntered(WebCore::DragData&, const String& dragStorageName = String());
678 void dragUpdated(WebCore::DragData&, const String& dragStorageName = String());
679 void dragExited(WebCore::DragData&, const String& dragStorageName = String());
680 void performDrag(WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
682 void didPerformDragControllerAction(WebCore::DragSession);
683 void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
685 void setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, bool isLinkDrag);
686 void setPromisedData(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
687 const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
690 void startDrag(const WebCore::DragData&, const ShareableBitmap::Handle& dragImage);
694 void processDidBecomeUnresponsive();
695 void interactionOccurredWhileProcessUnresponsive();
696 void processDidBecomeResponsive();
697 void processDidCrash();
699 #if USE(ACCELERATED_COMPOSITING)
700 virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
701 virtual void exitAcceleratedCompositingMode();
702 virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
707 enum UndoOrRedo { Undo, Redo };
708 void addEditCommand(WebEditCommandProxy*);
709 void removeEditCommand(WebEditCommandProxy*);
710 bool isValidEditCommand(WebEditCommandProxy*);
711 void registerEditCommand(PassRefPtr<WebEditCommandProxy>, UndoOrRedo);
714 void registerKeypressCommandName(const String& name) { m_knownKeypressCommandNames.add(name); }
715 bool isValidKeypressCommandName(const String& name) const { return m_knownKeypressCommandNames.contains(name); }
718 WebProcessProxy& process() { return m_process.get(); }
719 PlatformProcessIdentifier processIdentifier() const;
721 WebPageGroup& pageGroup() { return m_pageGroup.get(); }
723 bool isValid() const;
725 PassRefPtr<API::Array> relatedPages() const;
727 const String& urlAtProcessExit() const { return m_urlAtProcessExit; }
728 FrameLoadState::State loadStateAtProcessExit() const { return m_loadStateAtProcessExit; }
730 #if ENABLE(DRAG_SUPPORT)
731 WebCore::DragSession dragSession() const { return m_currentDragSession; }
732 void resetDragOperation() { m_currentDragSession = WebCore::DragSession(); }
735 void preferencesDidChange();
737 #if ENABLE(CONTEXT_MENUS)
738 // Called by the WebContextMenuProxy.
739 void contextMenuItemSelected(const WebContextMenuItemData&);
742 // Called by the WebOpenPanelResultListenerProxy.
743 void didChooseFilesForOpenPanel(const Vector<String>&);
744 void didCancelForOpenPanel();
746 WebPageCreationParameters creationParameters();
748 #if USE(COORDINATED_GRAPHICS)
749 void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&);
752 #if PLATFORM(EFL) || PLATFORM(GTK)
753 void handleDownloadRequest(DownloadProxy*);
756 void advanceToNextMisspelling(bool startBeforeSelection);
757 void changeSpellingToWord(const String& word);
759 void uppercaseWord();
760 void lowercaseWord();
761 void capitalizeWord();
765 bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
766 void setSmartInsertDeleteEnabled(bool);
770 String accessibilityPlugID() const { return m_accessibilityPlugID; }
773 void setCanRunModal(bool);
776 void beginPrinting(WebFrameProxy*, const PrintInfo&);
778 void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<ComputedPagesCallback>);
780 void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, const WebCore::IntSize&, PassRefPtr<ImageCallback>);
781 void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, PassRefPtr<DataCallback>);
783 void drawPagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<PrintFinishedCallback>);
786 PageLoadState& pageLoadState() { return m_pageLoadState; }
789 void handleAlternativeTextUIResult(const String& result);
792 void saveDataToFileInDownloadsFolder(const String& suggestedFilename, const String& mimeType, const String& originatingURLString, API::Data*);
793 void savePDFToFileInDownloadsFolder(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&);
795 void savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(const String& suggestedFilename, const String& originatingURLString, const uint8_t* data, unsigned long size, const String& pdfUUID);
796 void savePDFToTemporaryFolderAndOpenWithNativeApplication(const String& suggestedFilename, const String& originatingURLString, const IPC::DataReference&, const String& pdfUUID);
797 void openPDFFromTemporaryFolderWithNativeApplication(const String& pdfUUID);
800 WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
802 uint64_t renderTreeSize() const { return m_renderTreeSize; }
804 void setShouldSendEventsSynchronously(bool sync) { m_shouldSendEventsSynchronously = sync; };
806 void printMainFrame();
808 void setMediaVolume(float);
809 void setMayStartMediaWhenInWindow(bool);
811 // WebPopupMenuProxy::Client
812 virtual NativeWebMouseEvent* currentlyProcessedMouseDownEvent();
814 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
815 void setAcceleratedCompositingWindowId(uint64_t nativeWindowId);
818 void setSuppressVisibilityUpdates(bool flag) { m_suppressVisibilityUpdates = flag; }
819 bool suppressVisibilityUpdates() { return m_suppressVisibilityUpdates; }
822 void didFinishScrolling(const WebCore::FloatPoint& contentOffset);
823 void didFinishZooming(float newScale);
825 void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
827 void blurAssistedNode();
830 void postMessageToInjectedBundle(const String& messageName, API::Object* messageBody);
832 #if ENABLE(INPUT_TYPE_COLOR)
833 void setColorPickerColor(const WebCore::Color&);
834 void endColorPicker();
837 WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
838 void setMinimumLayoutSize(const WebCore::IntSize&);
840 bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
841 void setAutoSizingShouldExpandToViewHeight(bool);
843 bool mainFrameInViewSourceMode() const { return m_mainFrameInViewSourceMode; }
844 void setMainFrameInViewSourceMode(bool);
846 void didReceiveAuthenticationChallengeProxy(uint64_t frameID, PassRefPtr<AuthenticationChallengeProxy>);
848 int64_t spellDocumentTag();
849 void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&);
850 void didCancelCheckingText(uint64_t requestID);
852 void connectionWillOpen(IPC::Connection*);
853 void connectionWillClose(IPC::Connection*);
855 void didSaveToPageCache();
857 void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
858 WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
860 bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
861 void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
862 void recordNavigationSnapshot();
865 RetainPtr<CGImageRef> takeViewSnapshot();
869 WebPageProxy(PageClient&, WebProcessProxy&, WebPageGroup&, API::Session&, uint64_t pageID);
870 void platformInitialize();
872 void updateViewState(WebCore::ViewState::Flags flagsToUpdate = WebCore::ViewState::AllFlags);
875 void resetStateAfterProcessExited();
877 void setUserAgent(const String&);
879 // IPC::MessageReceiver
880 virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override;
881 virtual void didReceiveSyncMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
883 // IPC::MessageSender
884 virtual bool sendMessage(std::unique_ptr<IPC::MessageEncoder>, unsigned messageSendFlags) override;
885 virtual IPC::Connection* messageSenderConnection() override;
886 virtual uint64_t messageSenderDestinationID() override;
888 // WebPopupMenuProxy::Client
889 virtual void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex);
890 virtual void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index);
892 virtual void failedToShowPopupMenu();
895 // Implemented in generated WebPageProxyMessageReceiver.cpp
896 void didReceiveWebPageProxyMessage(IPC::Connection*, IPC::MessageDecoder&);
897 void didReceiveSyncWebPageProxyMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&);
899 void didCreateMainFrame(uint64_t frameID);
900 void didCreateSubframe(uint64_t frameID);
902 void didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, IPC::MessageDecoder&);
903 void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String&, IPC::MessageDecoder&);
904 void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, IPC::MessageDecoder&);
905 void didCommitLoadForFrame(uint64_t frameID, const String& mimeType, uint32_t frameLoadType, const WebCore::CertificateInfo&, IPC::MessageDecoder&);
906 void didFinishDocumentLoadForFrame(uint64_t frameID, IPC::MessageDecoder&);
907 void didFinishLoadForFrame(uint64_t frameID, IPC::MessageDecoder&);
908 void didFailLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, IPC::MessageDecoder&);
909 void didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t sameDocumentNavigationType, const String&, IPC::MessageDecoder&);
910 void didReceiveTitleForFrame(uint64_t frameID, const String&, IPC::MessageDecoder&);
911 void didFirstLayoutForFrame(uint64_t frameID, IPC::MessageDecoder&);
912 void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, IPC::MessageDecoder&);
913 void didLayout(uint32_t layoutMilestones, IPC::MessageDecoder&);
914 void didRemoveFrameFromHierarchy(uint64_t frameID, IPC::MessageDecoder&);
915 void didDisplayInsecureContentForFrame(uint64_t frameID, IPC::MessageDecoder&);
916 void didRunInsecureContentForFrame(uint64_t frameID, IPC::MessageDecoder&);
917 void didDetectXSSForFrame(uint64_t frameID, IPC::MessageDecoder&);
918 void frameDidBecomeFrameSet(uint64_t frameID, bool);
919 void didStartProgress();
920 void didChangeProgress(double);
921 void didFinishProgress();
923 void decidePolicyForNavigationAction(uint64_t frameID, const NavigationActionData&, uint64_t originatingFrameID, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest&, uint64_t listenerID, IPC::MessageDecoder&, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
924 void decidePolicyForNewWindowAction(uint64_t frameID, const NavigationActionData&, const WebCore::ResourceRequest&, const String& frameName, uint64_t listenerID, IPC::MessageDecoder&);
925 void decidePolicyForResponse(uint64_t frameID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, IPC::MessageDecoder&);
926 void decidePolicyForResponseSync(uint64_t frameID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, IPC::MessageDecoder&, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
927 void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, IPC::MessageDecoder&);
929 void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, IPC::MessageDecoder&);
932 void createNewPage(const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, uint32_t modifiers, int32_t mouseButton, uint64_t& newPageID, WebPageCreationParameters&);
934 void closePage(bool stopResponsivenessTimer);
935 void runJavaScriptAlert(uint64_t frameID, const String&);
936 void runJavaScriptConfirm(uint64_t frameID, const String&, bool& result);
937 void runJavaScriptPrompt(uint64_t frameID, const String&, const String&, String& result);
938 void shouldInterruptJavaScript(bool& result);
939 void setStatusText(const String&);
940 void mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t modifiers, IPC::MessageDecoder&);
941 #if ENABLE(NETSCAPE_PLUGIN_API)
942 void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
943 #endif // ENABLE(NETSCAPE_PLUGIN_API)
945 void webGLPolicyForURL(const String& url, uint32_t& loadPolicy);
946 #endif // ENABLE(WEBGL)
947 void setToolbarsAreVisible(bool toolbarsAreVisible);
948 void getToolbarsAreVisible(bool& toolbarsAreVisible);
949 void setMenuBarIsVisible(bool menuBarIsVisible);
950 void getMenuBarIsVisible(bool& menuBarIsVisible);
951 void setStatusBarIsVisible(bool statusBarIsVisible);
952 void getStatusBarIsVisible(bool& statusBarIsVisible);
953 void setIsResizable(bool isResizable);
954 void getIsResizable(bool& isResizable);
955 void setWindowFrame(const WebCore::FloatRect&);
956 void getWindowFrame(WebCore::FloatRect&);
957 void screenToWindow(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
958 void windowToScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
959 void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose);
960 void didChangeViewportProperties(const WebCore::ViewportAttributes&);
961 void pageDidScroll();
962 void runOpenPanel(uint64_t frameID, const WebCore::FileChooserSettings&);
963 void printFrame(uint64_t frameID);
964 void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>);
965 void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
967 void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
968 void recommendedScrollbarStyleDidChange(int32_t newStyle);
969 void didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar);
970 void didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide, bool pinnedToTopSide, bool pinnedToBottomSide);
971 void didChangePageCount(unsigned);
972 #if ENABLE(NETSCAPE_PLUGIN_API)
973 void didFailToInitializePlugin(const String& mimeType, const String& frameURLString, const String& pageURLString);
974 void didBlockInsecurePluginVersion(const String& mimeType, const String& pluginURLString, const String& frameURLString, const String& pageURLString, bool replacementObscured);
975 #endif // ENABLE(NETSCAPE_PLUGIN_API)
976 void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
978 void reattachToWebProcess();
979 void reattachToWebProcessWithItem(WebBackForwardListItem*);
981 void requestNotificationPermission(uint64_t notificationID, const String& originString);
982 void showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID);
983 void cancelNotification(uint64_t notificationID);
984 void clearNotifications(const Vector<uint64_t>& notificationIDs);
985 void didDestroyNotification(uint64_t notificationID);
987 #if USE(TILED_BACKING_STORE)
988 void pageDidRequestScroll(const WebCore::IntPoint&);
989 void pageTransitionViewportReady();
991 #if USE(COORDINATED_GRAPHICS)
992 void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
994 #if PLATFORM(EFL) || PLATFORM(IOS)
995 void didChangeContentSize(const WebCore::IntSize&);
998 #if ENABLE(TOUCH_EVENTS)
999 void needTouchEvents(bool);
1002 #if ENABLE(INPUT_TYPE_COLOR)
1003 void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&);
1004 void didChooseColor(const WebCore::Color&);
1005 void didEndColorPicker();
1008 void editorStateChanged(const EditorState&);
1010 // Back/Forward list management
1011 void backForwardAddItem(uint64_t itemID);
1012 void backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle&);
1013 void backForwardItemAtIndex(int32_t index, uint64_t& itemID);
1014 void backForwardBackListCount(int32_t& count);
1015 void backForwardForwardListCount(int32_t& count);
1016 void backForwardClear();
1019 void registerEditCommandForUndo(uint64_t commandID, uint32_t editAction);
1020 void clearAllEditCommands();
1021 void canUndoRedo(uint32_t action, bool& result);
1022 void executeUndoRedo(uint32_t action, bool& result);
1024 // Keyboard handling
1026 void interpretQueuedKeyEvent(const EditorState&, bool& handled, Vector<WebCore::KeypressCommand>&);
1027 void executeSavedCommandBySelector(const String& selector, bool& handled);
1031 void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&);
1032 void bindAccessibilityTree(const String&);
1035 void getEditorCommandsForKeyEvent(Vector<String>&);
1039 void showPopupMenu(const WebCore::IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData&);
1040 void hidePopupMenu();
1042 #if ENABLE(CONTEXT_MENUS)
1044 void showContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector<WebContextMenuItemData>&, IPC::MessageDecoder&);
1045 void internalShowContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector<WebContextMenuItemData>&, IPC::MessageDecoder&);
1048 // Search popup results
1049 void saveRecentSearches(const String&, const Vector<String>&);
1050 void loadRecentSearches(const String&, Vector<String>&);
1054 void getIsSpeaking(bool&);
1055 void speak(const String&);
1056 void stopSpeaking();
1059 void searchWithSpotlight(const String&);
1061 void searchTheWeb(const String&);
1064 void didPerformDictionaryLookup(const AttributedString&, const DictionaryPopupInfo&);
1067 // Spelling and grammar.
1068 #if USE(UNIFIED_TEXT_CHECKING)
1069 void checkTextOfParagraph(const String& text, uint64_t checkingTypes, Vector<WebCore::TextCheckingResult>& results);
1071 void checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength);
1072 void checkGrammarOfString(const String& text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);
1073 void spellingUIIsShowing(bool&);
1074 void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
1075 void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
1076 void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses);
1077 void learnWord(const String& word);
1078 void ignoreWord(const String& word);
1079 void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&);
1081 void setFocus(bool focused);
1082 void takeFocus(uint32_t direction);
1083 void setToolTip(const String&);
1084 void setCursor(const WebCore::Cursor&);
1085 void setCursorHiddenUntilMouseMoves(bool);
1087 void didReceiveEvent(uint32_t opaqueType, bool handled);
1088 void stopResponsivenessTimer();
1090 void voidCallback(uint64_t);
1091 void dataCallback(const IPC::DataReference&, uint64_t);
1092 void imageCallback(const ShareableBitmap::Handle&, uint64_t);
1093 void stringCallback(const String&, uint64_t);
1094 void scriptValueCallback(const IPC::DataReference&, uint64_t);
1095 void computedPagesCallback(const Vector<WebCore::IntRect>&, double totalScaleFactorForPrinting, uint64_t);
1096 void validateCommandCallback(const String&, bool, int, uint64_t);
1098 void gestureCallback(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, uint64_t);
1099 void touchesCallback(const WebCore::IntPoint&, uint32_t, uint64_t);
1100 void autocorrectionDataCallback(const Vector<WebCore::FloatRect>&, const String&, float, uint64_t, uint64_t);
1101 void autocorrectionContextCallback(const String&, const String&, const String&, const String&, uint64_t, uint64_t, uint64_t);
1102 void interpretKeyEvent(const EditorState&, bool isCharEvent, bool& handled);
1105 void printFinishedCallback(const WebCore::ResourceError&, uint64_t);
1108 void focusedFrameChanged(uint64_t frameID);
1109 void frameSetLargestFrameChanged(uint64_t frameID);
1111 void canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const WebCore::ProtectionSpace&, bool& canAuthenticate);
1112 void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID);
1115 void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
1116 void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
1119 bool maybeInitializeSandboxExtensionHandle(const WebCore::URL&, SandboxExtension::Handle&);
1121 #if PLATFORM(MAC) && !PLATFORM(IOS)
1122 void substitutionsPanelIsShowing(bool&);
1123 void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
1124 void dismissCorrectionPanel(int32_t reason);
1125 void dismissCorrectionPanelSoon(int32_t reason, String& result);
1126 void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString);
1128 #if USE(DICTATION_ALTERNATIVES)
1129 void showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext);
1130 void removeDictationAlternatives(uint64_t dictationContext);
1131 void dictationAlternatives(uint64_t dictationContext, Vector<String>& result);
1133 #endif // PLATFORM(MAC) && !PLATFORM(IOS)
1136 void mainDocumentDidReceiveMobileDocType();
1138 void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius);
1140 void didChangeViewportArguments(const WebCore::ViewportArguments& viewportArguments);
1142 void startAssistingNode(const WebCore::IntRect&, bool hasNextFocusable, bool hasPreviousFocusable);
1143 void stopAssistingNode();
1144 void notifyRevealedSelection();
1145 #endif // PLATFORM(IOS)
1147 #if USE(SOUP) && !ENABLE(CUSTOM_PROTOCOLS)
1148 void didReceiveURIRequest(String uriString, uint64_t requestID);
1151 void clearLoadDependentCallbacks();
1153 void performDragControllerAction(DragControllerAction, WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
1155 void updateBackingStoreDiscardableState();
1157 void setRenderTreeSize(uint64_t treeSize) { m_renderTreeSize = treeSize; }
1159 #if PLUGIN_ARCHITECTURE(X11)
1160 void createPluginContainer(uint64_t& windowID);
1161 void windowedPluginGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, uint64_t windowID);
1164 void processNextQueuedWheelEvent();
1165 void sendWheelEvent(const WebWheelEvent&);
1167 #if ENABLE(NETSCAPE_PLUGIN_API)
1168 void findPlugin(const String& mimeType, uint32_t processType, const String& urlString, const String& frameURLString, const String& pageURLString, bool allowOnlyApplicationPlugins, uint64_t& pluginProcessToken, String& newMIMEType, uint32_t& pluginLoadPolicy, String& unavailabilityDescription);
1171 PageClient& m_pageClient;
1172 std::unique_ptr<API::LoaderClient> m_loaderClient;
1173 std::unique_ptr<API::PolicyClient> m_policyClient;
1174 WebFormClient m_formClient;
1175 WebUIClient m_uiClient;
1177 WebUIPopupMenuClient m_uiPopupMenuClient;
1179 WebFindClient m_findClient;
1180 WebFindMatchesClient m_findMatchesClient;
1181 #if ENABLE(CONTEXT_MENUS)
1182 WebPageContextMenuClient m_contextMenuClient;
1185 std::unique_ptr<DrawingAreaProxy> m_drawingArea;
1186 #if ENABLE(ASYNC_SCROLLING)
1187 std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy;
1190 Ref<WebProcessProxy> m_process;
1191 Ref<WebPageGroup> m_pageGroup;
1192 RefPtr<WebFrameProxy> m_mainFrame;
1193 RefPtr<WebFrameProxy> m_focusedFrame;
1194 RefPtr<WebFrameProxy> m_frameSetLargestFrame;
1197 String m_applicationNameForUserAgent;
1198 String m_customUserAgent;
1199 String m_customTextEncodingName;
1201 #if ENABLE(INSPECTOR)
1202 RefPtr<WebInspectorProxy> m_inspector;
1205 #if ENABLE(FULLSCREEN_API)
1206 RefPtr<WebFullScreenManagerProxy> m_fullScreenManager;
1209 #if ENABLE(VIBRATION)
1210 RefPtr<WebVibrationProxy> m_vibration;
1213 HashMap<uint64_t, RefPtr<VoidCallback>> m_voidCallbacks;
1214 HashMap<uint64_t, RefPtr<DataCallback>> m_dataCallbacks;
1215 HashMap<uint64_t, RefPtr<ImageCallback>> m_imageCallbacks;
1216 HashMap<uint64_t, RefPtr<StringCallback>> m_stringCallbacks;
1217 HashSet<uint64_t> m_loadDependentStringCallbackIDs;
1218 HashMap<uint64_t, RefPtr<ScriptValueCallback>> m_scriptValueCallbacks;
1219 HashMap<uint64_t, RefPtr<ComputedPagesCallback>> m_computedPagesCallbacks;
1220 HashMap<uint64_t, RefPtr<ValidateCommandCallback>> m_validateCommandCallbacks;
1222 HashMap<uint64_t, RefPtr<GestureCallback>> m_gestureCallbacks;
1223 HashMap<uint64_t, RefPtr<TouchesCallback>> m_touchesCallbacks;
1224 HashMap<uint64_t, RefPtr<AutocorrectionDataCallback>> m_autocorrectionCallbacks;
1225 HashMap<uint64_t, RefPtr<AutocorrectionContextCallback>> m_autocorrectionContextCallbacks;
1228 HashMap<uint64_t, RefPtr<PrintFinishedCallback>> m_printFinishedCallbacks;
1231 HashSet<WebEditCommandProxy*> m_editCommandSet;
1234 HashSet<String> m_knownKeypressCommandNames;
1237 RefPtr<WebPopupMenuProxy> m_activePopupMenu;
1238 RefPtr<WebContextMenuProxy> m_activeContextMenu;
1239 WebHitTestResult::Data m_activeContextMenuHitTestResultData;
1240 RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
1241 GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
1242 NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
1244 WebCore::ViewState::Flags m_viewState;
1247 bool m_canGoForward;
1248 Ref<WebBackForwardList> m_backForwardList;
1250 bool m_maintainsInactiveSelection;
1254 String m_urlAtProcessExit;
1255 FrameLoadState::State m_loadStateAtProcessExit;
1257 EditorState m_editorState;
1258 bool m_temporarilyClosedComposition; // Editor state changed from hasComposition to !hasComposition, but that was only with shouldIgnoreCompositionSelectionChange yet.
1260 double m_textZoomFactor;
1261 double m_pageZoomFactor;
1262 double m_pageScaleFactor;
1263 float m_intrinsicDeviceScaleFactor;
1264 float m_customDeviceScaleFactor;
1266 LayerHostingMode m_layerHostingMode;
1268 bool m_drawsBackground;
1269 bool m_drawsTransparentBackground;
1271 WebCore::Color m_underlayColor;
1273 bool m_areMemoryCacheClientCallsEnabled;
1275 bool m_useFixedLayout;
1276 WebCore::IntSize m_fixedLayoutSize;
1278 bool m_suppressScrollbarAnimations;
1280 WebCore::Pagination::Mode m_paginationMode;
1281 bool m_paginationBehavesLikeColumns;
1282 double m_pageLength;
1283 double m_gapBetweenPages;
1285 // If the process backing the web page is alive and kicking.
1288 // Whether WebPageProxy::close() has been called on this page.
1291 // Whether it can run modal child web pages.
1294 bool m_isInPrintingMode;
1295 bool m_isPerformingDOMPrintOperation;
1297 bool m_inDecidePolicyForResponseSync;
1298 const WebCore::ResourceRequest* m_decidePolicyForResponseRequest;
1299 bool m_syncMimeTypePolicyActionIsValid;
1300 WebCore::PolicyAction m_syncMimeTypePolicyAction;
1301 uint64_t m_syncMimeTypePolicyDownloadID;
1303 bool m_inDecidePolicyForNavigationAction;
1304 bool m_syncNavigationActionPolicyActionIsValid;
1305 WebCore::PolicyAction m_syncNavigationActionPolicyAction;
1306 uint64_t m_syncNavigationActionPolicyDownloadID;
1308 Deque<NativeWebKeyboardEvent> m_keyEventQueue;
1309 Deque<NativeWebWheelEvent> m_wheelEventQueue;
1310 Deque<OwnPtr<Vector<NativeWebWheelEvent>>> m_currentlyProcessedWheelEvents;
1312 bool m_processingMouseMoveEvent;
1313 OwnPtr<NativeWebMouseEvent> m_nextMouseMoveEvent;
1314 OwnPtr<NativeWebMouseEvent> m_currentlyProcessedMouseDownEvent;
1316 #if ENABLE(TOUCH_EVENTS)
1317 bool m_needTouchEvents;
1318 Deque<QueuedTouchEvents> m_touchEventQueue;
1320 #if ENABLE(INPUT_TYPE_COLOR)
1321 RefPtr<WebColorPicker> m_colorPicker;
1322 RefPtr<WebColorPickerResultListenerProxy> m_colorPickerResultListener;
1326 Ref<API::Session> m_session;
1328 bool m_isPageSuspended;
1331 bool m_isSmartInsertDeleteEnabled;
1335 String m_accessibilityPlugID;
1338 int64_t m_spellDocumentTag;
1339 bool m_hasSpellDocumentTag;
1340 unsigned m_pendingLearnOrIgnoreWordMessageCount;
1342 #if ENABLE(DRAG_SUPPORT)
1343 WebCore::DragSession m_currentDragSession;
1346 PageLoadState m_pageLoadState;
1348 bool m_mainFrameHasHorizontalScrollbar;
1349 bool m_mainFrameHasVerticalScrollbar;
1351 // Whether horizontal wheel events can be handled directly for swiping purposes.
1352 bool m_canShortCircuitHorizontalWheelEvents;
1354 bool m_mainFrameIsPinnedToLeftSide;
1355 bool m_mainFrameIsPinnedToRightSide;
1356 bool m_mainFrameIsPinnedToTopSide;
1357 bool m_mainFrameIsPinnedToBottomSide;
1359 bool m_useLegacyImplicitRubberBandControl;
1360 bool m_rubberBandsAtLeft;
1361 bool m_rubberBandsAtRight;
1362 bool m_rubberBandsAtTop;
1363 bool m_rubberBandsAtBottom;
1365 bool m_backgroundExtendsBeyondPage;
1367 bool m_mainFrameInViewSourceMode;
1369 bool m_shouldRecordNavigationSnapshots;
1371 unsigned m_pageCount;
1373 WebCore::IntRect m_visibleScrollerThumbRect;
1375 uint64_t m_renderTreeSize;
1377 bool m_shouldSendEventsSynchronously;
1379 bool m_suppressVisibilityUpdates;
1380 bool m_autoSizingShouldExpandToViewHeight;
1381 WebCore::IntSize m_minimumLayoutSize;
1383 float m_mediaVolume;
1384 bool m_mayStartMediaWhenInWindow;
1386 bool m_waitingForDidUpdateViewState;
1389 HashMap<String, String> m_temporaryPDFFiles;
1392 WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
1395 } // namespace WebKit
1397 #endif // WebPageProxy_h