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 #if ENABLE(CONTEXT_MENUS)
36 #include "InjectedBundlePageContextMenuClient.h"
38 #include "InjectedBundlePageDiagnosticLoggingClient.h"
39 #include "InjectedBundlePageEditorClient.h"
40 #include "InjectedBundlePageFormClient.h"
41 #include "InjectedBundlePageFullScreenClient.h"
42 #include "InjectedBundlePageLoaderClient.h"
43 #include "InjectedBundlePagePolicyClient.h"
44 #include "InjectedBundlePageResourceLoadClient.h"
45 #include "InjectedBundlePageUIClient.h"
46 #include "MessageSender.h"
47 #include "TapHighlightController.h"
49 #include "SandboxExtension.h"
50 #include "ShareableBitmap.h"
51 #include "WebHitTestResult.h"
52 #include "WebUndoStep.h"
53 #include <WebCore/DictationAlternative.h>
54 #include <WebCore/DragData.h>
55 #include <WebCore/Editor.h>
56 #include <WebCore/FrameLoaderTypes.h>
57 #include <WebCore/IntRect.h>
58 #include <WebCore/Page.h>
59 #if ENABLE(PAGE_VISIBILITY_API)
60 #include <WebCore/PageVisibilityState.h>
62 #include <WebCore/PlatformScreen.h>
63 #include <WebCore/ScrollTypes.h>
64 #include <WebCore/WebCoreKeyboardUIMode.h>
65 #include <wtf/HashMap.h>
66 #include <wtf/OwnPtr.h>
67 #include <wtf/PassRefPtr.h>
68 #include <wtf/RefPtr.h>
69 #include <wtf/text/WTFString.h>
72 #include "ArgumentCodersQt.h"
73 #include "QtNetworkAccessManager.h"
74 #include "QtNetworkReply.h"
75 #include "QtNetworkReplyData.h"
76 #include "QtNetworkRequestData.h"
77 #include <QNetworkReply>
78 #include <QNetworkRequest>
82 #include "ArgumentCodersGtk.h"
83 #include "WebPageAccessibilityObject.h"
84 #include "WebPrintOperationGtk.h"
87 #if ENABLE(TOUCH_EVENTS)
88 #include <WebCore/PlatformTouchEvent.h>
92 #include "DictionaryPopupInfo.h"
93 #include "LayerHostingContext.h"
94 #include <wtf/RetainPtr.h>
95 OBJC_CLASS NSDictionary;
97 OBJC_CLASS WKAccessibilityWebPageObject;
100 #if ENABLE(TIZEN_PAGE_VISIBILITY_API)
101 #include <WebCore/PageVisibilityState.h>
104 #if ENABLE(TIZEN_CUSTOM_HEADERS)
105 #include <WebCore/HTTPHeaderMap.h>
108 #if ENABLE(TIZEN_DATALIST_ELEMENT)
109 #include "HTMLDataListElement.h"
112 #if ENABLE(TIZEN_DRAG_SUPPORT)
113 #include "ArgumentCodersTizen.h"
116 #if ENABLE(TIZEN_SCREEN_READER)
117 #include "ScreenReader.h"
120 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
121 #include "EditorState.h"
125 class ArgumentDecoder;
131 class GraphicsContext;
134 class HTMLPlugInElement;
139 class ResourceRequest;
141 class VisibleSelection;
142 struct KeypressCommand;
144 #if ENABLE(TIZEN_DATALIST_ELEMENT)
145 class HTMLDataListElement;
152 class InjectedBundleBackForwardList;
153 class NotificationPermissionRequestManager;
157 class WebColorChooser;
158 class WebContextMenu;
159 class WebContextMenuItemData;
162 class WebFullScreenManager;
165 class WebInspectorClient;
166 class WebKeyboardEvent;
168 class WebNotificationClient;
169 class WebOpenPanelResultListener;
170 class WebPageGroupProxy;
173 struct AttributedString;
176 struct WebPageCreationParameters;
177 struct WebPreferencesStore;
179 #if ENABLE(WEB_INTENTS)
183 #if ENABLE(GESTURE_EVENTS)
184 class WebGestureEvent;
187 #if ENABLE(TOUCH_EVENTS)
191 #if ENABLE(TIZEN_MEDIA_STREAM)
192 class UserMediaPermissionRequestManager;
193 class WebUserMediaClient;
196 #if ENABLE(TIZEN_ISF_PORT)
197 class NativeWebKeyboardEvent;
200 class WebPage : public APIObject, public CoreIPC::MessageSender<WebPage> {
202 static const Type APIType = TypeBundlePage;
204 static PassRefPtr<WebPage> create(uint64_t pageID, const WebPageCreationParameters&);
207 // Used by MessageSender.
208 CoreIPC::Connection* connection() const;
209 uint64_t destinationID() const { return pageID(); }
213 WebCore::Page* corePage() const { return m_page.get(); }
214 uint64_t pageID() const { return m_pageID; }
216 void setSize(const WebCore::IntSize&);
217 const WebCore::IntSize& size() const { return m_viewSize; }
218 WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
220 InjectedBundleBackForwardList* backForwardList();
221 DrawingArea* drawingArea() const { return m_drawingArea.get(); }
223 WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
225 void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
227 void scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
229 void centerSelectionInVisibleArea();
232 #if ENABLE(TIZEN_TEXT_CARET_HANDLING_WK2)
233 bool setCaretPosition(const WebCore::IntPoint&);
234 void getCaretPosition(WebCore::IntRect&);
236 #if ENABLE(TIZEN_ISF_PORT)
237 void didCancelComposition(WebCore::Node*);
239 void getCursorOffset(int&);
240 void getSurroundingTextAndCursorOffset(String&, int&);
241 void getSelectionRect(bool, WebCore::IntRect&);
242 void deleteSurroundingText(int, int);
244 void scrollMainFrameBy(const WebCore::IntSize&);
245 void scrollMainFrameTo(const WebCore::IntPoint&);
246 void createSnapshot(const WebCore::IntRect, float, ShareableBitmap::Handle&);
247 void requestUpdateFormNavigation();
248 void moveFocus(int newIndex);
249 #if ENABLE(TIZEN_MOBILE_WEB_PRINT)
250 void createPagesToPDF(const WebCore::IntSize&, const WebCore::IntSize&, const String&);
252 #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
253 void hitTestResultAtPoint(const WebCore::IntPoint&, int hitTestMode, WebHitTestResult::Data&);
256 #if ENABLE(TIZEN_WEB_STORAGE)
257 void getStorageQuotaBytes(uint64_t callbackID);
258 void setStorageQuotaBytes(uint32_t quota);
261 #if ENABLE(TIZEN_CLIPBOARD) || ENABLE(TIZEN_PASTEBOARD)
262 void setClipboardDataForPaste(const String& data, const String& type);
265 void suspendJavaScriptAndResources();
266 void resumeJavaScriptAndResources();
267 #if ENABLE(TIZEN_SYNC_REQUEST_ANIMATION_FRAME)
268 void suspendAnimationController();
269 void resumeAnimationController();
271 #if ENABLE(TIZEN_PLUGIN_SUSPEND_RESUME)
272 void suspendPlugin();
276 #if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR)
277 void startInspectorServer(uint32_t port, uint32_t& assignedPort);
278 void stopInspectorServer(bool& result);
280 #if ENABLE(TIZEN_ORIENTATION_EVENTS)
281 void sendOrientationChangeEvent(int orientation);
284 #if ENABLE(INSPECTOR)
285 WebInspector* inspector();
288 #if ENABLE(FULLSCREEN_API)
289 WebFullScreenManager* fullScreenManager();
292 // -- Called by the DrawingArea.
293 // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
294 void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
295 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
296 void selectClosestWord(const WebCore::IntPoint&, bool isStartedTextSelectionFromOutside, bool& result);
297 void setLeftSelection(const WebCore::IntPoint&, bool& result);
298 void setRightSelection(const WebCore::IntPoint&, bool& result);
299 void getSelectionHandlers(WebCore::IntRect& leftRect, WebCore::IntRect& rightRect);
300 void getSelectionText(String& result);
301 void selectionRangeClear(bool& result);
302 void selectionClearAllSelection(WebCore::Frame* frame);
303 void scrollContentByCharacter(const WebCore::IntPoint&, int direction, bool& result);
304 void scrollContentByLine(const WebCore::IntPoint&, int direction, bool& result);
307 #if ENABLE(TIZEN_OFFLINE_PAGE_SAVE)
308 void startOfflinePageSave(String subresourceFolderName);
311 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_TEXT_SELECTION_MODE)
312 void selectLink(WebCore::IntPoint positionForSelection, bool& result);
315 void drawPageOverlay(WebCore::GraphicsContext&, const WebCore::IntRect&);
316 void layoutIfNeeded();
318 // -- Called from WebCore clients.
320 bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*, bool saveCommands);
322 bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
326 String userAgent() const { return m_userAgent; }
327 WebCore::IntRect windowResizerRect() const;
328 WebCore::KeyboardUIMode keyboardUIMode();
330 WebUndoStep* webUndoStep(uint64_t);
331 void addWebUndoStep(uint64_t, WebUndoStep*);
332 void removeWebEditCommand(uint64_t);
333 bool isInRedo() const { return m_isInRedo; }
335 void setActivePopupMenu(WebPopupMenu*);
337 #if ENABLE(INPUT_TYPE_COLOR)
338 WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
339 void setActiveColorChooser(WebColorChooser*);
340 void didChooseColor(const WebCore::Color&);
341 void didEndColorChooser();
344 WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
345 void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>);
347 void cancelForOpenPanel();
350 // -- Called from WebProcess.
351 void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
352 void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
354 // -- InjectedBundle methods
355 #if ENABLE(CONTEXT_MENUS)
356 void initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClient*);
358 void initializeInjectedBundleEditorClient(WKBundlePageEditorClient*);
359 void initializeInjectedBundleFormClient(WKBundlePageFormClient*);
360 void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClient*);
361 void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClient*);
362 void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClient*);
363 void initializeInjectedBundleUIClient(WKBundlePageUIClient*);
364 #if ENABLE(FULLSCREEN_API)
365 void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClient*);
367 void initializeInjectedBundleDiagnosticLoggingClient(WKBundlePageDiagnosticLoggingClient*);
369 #if ENABLE(CONTEXT_MENUS)
370 InjectedBundlePageContextMenuClient& injectedBundleContextMenuClient() { return m_contextMenuClient; }
372 InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; }
373 InjectedBundlePageFormClient& injectedBundleFormClient() { return m_formClient; }
374 InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; }
375 InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
376 InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
377 InjectedBundlePageUIClient& injectedBundleUIClient() { return m_uiClient; }
378 InjectedBundlePageDiagnosticLoggingClient& injectedBundleDiagnosticLoggingClient() { return m_logDiagnosticMessageClient; }
379 #if ENABLE(FULLSCREEN_API)
380 InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
383 void setUnderlayPage(PassRefPtr<WebPage> underlayPage) { m_underlayPage = underlayPage; }
385 bool findStringFromInjectedBundle(const String&, FindOptions);
387 WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
389 WebCore::Frame* mainFrame() const; // May return 0.
390 WebCore::FrameView* mainFrameView() const; // May return 0.
392 PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&);
394 EditorState editorState() const;
395 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
396 void setEditorState(const EditorState& editorState) { m_editorState = editorState;}
399 String renderTreeExternalRepresentation() const;
400 uint64_t renderTreeSize() const;
401 void setPaintedObjectsCounterThreshold(uint64_t);
403 void setTracksRepaints(bool);
404 bool isTrackingRepaints() const;
405 void resetTrackedRepaints();
406 PassRefPtr<ImmutableArray> trackedRepaintRects();
408 void executeEditingCommand(const String& commandName, const String& argument);
409 bool isEditingCommandEnabled(const String& commandName);
410 void clearMainFrameName();
413 double textZoomFactor() const;
414 void setTextZoomFactor(double);
415 double pageZoomFactor() const;
416 void setPageZoomFactor(double);
417 void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
418 void windowScreenDidChange(uint64_t);
419 void setViewMode(WebCore::Page::ViewMode);
421 void scalePage(double scale, const WebCore::IntPoint& origin);
422 double pageScaleFactor() const;
424 void setUseFixedLayout(bool);
425 bool useFixedLayout() const { return m_useFixedLayout; }
426 void setFixedLayoutSize(const WebCore::IntSize&);
428 void setPaginationMode(uint32_t /* WebCore::Page::Pagination::Mode */);
429 void setPaginationBehavesLikeColumns(bool);
430 void setPageLength(double);
431 void setGapBetweenPages(double);
433 bool drawsBackground() const { return m_drawsBackground; }
434 bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
437 void stopLoadingFrame(uint64_t frameID);
438 void setDefersLoading(bool deferLoading);
440 #if USE(ACCELERATED_COMPOSITING)
441 void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
442 void exitAcceleratedCompositingMode();
445 void addPluginView(PluginView*);
446 void removePluginView(PluginView*);
449 LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
450 void setLayerHostingMode(LayerHostingMode);
452 bool windowIsVisible() const { return m_windowIsVisible; }
453 void updatePluginsActiveAndFocusedState();
454 const WebCore::IntRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
455 const WebCore::IntRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
457 HWND nativeWindow() const { return m_nativeWindow; }
460 bool windowIsFocused() const;
461 bool windowAndWebPageAreFocused() const;
462 void installPageOverlay(PassRefPtr<PageOverlay>);
463 void uninstallPageOverlay(PageOverlay*, bool fadeOut);
464 bool hasPageOverlay() const { return m_pageOverlay; }
465 WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
466 WebCore::IntRect windowToScreen(const WebCore::IntRect&);
468 PassRefPtr<WebImage> snapshotInViewCoordinates(const WebCore::IntRect&, ImageOptions);
469 PassRefPtr<WebImage> scaledSnapshotInViewCoordinates(const WebCore::IntRect&, double scaleFactor, ImageOptions);
470 PassRefPtr<WebImage> snapshotInDocumentCoordinates(const WebCore::IntRect&, ImageOptions);
471 PassRefPtr<WebImage> scaledSnapshotInDocumentCoordinates(const WebCore::IntRect&, double scaleFactor, ImageOptions);
473 static const WebEvent* currentEvent();
475 FindController& findController() { return m_findController; }
476 #if ENABLE(TOUCH_EVENTS) && PLATFORM(QT)
477 TapHighlightController& tapHighlightController() { return m_tapHighlightController; }
480 #if ENABLE(GEOLOCATION)
481 GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager; }
484 NotificationPermissionRequestManager* notificationPermissionRequestManager();
485 #if ENABLE(TIZEN_MEDIA_STREAM)
486 UserMediaPermissionRequestManager* userMediaPermissionRequestManager();
488 void pageDidScroll();
489 #if USE(TILED_BACKING_STORE)
490 void pageDidRequestScroll(const WebCore::IntPoint&);
492 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
493 void pageDidRequestRestoreVisibleContentRect(const WebCore::IntPoint&, float);
496 void setFixedVisibleContentRect(const WebCore::IntRect&);
497 void setResizesToContentsUsingLayoutSize(const WebCore::IntSize&);
498 void resizeToContentsIfNeeded();
499 void sendViewportAttributesChanged();
500 void setViewportSize(const WebCore::IntSize&);
501 WebCore::IntSize viewportSize() const { return m_viewportSize; }
503 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
504 WebCore::IntSize contentsSize() const;
509 #if ENABLE(CONTEXT_MENUS)
510 WebContextMenu* contextMenu();
513 bool hasLocalDataForURL(const WebCore::KURL&);
514 String cachedResponseMIMETypeForURL(const WebCore::KURL&);
515 String cachedSuggestedFilenameForURL(const WebCore::KURL&);
516 PassRefPtr<WebCore::SharedBuffer> cachedResponseDataForURL(const WebCore::KURL&);
518 static bool canHandleRequest(const WebCore::ResourceRequest&);
520 class SandboxExtensionTracker {
522 ~SandboxExtensionTracker();
526 void beginLoad(WebFrame*, const SandboxExtension::Handle& handle);
527 void willPerformLoadDragDestinationAction(PassRefPtr<SandboxExtension> pendingDropSandboxExtension);
528 void didStartProvisionalLoad(WebFrame*);
529 void didCommitProvisionalLoad(WebFrame*);
530 void didFailProvisionalLoad(WebFrame*);
533 void setPendingProvisionalSandboxExtension(PassRefPtr<SandboxExtension>);
535 RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
536 RefPtr<SandboxExtension> m_provisionalSandboxExtension;
537 RefPtr<SandboxExtension> m_committedSandboxExtension;
540 SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
543 void setThemePath(const String&);
547 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
548 void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
549 void cancelComposition();
553 void registerUIProcessAccessibilityTokens(const CoreIPC::DataReference& elemenToken, const CoreIPC::DataReference& windowToken);
554 WKAccessibilityWebPageObject* accessibilityRemoteObject();
555 WebCore::IntPoint accessibilityPosition() const { return m_accessibilityPosition; }
557 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
559 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, EditorState& newState);
560 void confirmComposition(EditorState& newState);
561 void cancelComposition(EditorState& newState);
562 void insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, bool& handled, EditorState& newState);
563 void getMarkedRange(uint64_t& location, uint64_t& length);
564 void getSelectedRange(uint64_t& location, uint64_t& length);
565 void getAttributedSubstringFromRange(uint64_t location, uint64_t length, AttributedString&);
566 void characterIndexForPoint(const WebCore::IntPoint point, uint64_t& result);
567 void firstRectForCharacterRange(uint64_t location, uint64_t length, WebCore::IntRect& resultRect);
568 void executeKeypressCommands(const Vector<WebCore::KeypressCommand>&, bool& handled, EditorState& newState);
569 void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
570 void getStringSelectionForPasteboard(WTF::String& stringValue);
571 void getDataSelectionForPasteboard(const WTF::String pasteboardType, SharedMemory::Handle& handle, uint64_t& size);
572 void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
573 void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
574 bool performNonEditingBehaviorForSelector(const String&);
575 void insertDictatedText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, const Vector<WebCore::DictationAlternative>& dictationAlternativeLocations, bool& handled, EditorState& newState);
577 void confirmComposition(const String& compositionString);
578 void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
579 void firstRectForCharacterInSelectedRange(const uint64_t characterPosition, WebCore::IntRect& resultRect);
580 void getSelectedText(WTF::String&);
582 void gestureWillBegin(const WebCore::IntPoint&, bool& canBeginPanning);
583 void gestureDidScroll(const WebCore::IntSize&);
584 void gestureDidEnd();
586 void confirmComposition(const String& compositionString);
587 void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
588 void cancelComposition();
590 void updateAccessibilityTree();
591 bool handleMousePressedEvent(const WebCore::PlatformMouseEvent&);
592 #if USE(TEXTURE_MAPPER_GL)
593 void widgetMapped(int64_t nativeWindowHandle);
597 void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
598 bool hasCompositionForTesting();
599 void confirmCompositionForTesting(const String& compositionString);
601 // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
602 // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
606 void performDictionaryLookupForSelection(DictionaryPopupInfo::Type, WebCore::Frame*, const WebCore::VisibleSelection&);
609 void speak(const String&);
612 bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
615 #if ENABLE(WEB_INTENTS)
616 void deliverIntentToFrame(uint64_t frameID, const IntentData&);
619 void replaceSelectionWithText(WebCore::Frame*, const String&);
620 void clearSelection();
622 #if ENABLE(DRAG_SUPPORT)
624 void performDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, const WebCore::DragDataMap&, uint32_t flags);
625 #elif PLATFORM(QT) || PLATFORM(GTK)
626 void performDragControllerAction(uint64_t action, WebCore::DragData);
628 #if ENABLE(TIZEN_DRAG_SUPPORT)
629 void performDragControllerAction(uint64_t action, WebCore::DragData);
631 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&);
634 void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
636 void willPerformLoadDragDestinationAction();
637 void mayPerformUploadDragDestinationAction();
638 #endif // ENABLE(DRAG_SUPPORT)
640 void beginPrinting(uint64_t frameID, const PrintInfo&);
642 void computePagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
643 #if PLATFORM(MAC) || PLATFORM(WIN)
644 void drawRectToPDF(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, uint64_t callbackID);
645 void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, uint64_t callbackID);
647 void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
650 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
651 void getWebAppCapable(uint64_t callbackID);
652 void getWebAppIconURL(uint64_t callbackID);
653 void getWebAppIconURLs(uint64_t callbackID);
656 void setMediaVolume(float);
658 bool mainFrameHasCustomRepresentation() const;
660 void didChangeScrollOffsetForMainFrame();
662 void mainFrameDidLayout();
664 bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
665 void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
667 bool canRunModal() const { return m_canRunModal; }
668 void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
672 void setDeviceScaleFactor(float);
673 float deviceScaleFactor() const;
675 void setMemoryCacheMessagesEnabled(bool);
677 void forceRepaintWithoutCallback();
679 void unmarkAllMisspellings();
680 void unmarkAllBadGrammar();
681 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
682 void handleAlternativeTextUIResult(const String&);
685 // For testing purpose.
686 void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
687 void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
688 void simulateMouseMotion(WebCore::IntPoint, double time);
690 #if ENABLE(CONTEXT_MENUS)
691 void contextMenuShowing() { m_isShowingContextMenu = true; }
695 void registerApplicationScheme(const String& scheme);
696 void applicationSchemeReply(const QtNetworkReplyData&);
697 void receivedApplicationSchemeRequest(const QNetworkRequest&, QtNetworkReply*);
698 void setUserScripts(const Vector<String>&);
700 void wheelEvent(const WebWheelEvent&);
701 #if ENABLE(GESTURE_EVENTS)
702 void gestureEvent(const WebGestureEvent&);
705 void numWheelEventHandlersChanged(unsigned);
706 void recomputeShortCircuitHorizontalWheelEventsState();
708 bool willGoToBackForwardItemCallbackEnabled() const { return m_willGoToBackForwardItemCallbackEnabled; }
710 #if ENABLE(PAGE_VISIBILITY_API)
711 void setVisibilityState(int visibilityState, bool isInitialState);
714 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION) || ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
715 void setFocusedInputElementValue(const String& inputValue);
716 void getFocusedInputElementValue(String& inputValue);
719 #if ENABLE(TIZEN_DATALIST_ELEMENT)
720 void getFocusedInputElementDataList(Vector<String>&);
723 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
724 void scrollOverflow(const WebCore::FloatPoint&, bool& scrolled);
725 void setPressedNodeAtPoint(const WebCore::IntPoint&, bool checkOverflowLayer, bool& pressed, uint32_t& id);
728 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE)
729 void scrollOverflowWithTrajectoryVector(const WebCore::FloatPoint&);
732 #if ENABLE(TIZEN_CUSTOM_HEADERS)
733 void addCustomHeader(const String& name, const String& value);
734 void removeCustomHeader(const String& name);
735 void clearCustomHeaders();
736 WebCore::HTTPHeaderMap customHeaders();
739 #if ENABLE(TIZEN_WEBKIT2_GET_TEXT_STYLE_FOR_SELECTION)
740 void getTextStyleStateForSelection();
743 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
744 uint64_t nativeWindowHandle() { return m_nativeWindowHandle; }
747 #if ENABLE(TIZEN_MULTIPLE_SELECT)
748 void didChangeSelectedIndexForActivePopupMenuMultiple(Vector<int32_t>);
751 #if ENABLE(TIZEN_LINK_MAGNIFIER)
752 void getLinkMagnifierRect(const WebCore::IntPoint&, const WebCore::IntSize&);
755 #if ENABLE(TIZEN_SCREEN_READER)
756 void raiseTapEvent(const WebCore::IntPoint&, const WebCore::IntPoint&);
757 void moveScreenReaderFocus(bool, bool&);
758 void moveScreenReaderFocusByPoint(const WebCore::IntPoint&);
759 void recalcScreenReaderFocusRect();
760 void updateScreenReaderFocus(WebCore::RenderObject*);
761 void clearScreenReader();
764 #if ENABLE(TIZEN_SCREEN_READER) || ENABLE(TIZEN_FOCUS_UI) || ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
765 WebCore::IntRect nodeRect(WebCore::Node*) const;
768 #if ENABLE(TIZEN_WEBKIT2_POPUP_INTERNAL)
769 void notifyTransitionToCommitted(bool);
772 #if ENABLE(TIZEN_CSP)
773 void setContentSecurityPolicy(const String& policy, uint32_t headerType);
776 #if ENABLE(TIZEN_INDEXED_DATABASE)
777 void setIndexedDatabaseDirectory(const String& path);
780 #if ENABLE(TIZEN_WEB_STORAGE)
781 void setLocalStorageDirectory(const String& path);
784 #if ENABLE(TIZEN_USE_SETTINGS_FONT)
785 void useSettingsFont();
789 void didChangeContents(const WebCore::IntRect&);
793 WebPage(uint64_t pageID, const WebPageCreationParameters&);
795 virtual Type type() const { return APIType; }
797 void platformInitialize();
799 void didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
800 void didReceiveSyncWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
803 static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
805 bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
808 bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
811 String sourceForFrame(WebFrame*);
813 void loadData(PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::KURL& baseURL, const WebCore::KURL& failingURL);
815 bool platformHasLocalDataForURL(const WebCore::KURL&);
819 void loadURL(const String&, const SandboxExtension::Handle&);
820 void loadURLRequest(const WebCore::ResourceRequest&, const SandboxExtension::Handle&);
821 void loadHTMLString(const String& htmlString, const String& baseURL);
822 void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL);
823 void loadPlainTextString(const String&);
824 void loadWebArchiveData(const CoreIPC::DataReference&);
826 void loadContentsbyMimeType(const CoreIPC::DataReference&, const String& mimeType, const String& encoding, const String& baseURL);
828 void linkClicked(const String& url, const WebMouseEvent&);
829 void reload(bool reloadFromOrigin, const SandboxExtension::Handle&);
830 void goForward(uint64_t);
831 void goBack(uint64_t);
832 void goToBackForwardItem(uint64_t);
833 void tryRestoreScrollPosition();
834 void setActive(bool);
835 void setFocused(bool);
836 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&);
837 void setWindowResizerSize(const WebCore::IntSize&);
838 void setIsInWindow(bool);
839 void validateCommand(const String&, uint64_t);
840 void executeEditCommand(const String&);
842 void executeEditCommandWithArgument(const String& command, const String& argument);
845 void mouseEvent(const WebMouseEvent&);
846 void mouseEventSyncForTesting(const WebMouseEvent&, bool&);
847 void wheelEventSyncForTesting(const WebWheelEvent&, bool&);
848 #if ENABLE(TIZEN_ISF_PORT)
849 void keyEvent(const NativeWebKeyboardEvent&);
851 void keyEvent(const WebKeyboardEvent&);
853 void keyEventSyncForTesting(const WebKeyboardEvent&, bool&);
854 #if ENABLE(TOUCH_EVENTS)
855 void touchEvent(const WebTouchEvent&);
856 void touchEventSyncForTesting(const WebTouchEvent&, bool& handled);
858 void highlightPotentialActivation(const WebCore::IntPoint&, const WebCore::IntSize& area);
861 #if ENABLE(CONTEXT_MENUS)
862 void contextMenuHidden() { m_isShowingContextMenu = false; }
865 static void scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
866 static void logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
868 uint64_t restoreSession(const SessionState&);
869 void restoreSessionAndNavigateToCurrentItem(const SessionState&);
871 void didRemoveBackForwardItem(uint64_t);
873 void setWillGoToBackForwardItemCallbackEnabled(bool enabled) { m_willGoToBackForwardItemCallbackEnabled = enabled; }
875 void setDrawsBackground(bool);
876 void setDrawsTransparentBackground(bool);
878 void viewWillStartLiveResize();
879 void viewWillEndLiveResize();
881 void getContentsAsString(uint64_t callbackID);
883 void getContentsAsMHTMLData(uint64_t callbackID, bool useBinaryEncoding);
885 void getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID);
886 void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, uint64_t callbackID);
887 void getRenderTreeExternalRepresentation(uint64_t callbackID);
888 void getSelectionOrContentsAsString(uint64_t callbackID);
889 void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
890 void getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID);
891 void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
892 void forceRepaint(uint64_t callbackID);
894 void preferencesDidChange(const WebPreferencesStore&);
895 void platformPreferencesDidChange(const WebPreferencesStore&);
896 void updatePreferences(const WebPreferencesStore&);
898 void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID);
899 void setUserAgent(const String&);
900 void setCustomTextEncodingName(const String&);
901 void suspendActiveDOMObjectsAndAnimations();
902 void resumeActiveDOMObjectsAndAnimations();
905 void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
906 void performDictionaryLookupForRange(DictionaryPopupInfo::Type, WebCore::Frame*, WebCore::Range*, NSDictionary *options);
908 void setWindowIsVisible(bool windowIsVisible);
909 void windowAndViewFramesChanged(const WebCore::IntRect& windowFrameInScreenCoordinates, const WebCore::IntRect& viewFrameInWindowCoordinates, const WebCore::IntPoint& accessibilityViewCoordinates);
911 RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
912 void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
913 void drawRectToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
914 void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
917 void unapplyEditCommand(uint64_t commandID);
918 void reapplyEditCommand(uint64_t commandID);
919 void didRemoveEditCommand(uint64_t commandID);
921 void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
922 void findStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
923 void getImageForFindMatch(uint32_t matchIndex);
924 void selectFindMatch(uint32_t matchIndex);
926 void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
928 #if PLATFORM(QT) || OS(TIZEN)
929 void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area);
932 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
933 void setTextForActivePopupMenu(int32_t index);
936 void failedToShowPopupMenu();
939 void hidePopupMenu();
940 void selectedIndex(int32_t newIndex);
943 void didChooseFilesForOpenPanel(const Vector<String>&);
944 void didCancelForOpenPanel();
945 #if ENABLE(WEB_PROCESS_SANDBOX)
946 void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
949 void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
951 void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
952 #if ENABLE(TIZEN_MEDIA_STREAM)
953 void didReceiveUserMediaPermissionDecision(uint64_t userMediaID, bool allowed);
956 void advanceToNextMisspelling(bool startBeforeSelection);
957 void changeSpellingToWord(const String& word);
959 void uppercaseWord();
960 void lowercaseWord();
961 void capitalizeWord();
965 void setSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled) { m_isSmartInsertDeleteEnabled = isSmartInsertDeleteEnabled; }
968 #if ENABLE(CONTEXT_MENUS)
969 void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
972 void changeSelectedIndex(int32_t index);
973 void setCanStartMediaTimerFired();
975 static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
976 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
977 void dumpMemorySnapshot();
979 OwnPtr<WebCore::Page> m_page;
980 RefPtr<WebFrame> m_mainFrame;
981 RefPtr<InjectedBundleBackForwardList> m_backForwardList;
983 RefPtr<WebPageGroupProxy> m_pageGroup;
987 WebCore::IntSize m_viewSize;
988 OwnPtr<DrawingArea> m_drawingArea;
990 HashSet<PluginView*> m_pluginViews;
992 bool m_useFixedLayout;
994 bool m_drawsBackground;
995 bool m_drawsTransparentBackground;
1001 #if ENABLE(TIZEN_CUSTOM_HEADERS)
1002 WebCore::HTTPHeaderMap m_customHeaders;
1006 // Whether the containing window is visible or not.
1007 bool m_windowIsVisible;
1009 // Whether smart insert/delete is enabled or not.
1010 bool m_isSmartInsertDeleteEnabled;
1012 // The frame of the containing window in screen coordinates.
1013 WebCore::IntRect m_windowFrameInScreenCoordinates;
1015 // The frame of the view in window coordinates.
1016 WebCore::IntRect m_viewFrameInWindowCoordinates;
1018 // The accessibility position of the view.
1019 WebCore::IntPoint m_accessibilityPosition;
1021 // The layer hosting mode.
1022 LayerHostingMode m_layerHostingMode;
1024 RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
1026 WebCore::KeyboardEvent* m_keyboardEventBeingInterpreted;
1029 // Our view's window (in the UI process).
1030 HWND m_nativeWindow;
1032 RefPtr<WebCore::Node> m_gestureTargetNode;
1034 WebPageAccessibilityObject* m_accessibilityObject;
1036 #if USE(TEXTURE_MAPPER_GL)
1037 // Our view's window in the UI process.
1038 uint64_t m_nativeWindowHandle;
1042 WebCore::RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
1044 HashMap<uint64_t, RefPtr<WebUndoStep> > m_undoStepMap;
1046 WebCore::IntSize m_windowResizerSize;
1048 #if ENABLE(CONTEXT_MENUS)
1049 InjectedBundlePageContextMenuClient m_contextMenuClient;
1051 InjectedBundlePageEditorClient m_editorClient;
1052 InjectedBundlePageFormClient m_formClient;
1053 InjectedBundlePageLoaderClient m_loaderClient;
1054 InjectedBundlePagePolicyClient m_policyClient;
1055 InjectedBundlePageResourceLoadClient m_resourceLoadClient;
1056 InjectedBundlePageUIClient m_uiClient;
1057 #if ENABLE(FULLSCREEN_API)
1058 InjectedBundlePageFullScreenClient m_fullScreenClient;
1060 InjectedBundlePageDiagnosticLoggingClient m_logDiagnosticMessageClient;
1062 #if USE(TILED_BACKING_STORE)
1063 WebCore::IntSize m_viewportSize;
1066 FindController m_findController;
1067 #if ENABLE(TOUCH_EVENTS) && PLATFORM(QT)
1068 TapHighlightController m_tapHighlightController;
1070 RefPtr<PageOverlay> m_pageOverlay;
1072 RefPtr<WebPage> m_underlayPage;
1074 #if ENABLE(INSPECTOR)
1075 RefPtr<WebInspector> m_inspector;
1077 #if ENABLE(FULLSCREEN_API)
1078 RefPtr<WebFullScreenManager> m_fullScreenManager;
1080 RefPtr<WebPopupMenu> m_activePopupMenu;
1081 #if ENABLE(CONTEXT_MENUS)
1082 RefPtr<WebContextMenu> m_contextMenu;
1084 #if ENABLE(INPUT_TYPE_COLOR)
1085 WebColorChooser* m_activeColorChooser;
1087 RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
1088 RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
1089 #if ENABLE(TIZEN_MEDIA_STREAM)
1090 RefPtr<UserMediaPermissionRequestManager> m_userMediaPermissionRequestManager;
1093 #if ENABLE(GEOLOCATION)
1094 GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
1097 OwnPtr<WebCore::PrintContext> m_printContext;
1099 RefPtr<WebPrintOperationGtk> m_printOperation;
1102 SandboxExtensionTracker m_sandboxExtensionTracker;
1105 RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
1106 Vector<RefPtr<SandboxExtension> > m_pendingDropExtensionsForFileUpload;
1108 bool m_canRunBeforeUnloadConfirmPanel;
1111 bool m_isRunningModal;
1113 bool m_cachedMainFrameIsPinnedToLeftSide;
1114 bool m_cachedMainFrameIsPinnedToRightSide;
1115 bool m_canShortCircuitHorizontalWheelEvents;
1116 unsigned m_numWheelEventHandlers;
1118 unsigned m_cachedPageCount;
1120 #if ENABLE(CONTEXT_MENUS)
1121 bool m_isShowingContextMenu;
1124 bool m_willGoToBackForwardItemCallbackEnabled;
1127 bool m_gestureReachedScrollingLimit;
1131 HashMap<String, QtNetworkReply*> m_applicationSchemeReplies;
1133 #if ENABLE(PAGE_VISIBILITY_API)
1134 WebCore::PageVisibilityState m_visibilityState;
1136 #if ENABLE(TIZEN_SYNC_REQUEST_ANIMATION_FRAME)
1137 bool m_suspendedAnimationController;
1140 WebInspectorClient* m_inspectorClient;
1142 #if ENABLE(TIZEN_SCREEN_READER)
1143 OwnPtr<ScreenReader> m_screenReader;
1146 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
1147 EditorState m_editorState;
1151 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
1152 void dumpMemorySnapshot();
1155 } // namespace WebKit