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.
29 #include "APIObject.h"
30 #include "DrawingArea.h"
31 #include "FindController.h"
32 #include "GeolocationPermissionRequestManager.h"
33 #include "ImageOptions.h"
34 #include "ImmutableArray.h"
35 #include "InjectedBundlePageContextMenuClient.h"
36 #include "InjectedBundlePageEditorClient.h"
37 #include "InjectedBundlePageFormClient.h"
38 #include "InjectedBundlePageFullScreenClient.h"
39 #include "InjectedBundlePageLoaderClient.h"
40 #include "InjectedBundlePagePolicyClient.h"
41 #include "InjectedBundlePageResourceLoadClient.h"
42 #include "InjectedBundlePageUIClient.h"
43 #include "MessageSender.h"
44 #include "TapHighlightController.h"
46 #include "SandboxExtension.h"
47 #include "ShareableBitmap.h"
48 #include "WebUndoStep.h"
49 #include <WebCore/DragData.h>
50 #include <WebCore/Editor.h>
51 #include <WebCore/FrameLoaderTypes.h>
52 #include <WebCore/IntRect.h>
53 #include <WebCore/PlatformScreen.h>
54 #include <WebCore/ScrollTypes.h>
55 #include <WebCore/WebCoreKeyboardUIMode.h>
56 #include <wtf/HashMap.h>
57 #include <wtf/OwnPtr.h>
58 #include <wtf/PassRefPtr.h>
59 #include <wtf/RefPtr.h>
60 #include <wtf/text/WTFString.h>
63 #include "ArgumentCodersQt.h"
64 #include "QtNetworkAccessManager.h"
65 #include "QtNetworkReply.h"
66 #include "QtNetworkReplyData.h"
67 #include "QtNetworkRequestData.h"
68 #include <QNetworkReply>
69 #include <QNetworkRequest>
73 #include "ArgumentCodersGtk.h"
74 #include "WebPageAccessibilityObject.h"
75 #include "WebPrintOperationGtk.h"
78 #if ENABLE(TOUCH_EVENTS)
79 #include <WebCore/PlatformTouchEvent.h>
83 #include "DictionaryPopupInfo.h"
84 #include <wtf/RetainPtr.h>
85 OBJC_CLASS NSDictionary;
87 OBJC_CLASS WKAccessibilityWebPageObject;
91 class ArgumentDecoder;
97 class GraphicsContext;
104 class ResourceRequest;
106 class VisibleSelection;
107 struct KeypressCommand;
113 class InjectedBundleBackForwardList;
114 class NotificationPermissionRequestManager;
118 class WebContextMenu;
119 class WebContextMenuItemData;
122 class WebFullScreenManager;
125 class WebKeyboardEvent;
127 class WebNotificationClient;
128 class WebOpenPanelResultListener;
129 class WebPageGroupProxy;
132 struct AttributedString;
135 struct WebPageCreationParameters;
136 struct WebPreferencesStore;
138 #if ENABLE(GESTURE_EVENTS)
139 class WebGestureEvent;
142 #if ENABLE(TOUCH_EVENTS)
146 class WebPage : public APIObject, public CoreIPC::MessageSender<WebPage> {
148 static const Type APIType = TypeBundlePage;
150 static PassRefPtr<WebPage> create(uint64_t pageID, const WebPageCreationParameters&);
153 // Used by MessageSender.
154 CoreIPC::Connection* connection() const;
155 uint64_t destinationID() const { return pageID(); }
159 WebCore::Page* corePage() const { return m_page.get(); }
160 uint64_t pageID() const { return m_pageID; }
162 void setSize(const WebCore::IntSize&);
163 const WebCore::IntSize& size() const { return m_viewSize; }
164 WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
166 InjectedBundleBackForwardList* backForwardList();
167 DrawingArea* drawingArea() const { return m_drawingArea.get(); }
169 WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
171 void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
173 void scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
175 void centerSelectionInVisibleArea();
177 #if ENABLE(INSPECTOR)
178 WebInspector* inspector();
181 #if ENABLE(FULLSCREEN_API)
182 WebFullScreenManager* fullScreenManager();
185 // -- Called by the DrawingArea.
186 // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
187 void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
188 void drawPageOverlay(WebCore::GraphicsContext&, const WebCore::IntRect&);
189 void layoutIfNeeded();
191 // -- Called from WebCore clients.
193 bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*, bool saveCommands);
195 bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
199 String userAgent() const { return m_userAgent; }
200 WebCore::IntRect windowResizerRect() const;
201 WebCore::KeyboardUIMode keyboardUIMode();
203 WebUndoStep* webUndoStep(uint64_t);
204 void addWebUndoStep(uint64_t, WebUndoStep*);
205 void removeWebEditCommand(uint64_t);
206 bool isInRedo() const { return m_isInRedo; }
208 void setActivePopupMenu(WebPopupMenu*);
210 WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
211 void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>);
213 // -- Called from WebProcess.
214 void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
215 void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
217 // -- InjectedBundle methods
218 void initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClient*);
219 void initializeInjectedBundleEditorClient(WKBundlePageEditorClient*);
220 void initializeInjectedBundleFormClient(WKBundlePageFormClient*);
221 void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClient*);
222 void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClient*);
223 void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClient*);
224 void initializeInjectedBundleUIClient(WKBundlePageUIClient*);
225 #if ENABLE(FULLSCREEN_API)
226 void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClient*);
229 InjectedBundlePageContextMenuClient& injectedBundleContextMenuClient() { return m_contextMenuClient; }
230 InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; }
231 InjectedBundlePageFormClient& injectedBundleFormClient() { return m_formClient; }
232 InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; }
233 InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
234 InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
235 InjectedBundlePageUIClient& injectedBundleUIClient() { return m_uiClient; }
236 #if ENABLE(FULLSCREEN_API)
237 InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
240 void setUnderlayPage(PassRefPtr<WebPage> underlayPage) { m_underlayPage = underlayPage; }
242 bool findStringFromInjectedBundle(const String&, FindOptions);
244 WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
246 WebCore::Frame* mainFrame() const; // May return 0.
247 WebCore::FrameView* mainFrameView() const; // May return 0.
249 PassRefPtr<Plugin> createPlugin(WebFrame*, const Plugin::Parameters&);
251 EditorState editorState() const;
253 String renderTreeExternalRepresentation() const;
254 uint64_t renderTreeSize() const;
255 void setPaintedObjectsCounterThreshold(uint64_t);
257 void setTracksRepaints(bool);
258 bool isTrackingRepaints() const;
259 void resetTrackedRepaints();
260 PassRefPtr<ImmutableArray> trackedRepaintRects();
262 void executeEditingCommand(const String& commandName, const String& argument);
263 bool isEditingCommandEnabled(const String& commandName);
264 void clearMainFrameName();
267 double textZoomFactor() const;
268 void setTextZoomFactor(double);
269 double pageZoomFactor() const;
270 void setPageZoomFactor(double);
271 void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
272 void windowScreenDidChange(uint64_t);
274 void scalePage(double scale, const WebCore::IntPoint& origin);
275 double pageScaleFactor() const;
277 void setUseFixedLayout(bool);
278 bool useFixedLayout() const { return m_useFixedLayout; }
279 void setFixedLayoutSize(const WebCore::IntSize&);
281 void setPaginationMode(uint32_t /* WebCore::Page::Pagination::Mode */);
282 void setPaginationBehavesLikeColumns(bool);
283 void setPageLength(double);
284 void setGapBetweenPages(double);
286 bool drawsBackground() const { return m_drawsBackground; }
287 bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
290 void stopLoadingFrame(uint64_t frameID);
291 void setDefersLoading(bool deferLoading);
293 #if USE(ACCELERATED_COMPOSITING)
294 void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
295 void exitAcceleratedCompositingMode();
299 void addPluginView(PluginView*);
300 void removePluginView(PluginView*);
302 bool windowIsVisible() const { return m_windowIsVisible; }
303 const WebCore::IntRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
304 const WebCore::IntRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
306 HWND nativeWindow() const { return m_nativeWindow; }
309 bool windowIsFocused() const;
310 void installPageOverlay(PassRefPtr<PageOverlay>);
311 void uninstallPageOverlay(PageOverlay*, bool fadeOut);
312 bool hasPageOverlay() const { return m_pageOverlay; }
313 WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
314 WebCore::IntRect windowToScreen(const WebCore::IntRect&);
316 PassRefPtr<WebImage> snapshotInViewCoordinates(const WebCore::IntRect&, ImageOptions);
317 PassRefPtr<WebImage> snapshotInDocumentCoordinates(const WebCore::IntRect&, ImageOptions);
318 PassRefPtr<WebImage> scaledSnapshotInDocumentCoordinates(const WebCore::IntRect&, double scaleFactor, ImageOptions);
320 static const WebEvent* currentEvent();
322 FindController& findController() { return m_findController; }
324 TapHighlightController& tapHighlightController() { return m_tapHighlightController; }
327 #if ENABLE(GEOLOCATION)
328 GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager; }
331 NotificationPermissionRequestManager* notificationPermissionRequestManager();
333 void pageDidScroll();
334 #if USE(TILED_BACKING_STORE)
335 void pageDidRequestScroll(const WebCore::IntPoint&);
336 void setFixedVisibleContentRect(const WebCore::IntRect&);
337 void setResizesToContentsUsingLayoutSize(const WebCore::IntSize&);
338 void resizeToContentsIfNeeded();
339 void setViewportSize(const WebCore::IntSize&);
340 WebCore::IntSize viewportSize() const { return m_viewportSize; }
343 WebContextMenu* contextMenu();
345 bool hasLocalDataForURL(const WebCore::KURL&);
346 String cachedResponseMIMETypeForURL(const WebCore::KURL&);
347 String cachedSuggestedFilenameForURL(const WebCore::KURL&);
348 PassRefPtr<WebCore::SharedBuffer> cachedResponseDataForURL(const WebCore::KURL&);
350 static bool canHandleRequest(const WebCore::ResourceRequest&);
352 class SandboxExtensionTracker {
354 ~SandboxExtensionTracker();
358 void beginLoad(WebFrame*, const SandboxExtension::Handle& handle);
359 void willPerformLoadDragDestinationAction(PassRefPtr<SandboxExtension> pendingDropSandboxExtension);
360 void didStartProvisionalLoad(WebFrame*);
361 void didCommitProvisionalLoad(WebFrame*);
362 void didFailProvisionalLoad(WebFrame*);
365 void setPendingProvisionalSandboxExtension(PassRefPtr<SandboxExtension>);
367 RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
368 RefPtr<SandboxExtension> m_provisionalSandboxExtension;
369 RefPtr<SandboxExtension> m_committedSandboxExtension;
372 SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
375 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
376 void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
377 void cancelComposition();
381 void registerUIProcessAccessibilityTokens(const CoreIPC::DataReference& elemenToken, const CoreIPC::DataReference& windowToken);
382 WKAccessibilityWebPageObject* accessibilityRemoteObject();
383 WebCore::IntPoint accessibilityPosition() const { return m_accessibilityPosition; }
385 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
387 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, EditorState& newState);
388 void confirmComposition(EditorState& newState);
389 void cancelComposition(EditorState& newState);
390 void insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, bool& handled, EditorState& newState);
391 void getMarkedRange(uint64_t& location, uint64_t& length);
392 void getSelectedRange(uint64_t& location, uint64_t& length);
393 void getAttributedSubstringFromRange(uint64_t location, uint64_t length, AttributedString&);
394 void characterIndexForPoint(const WebCore::IntPoint point, uint64_t& result);
395 void firstRectForCharacterRange(uint64_t location, uint64_t length, WebCore::IntRect& resultRect);
396 void executeKeypressCommands(const Vector<WebCore::KeypressCommand>&, bool& handled, EditorState& newState);
397 void writeSelectionToPasteboard(const WTF::String& pasteboardName, const WTF::Vector<WTF::String>& pasteboardTypes, bool& result);
398 void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
399 void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
400 void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
401 bool performNonEditingBehaviorForSelector(const String&);
404 void confirmComposition(const String& compositionString);
405 void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
406 void firstRectForCharacterInSelectedRange(const uint64_t characterPosition, WebCore::IntRect& resultRect);
407 void getSelectedText(WTF::String&);
409 void gestureWillBegin(const WebCore::IntPoint&, bool& canBeginPanning);
410 void gestureDidScroll(const WebCore::IntSize&);
411 void gestureDidEnd();
414 void updateAccessibilityTree();
417 void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
418 bool hasCompositionForTesting();
419 void confirmCompositionForTesting(const String& compositionString);
421 // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
422 // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
426 void performDictionaryLookupForSelection(DictionaryPopupInfo::Type, WebCore::Frame*, const WebCore::VisibleSelection&);
429 void speak(const String&);
432 bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
435 void replaceSelectionWithText(WebCore::Frame*, const String&);
436 void clearSelection();
438 void performDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, const WebCore::DragDataMap&, uint32_t flags);
439 #elif PLATFORM(QT) || PLATFORM(GTK)
440 void performDragControllerAction(uint64_t action, WebCore::DragData);
442 void performDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, const WTF::String& dragStorageName, uint32_t flags, const SandboxExtension::Handle&);
444 void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
446 void willPerformLoadDragDestinationAction();
448 void beginPrinting(uint64_t frameID, const PrintInfo&);
450 void computePagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
451 #if PLATFORM(MAC) || PLATFORM(WIN)
452 void drawRectToPDF(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, uint64_t callbackID);
453 void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, uint64_t callbackID);
455 void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
458 void setMediaVolume(float);
460 bool mainFrameHasCustomRepresentation() const;
462 void didChangeScrollOffsetForMainFrame();
464 void mainFrameDidLayout();
466 bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
467 void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
469 bool canRunModal() const { return m_canRunModal; }
470 void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
474 void setDeviceScaleFactor(float);
475 float deviceScaleFactor() const;
477 void setMemoryCacheMessagesEnabled(bool);
479 void forceRepaintWithoutCallback();
481 void unmarkAllMisspellings();
482 void unmarkAllBadGrammar();
484 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD)
485 void handleCorrectionPanelResult(const String&);
488 // For testing purpose.
489 void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
490 void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
491 void simulateMouseMotion(WebCore::IntPoint, double time);
492 String viewportConfigurationAsText(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight);
494 void contextMenuShowing() { m_isShowingContextMenu = true; }
497 void registerApplicationScheme(const String& scheme);
498 void applicationSchemeReply(const QtNetworkReplyData&);
499 void receivedApplicationSchemeRequest(const QNetworkRequest&, QtNetworkReply*);
501 void wheelEvent(const WebWheelEvent&);
502 #if ENABLE(GESTURE_EVENTS)
503 void gestureEvent(const WebGestureEvent&);
506 void numWheelEventHandlersChanged(unsigned);
507 void recomputeShortCircuitHorizontalWheelEventsState();
509 bool willGoToBackForwardItemCallbackEnabled() const { return m_willGoToBackForwardItemCallbackEnabled; }
512 WebPage(uint64_t pageID, const WebPageCreationParameters&);
514 virtual Type type() const { return APIType; }
516 void platformInitialize();
518 void didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
519 void didReceiveSyncWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
522 static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
524 bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
527 bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
530 String sourceForFrame(WebFrame*);
532 void loadData(PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::KURL& baseURL, const WebCore::KURL& failingURL);
534 bool platformHasLocalDataForURL(const WebCore::KURL&);
538 void loadURL(const String&, const SandboxExtension::Handle&);
539 void loadURLRequest(const WebCore::ResourceRequest&, const SandboxExtension::Handle&);
540 void loadHTMLString(const String& htmlString, const String& baseURL);
541 void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL);
542 void loadPlainTextString(const String&);
543 void loadWebArchiveData(const CoreIPC::DataReference&);
544 void linkClicked(const String& url, const WebMouseEvent&);
545 void reload(bool reloadFromOrigin, const SandboxExtension::Handle&);
546 void goForward(uint64_t);
547 void goBack(uint64_t);
548 void goToBackForwardItem(uint64_t);
549 void tryRestoreScrollPosition();
550 void setActive(bool);
551 void setFocused(bool);
552 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&);
553 void setWindowResizerSize(const WebCore::IntSize&);
554 void setIsInWindow(bool);
555 void validateCommand(const String&, uint64_t);
556 void executeEditCommand(const String&);
558 void mouseEvent(const WebMouseEvent&);
559 void mouseEventSyncForTesting(const WebMouseEvent&, bool&);
560 void wheelEventSyncForTesting(const WebWheelEvent&, bool&);
561 void keyEvent(const WebKeyboardEvent&);
562 void keyEventSyncForTesting(const WebKeyboardEvent&, bool&);
563 #if ENABLE(TOUCH_EVENTS)
564 void touchEvent(const WebTouchEvent&);
565 void touchEventSyncForTesting(const WebTouchEvent&, bool& handled);
567 void highlightPotentialActivation(const WebCore::IntPoint&);
570 void contextMenuHidden() { m_isShowingContextMenu = false; }
572 static void scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
573 static void logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
575 uint64_t restoreSession(const SessionState&);
576 void restoreSessionAndNavigateToCurrentItem(const SessionState&);
578 void didRemoveBackForwardItem(uint64_t);
580 void setWillGoToBackForwardItemCallbackEnabled(bool enabled) { m_willGoToBackForwardItemCallbackEnabled = enabled; }
582 void setDrawsBackground(bool);
583 void setDrawsTransparentBackground(bool);
585 void viewWillStartLiveResize();
586 void viewWillEndLiveResize();
588 void getContentsAsString(uint64_t callbackID);
589 void getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID);
590 void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, uint64_t callbackID);
591 void getRenderTreeExternalRepresentation(uint64_t callbackID);
592 void getSelectionOrContentsAsString(uint64_t callbackID);
593 void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
594 void getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID);
595 void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
596 void forceRepaint(uint64_t callbackID);
598 void preferencesDidChange(const WebPreferencesStore&);
599 void platformPreferencesDidChange(const WebPreferencesStore&);
600 void updatePreferences(const WebPreferencesStore&);
602 void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID);
603 void setUserAgent(const String&);
604 void setCustomTextEncodingName(const String&);
605 void suspendActiveDOMObjectsAndAnimations();
606 void resumeActiveDOMObjectsAndAnimations();
609 void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
610 void performDictionaryLookupForRange(DictionaryPopupInfo::Type, WebCore::Frame*, WebCore::Range*, NSDictionary *options);
612 void setWindowIsVisible(bool windowIsVisible);
613 void windowAndViewFramesChanged(const WebCore::IntRect& windowFrameInScreenCoordinates, const WebCore::IntRect& viewFrameInWindowCoordinates, const WebCore::IntPoint& accessibilityViewCoordinates);
616 void unapplyEditCommand(uint64_t commandID);
617 void reapplyEditCommand(uint64_t commandID);
618 void didRemoveEditCommand(uint64_t commandID);
620 void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
622 void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
625 void findZoomableAreaForPoint(const WebCore::IntPoint&);
628 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
629 void setTextForActivePopupMenu(int32_t index);
632 void failedToShowPopupMenu();
635 void didChooseFilesForOpenPanel(const Vector<String>&);
636 void didCancelForOpenPanel();
637 #if ENABLE(WEB_PROCESS_SANDBOX)
638 void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
641 void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
643 void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
645 void advanceToNextMisspelling(bool startBeforeSelection);
646 void changeSpellingToWord(const String& word);
648 void uppercaseWord();
649 void lowercaseWord();
650 void capitalizeWord();
652 void setSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled) { m_isSmartInsertDeleteEnabled = isSmartInsertDeleteEnabled; }
655 #if ENABLE(CONTEXT_MENUS)
656 void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
659 void setCanStartMediaTimerFired();
661 static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
663 OwnPtr<WebCore::Page> m_page;
664 RefPtr<WebFrame> m_mainFrame;
665 RefPtr<InjectedBundleBackForwardList> m_backForwardList;
667 RefPtr<WebPageGroupProxy> m_pageGroup;
671 WebCore::IntSize m_viewSize;
672 OwnPtr<DrawingArea> m_drawingArea;
673 bool m_useFixedLayout;
675 bool m_drawsBackground;
676 bool m_drawsTransparentBackground;
684 // Whether the containing window is visible or not.
685 bool m_windowIsVisible;
687 // Whether smart insert/delete is enabled or not.
688 bool m_isSmartInsertDeleteEnabled;
690 // The frame of the containing window in screen coordinates.
691 WebCore::IntRect m_windowFrameInScreenCoordinates;
693 // The frame of the view in window coordinates.
694 WebCore::IntRect m_viewFrameInWindowCoordinates;
696 // The accessibility position of the view.
697 WebCore::IntPoint m_accessibilityPosition;
699 // All plug-in views on this web page.
700 HashSet<PluginView*> m_pluginViews;
702 RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
704 WebCore::KeyboardEvent* m_keyboardEventBeingInterpreted;
707 // Our view's window (in the UI process).
710 RefPtr<WebCore::Node> m_gestureTargetNode;
712 WebPageAccessibilityObject* m_accessibilityObject;
715 WebCore::RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
717 HashMap<uint64_t, RefPtr<WebUndoStep> > m_undoStepMap;
719 WebCore::IntSize m_windowResizerSize;
721 InjectedBundlePageContextMenuClient m_contextMenuClient;
722 InjectedBundlePageEditorClient m_editorClient;
723 InjectedBundlePageFormClient m_formClient;
724 InjectedBundlePageLoaderClient m_loaderClient;
725 InjectedBundlePagePolicyClient m_policyClient;
726 InjectedBundlePageResourceLoadClient m_resourceLoadClient;
727 InjectedBundlePageUIClient m_uiClient;
728 #if ENABLE(FULLSCREEN_API)
729 InjectedBundlePageFullScreenClient m_fullScreenClient;
732 #if USE(TILED_BACKING_STORE)
733 WebCore::IntSize m_viewportSize;
736 FindController m_findController;
738 TapHighlightController m_tapHighlightController;
740 RefPtr<PageOverlay> m_pageOverlay;
742 RefPtr<WebPage> m_underlayPage;
744 #if ENABLE(INSPECTOR)
745 RefPtr<WebInspector> m_inspector;
747 #if ENABLE(FULLSCREEN_API)
748 RefPtr<WebFullScreenManager> m_fullScreenManager;
750 RefPtr<WebPopupMenu> m_activePopupMenu;
751 RefPtr<WebContextMenu> m_contextMenu;
752 RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
753 RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
755 #if ENABLE(GEOLOCATION)
756 GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
759 OwnPtr<WebCore::PrintContext> m_printContext;
761 RefPtr<WebPrintOperationGtk> m_printOperation;
764 SandboxExtensionTracker m_sandboxExtensionTracker;
767 RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
769 bool m_canRunBeforeUnloadConfirmPanel;
772 bool m_isRunningModal;
774 bool m_cachedMainFrameIsPinnedToLeftSide;
775 bool m_cachedMainFrameIsPinnedToRightSide;
776 bool m_canShortCircuitHorizontalWheelEvents;
777 unsigned m_numWheelEventHandlers;
779 unsigned m_cachedPageCount;
781 bool m_isShowingContextMenu;
783 bool m_willGoToBackForwardItemCallbackEnabled;
786 bool m_gestureReachedScrollingLimit;
789 HashMap<String, QtNetworkReply*> m_applicationSchemeReplies;
793 } // namespace WebKit