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 "InjectedBundlePageEditorClient.h"
39 #include "InjectedBundlePageFormClient.h"
40 #include "InjectedBundlePageFullScreenClient.h"
41 #include "InjectedBundlePageLoaderClient.h"
42 #include "InjectedBundlePagePolicyClient.h"
43 #include "InjectedBundlePageResourceLoadClient.h"
44 #include "InjectedBundlePageUIClient.h"
45 #include "MessageSender.h"
46 #include "TapHighlightController.h"
48 #include "SandboxExtension.h"
49 #include "ShareableBitmap.h"
50 #include "WebHitTestResult.h"
51 #include "WebUndoStep.h"
52 #include <WebCore/DragData.h>
53 #include <WebCore/Editor.h>
54 #include <WebCore/FrameLoaderTypes.h>
55 #include <WebCore/IntRect.h>
56 #if ENABLE(PAGE_VISIBILITY_API)
57 #include <WebCore/PageVisibilityState.h>
59 #include <WebCore/PlatformScreen.h>
60 #include <WebCore/ScrollTypes.h>
61 #include <WebCore/WebCoreKeyboardUIMode.h>
62 #include <wtf/HashMap.h>
63 #include <wtf/OwnPtr.h>
64 #include <wtf/PassRefPtr.h>
65 #include <wtf/RefPtr.h>
66 #include <wtf/text/WTFString.h>
69 #include "ArgumentCodersQt.h"
70 #include "QtNetworkAccessManager.h"
71 #include "QtNetworkReply.h"
72 #include "QtNetworkReplyData.h"
73 #include "QtNetworkRequestData.h"
74 #include <QNetworkReply>
75 #include <QNetworkRequest>
79 #include "ArgumentCodersGtk.h"
80 #include "WebPageAccessibilityObject.h"
81 #include "WebPrintOperationGtk.h"
84 #if ENABLE(TOUCH_EVENTS)
85 #include <WebCore/PlatformTouchEvent.h>
89 #include "DictionaryPopupInfo.h"
90 #include "LayerHostingContext.h"
91 #include <wtf/RetainPtr.h>
92 OBJC_CLASS NSDictionary;
94 OBJC_CLASS WKAccessibilityWebPageObject;
97 #if ENABLE(TIZEN_PAGE_VISIBILITY_API)
98 #include <WebCore/PageVisibilityState.h>
101 #if ENABLE(TIZEN_CUSTOM_HEADERS)
102 #include <WebCore/HTTPHeaderMap.h>
106 class ArgumentDecoder;
112 class GraphicsContext;
115 class HTMLPlugInElement;
120 class ResourceRequest;
122 class VisibleSelection;
123 struct KeypressCommand;
129 class InjectedBundleBackForwardList;
130 class NotificationPermissionRequestManager;
134 class WebColorChooser;
135 class WebContextMenu;
136 class WebContextMenuItemData;
139 class WebFullScreenManager;
142 class WebKeyboardEvent;
144 class WebNotificationClient;
145 class WebOpenPanelResultListener;
146 class WebPageGroupProxy;
149 struct AttributedString;
152 struct WebPageCreationParameters;
153 struct WebPreferencesStore;
155 #if ENABLE(GESTURE_EVENTS)
156 class WebGestureEvent;
159 #if ENABLE(TOUCH_EVENTS)
163 #if ENABLE(TIZEN_MEDIA_STREAM)
164 class UserMediaPermissionRequestManager;
165 class WebUserMediaClient;
168 #if ENABLE(TIZEN_ISF_PORT)
169 class NativeWebKeyboardEvent;
172 class WebPage : public APIObject, public CoreIPC::MessageSender<WebPage> {
174 static const Type APIType = TypeBundlePage;
176 static PassRefPtr<WebPage> create(uint64_t pageID, const WebPageCreationParameters&);
179 // Used by MessageSender.
180 CoreIPC::Connection* connection() const;
181 uint64_t destinationID() const { return pageID(); }
185 WebCore::Page* corePage() const { return m_page.get(); }
186 uint64_t pageID() const { return m_pageID; }
188 void setSize(const WebCore::IntSize&);
189 const WebCore::IntSize& size() const { return m_viewSize; }
190 WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
192 InjectedBundleBackForwardList* backForwardList();
193 DrawingArea* drawingArea() const { return m_drawingArea.get(); }
195 WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
197 void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
199 void scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
201 void centerSelectionInVisibleArea();
204 void confirmComposition(const String& compositionString);
205 void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
206 #if ENABLE(TIZEN_TEXT_CARET_HANDLING_WK2)
207 bool setCaretPosition(const WebCore::IntPoint&);
208 void getCaretPosition(WebCore::IntRect&);
210 #if ENABLE(TIZEN_ISF_PORT)
211 void getCursorOffsetPosition(int& offset);
212 void getContentOfPosition(String& content);
213 void deleteSurroundingPosition(bool& result);
214 void handleInputMethodForFocusedNode();
216 void scrollMainFrameBy(const WebCore::IntSize&);
217 void scrollMainFrameTo(const WebCore::IntPoint&);
218 void createSnapshot(const WebCore::IntRect, float, ShareableBitmap::Handle&);
219 void requestUpdateFormNavigation();
220 void moveFocus(int newIndex);
221 #if ENABLE(TIZEN_MOBILE_WEB_PRINT)
222 void createPagesToPDF(const WebCore::IntSize&, const String&);
224 #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
225 void hitTestResultAtPoint(const WebCore::IntPoint&, int hitTestMode, WebHitTestResult::Data&);
228 #if ENABLE(TIZEN_SUPPORT_RSS_LINK_PARSING)
229 void getRssItems(uint64_t callbackID);
232 #if ENABLE(TIZEN_WEB_STORAGE)
233 void getStorageQuotaBytes(uint64_t callbackID);
234 void setStorageQuotaBytes(uint32_t quota);
237 #if ENABLE(TIZEN_WEBKIT2_THEME_SET)
238 void setThemePath(const String& path);
241 #if ENABLE(TIZEN_WEBKIT_PASTEBOARD)
242 void setDataToPasteboardWithType(const String&, uint64_t type);
244 void suspendJavaScriptAndResources();
245 void resumeJavaScriptAndResources();
246 #if ENABLE(TIZEN_NPAPI)
247 void suspendPlugin();
251 #if ENABLE(TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR)
252 void startInspectorServer(uint32_t port, uint32_t& assignedPort);
253 void stopInspectorServer(bool& result);
255 #if ENABLE(TIZEN_ORIENTATION_EVENTS)
256 void sendOrientationChangeEvent(int orientation);
259 #if ENABLE(INSPECTOR)
260 WebInspector* inspector();
263 #if ENABLE(FULLSCREEN_API)
264 WebFullScreenManager* fullScreenManager();
267 // -- Called by the DrawingArea.
268 // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
269 void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
270 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
271 void selectClosestWord(uint64_t frameID, const WebCore::IntPoint&, bool isStartedTextSelectionFromOutside, bool& result);
272 void setLeftSelection(uint64_t frameID, const WebCore::IntPoint&, bool& result);
273 void setRightSelection(uint64_t frameID, const WebCore::IntPoint&, bool& result);
274 void getSelectionHandlers(uint64_t frameID, bool& result, WebCore::IntRect& leftRect, WebCore::IntRect& rightRect);
275 void getSelectionText(uint64_t frameID, String& result);
276 void selectionRangeClear(uint64_t frameID, bool& result);
279 void drawPageOverlay(WebCore::GraphicsContext&, const WebCore::IntRect&);
280 void layoutIfNeeded();
281 #if ENABLE(TIZEN_RECORDING_SURFACE_SET)
282 void recordingSurfaceSetEnableSet(bool enable);
283 void recordingSurfaceSetEnableURL(const String&);
286 // -- Called from WebCore clients.
288 bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*, bool saveCommands);
290 bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
294 String userAgent() const { return m_userAgent; }
295 WebCore::IntRect windowResizerRect() const;
296 WebCore::KeyboardUIMode keyboardUIMode();
298 WebUndoStep* webUndoStep(uint64_t);
299 void addWebUndoStep(uint64_t, WebUndoStep*);
300 void removeWebEditCommand(uint64_t);
301 bool isInRedo() const { return m_isInRedo; }
303 void setActivePopupMenu(WebPopupMenu*);
305 #if ENABLE(INPUT_TYPE_COLOR)
306 WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
307 void setActiveColorChooser(WebColorChooser*);
308 void didChooseColor(const WebCore::Color&);
309 void didEndColorChooser();
312 WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
313 void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>);
315 // -- Called from WebProcess.
316 void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
317 void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
319 // -- InjectedBundle methods
320 #if ENABLE(CONTEXT_MENUS)
321 void initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClient*);
323 void initializeInjectedBundleEditorClient(WKBundlePageEditorClient*);
324 void initializeInjectedBundleFormClient(WKBundlePageFormClient*);
325 void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClient*);
326 void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClient*);
327 void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClient*);
328 void initializeInjectedBundleUIClient(WKBundlePageUIClient*);
329 #if ENABLE(FULLSCREEN_API)
330 void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClient*);
333 #if ENABLE(CONTEXT_MENUS)
334 InjectedBundlePageContextMenuClient& injectedBundleContextMenuClient() { return m_contextMenuClient; }
336 InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; }
337 InjectedBundlePageFormClient& injectedBundleFormClient() { return m_formClient; }
338 InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; }
339 InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
340 InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
341 InjectedBundlePageUIClient& injectedBundleUIClient() { return m_uiClient; }
342 #if ENABLE(FULLSCREEN_API)
343 InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
346 void setUnderlayPage(PassRefPtr<WebPage> underlayPage) { m_underlayPage = underlayPage; }
348 bool findStringFromInjectedBundle(const String&, FindOptions);
350 WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
352 WebCore::Frame* mainFrame() const; // May return 0.
353 WebCore::FrameView* mainFrameView() const; // May return 0.
355 PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&);
357 EditorState editorState() const;
359 String renderTreeExternalRepresentation() const;
360 uint64_t renderTreeSize() const;
361 void setPaintedObjectsCounterThreshold(uint64_t);
363 void setTracksRepaints(bool);
364 bool isTrackingRepaints() const;
365 void resetTrackedRepaints();
366 PassRefPtr<ImmutableArray> trackedRepaintRects();
368 void executeEditingCommand(const String& commandName, const String& argument);
369 bool isEditingCommandEnabled(const String& commandName);
370 void clearMainFrameName();
373 double textZoomFactor() const;
374 void setTextZoomFactor(double);
375 double pageZoomFactor() const;
376 void setPageZoomFactor(double);
377 void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
378 void windowScreenDidChange(uint64_t);
380 void scalePage(double scale, const WebCore::IntPoint& origin);
381 double pageScaleFactor() const;
383 void setUseFixedLayout(bool);
384 bool useFixedLayout() const { return m_useFixedLayout; }
385 void setFixedLayoutSize(const WebCore::IntSize&);
387 void setPaginationMode(uint32_t /* WebCore::Page::Pagination::Mode */);
388 void setPaginationBehavesLikeColumns(bool);
389 void setPageLength(double);
390 void setGapBetweenPages(double);
392 bool drawsBackground() const { return m_drawsBackground; }
393 bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
396 void stopLoadingFrame(uint64_t frameID);
397 void setDefersLoading(bool deferLoading);
399 #if USE(ACCELERATED_COMPOSITING)
400 void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
401 void exitAcceleratedCompositingMode();
404 void addPluginView(PluginView*);
405 void removePluginView(PluginView*);
408 LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
409 void setLayerHostingMode(LayerHostingMode);
411 bool windowIsVisible() const { return m_windowIsVisible; }
412 void updatePluginsActiveAndFocusedState();
413 const WebCore::IntRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
414 const WebCore::IntRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
416 HWND nativeWindow() const { return m_nativeWindow; }
419 bool windowIsFocused() const;
420 bool windowAndWebPageAreFocused() const;
421 void installPageOverlay(PassRefPtr<PageOverlay>);
422 void uninstallPageOverlay(PageOverlay*, bool fadeOut);
423 bool hasPageOverlay() const { return m_pageOverlay; }
424 WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
425 WebCore::IntRect windowToScreen(const WebCore::IntRect&);
427 PassRefPtr<WebImage> snapshotInViewCoordinates(const WebCore::IntRect&, ImageOptions);
428 PassRefPtr<WebImage> scaledSnapshotInViewCoordinates(const WebCore::IntRect&, double scaleFactor, ImageOptions);
429 PassRefPtr<WebImage> snapshotInDocumentCoordinates(const WebCore::IntRect&, ImageOptions);
430 PassRefPtr<WebImage> scaledSnapshotInDocumentCoordinates(const WebCore::IntRect&, double scaleFactor, ImageOptions);
432 static const WebEvent* currentEvent();
434 FindController& findController() { return m_findController; }
435 #if ENABLE(TOUCH_EVENTS) && PLATFORM(QT)
436 TapHighlightController& tapHighlightController() { return m_tapHighlightController; }
439 #if ENABLE(GEOLOCATION)
440 GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager; }
443 NotificationPermissionRequestManager* notificationPermissionRequestManager();
444 #if ENABLE(TIZEN_MEDIA_STREAM)
445 UserMediaPermissionRequestManager* userMediaPermissionRequestManager();
447 void pageDidScroll();
448 #if USE(TILED_BACKING_STORE)
449 void pageDidRequestScroll(const WebCore::IntPoint&);
450 void setFixedVisibleContentRect(const WebCore::IntRect&);
451 void setResizesToContentsUsingLayoutSize(const WebCore::IntSize&);
452 void resizeToContentsIfNeeded();
453 void sendViewportAttributesChanged();
454 void setViewportSize(const WebCore::IntSize&);
455 WebCore::IntSize viewportSize() const { return m_viewportSize; }
457 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
458 WebCore::IntSize contentsSize() const;
463 #if ENABLE(CONTEXT_MENUS)
464 WebContextMenu* contextMenu();
467 bool hasLocalDataForURL(const WebCore::KURL&);
468 String cachedResponseMIMETypeForURL(const WebCore::KURL&);
469 String cachedSuggestedFilenameForURL(const WebCore::KURL&);
470 PassRefPtr<WebCore::SharedBuffer> cachedResponseDataForURL(const WebCore::KURL&);
472 static bool canHandleRequest(const WebCore::ResourceRequest&);
474 class SandboxExtensionTracker {
476 ~SandboxExtensionTracker();
480 void beginLoad(WebFrame*, const SandboxExtension::Handle& handle);
481 void willPerformLoadDragDestinationAction(PassRefPtr<SandboxExtension> pendingDropSandboxExtension);
482 void didStartProvisionalLoad(WebFrame*);
483 void didCommitProvisionalLoad(WebFrame*);
484 void didFailProvisionalLoad(WebFrame*);
487 void setPendingProvisionalSandboxExtension(PassRefPtr<SandboxExtension>);
489 RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
490 RefPtr<SandboxExtension> m_provisionalSandboxExtension;
491 RefPtr<SandboxExtension> m_committedSandboxExtension;
494 SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
497 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
498 void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
499 void cancelComposition();
503 void registerUIProcessAccessibilityTokens(const CoreIPC::DataReference& elemenToken, const CoreIPC::DataReference& windowToken);
504 WKAccessibilityWebPageObject* accessibilityRemoteObject();
505 WebCore::IntPoint accessibilityPosition() const { return m_accessibilityPosition; }
507 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
509 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, EditorState& newState);
510 void confirmComposition(EditorState& newState);
511 void cancelComposition(EditorState& newState);
512 void insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, bool& handled, EditorState& newState);
513 void getMarkedRange(uint64_t& location, uint64_t& length);
514 void getSelectedRange(uint64_t& location, uint64_t& length);
515 void getAttributedSubstringFromRange(uint64_t location, uint64_t length, AttributedString&);
516 void characterIndexForPoint(const WebCore::IntPoint point, uint64_t& result);
517 void firstRectForCharacterRange(uint64_t location, uint64_t length, WebCore::IntRect& resultRect);
518 void executeKeypressCommands(const Vector<WebCore::KeypressCommand>&, bool& handled, EditorState& newState);
519 void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
520 void getStringSelectionForPasteboard(WTF::String& stringValue);
521 void getDataSelectionForPasteboard(const WTF::String pasteboardType, SharedMemory::Handle& handle, uint64_t& size);
522 void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
523 void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
524 bool performNonEditingBehaviorForSelector(const String&);
527 void confirmComposition(const String& compositionString);
528 void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
529 void firstRectForCharacterInSelectedRange(const uint64_t characterPosition, WebCore::IntRect& resultRect);
530 void getSelectedText(WTF::String&);
532 void gestureWillBegin(const WebCore::IntPoint&, bool& canBeginPanning);
533 void gestureDidScroll(const WebCore::IntSize&);
534 void gestureDidEnd();
537 void updateAccessibilityTree();
540 void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
541 bool hasCompositionForTesting();
542 void confirmCompositionForTesting(const String& compositionString);
544 #if ENABLE(TIZEN_GEOLOCATION)
545 int numberOfPendingGeolocationPermissionRequests();
547 // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
548 // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
552 void performDictionaryLookupForSelection(DictionaryPopupInfo::Type, WebCore::Frame*, const WebCore::VisibleSelection&);
555 void speak(const String&);
558 bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
561 void replaceSelectionWithText(WebCore::Frame*, const String&);
562 void clearSelection();
564 #if ENABLE(DRAG_SUPPORT)
566 void performDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, const WebCore::DragDataMap&, uint32_t flags);
567 #elif PLATFORM(QT) || PLATFORM(GTK)
568 void performDragControllerAction(uint64_t action, WebCore::DragData);
570 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&);
572 void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
574 void willPerformLoadDragDestinationAction();
575 void mayPerformUploadDragDestinationAction();
576 #endif // ENABLE(DRAG_SUPPORT)
578 void beginPrinting(uint64_t frameID, const PrintInfo&);
580 void computePagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
581 #if PLATFORM(MAC) || PLATFORM(WIN)
582 void drawRectToPDF(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, uint64_t callbackID);
583 void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, uint64_t callbackID);
585 void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
588 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
589 void getWebAppCapable(uint64_t callbackID);
590 void getWebAppIconURL(uint64_t callbackID);
593 void setMediaVolume(float);
595 bool mainFrameHasCustomRepresentation() const;
597 void didChangeScrollOffsetForMainFrame();
599 void mainFrameDidLayout();
601 bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
602 void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
604 bool canRunModal() const { return m_canRunModal; }
605 void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
609 void setDeviceScaleFactor(float);
610 float deviceScaleFactor() const;
612 void setMemoryCacheMessagesEnabled(bool);
614 void forceRepaintWithoutCallback();
616 void unmarkAllMisspellings();
617 void unmarkAllBadGrammar();
619 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD)
620 void handleAlternativeTextUIResult(const String&);
623 // For testing purpose.
624 void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
625 void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
626 void simulateMouseMotion(WebCore::IntPoint, double time);
627 String viewportConfigurationAsText(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight);
629 #if ENABLE(CONTEXT_MENUS)
630 void contextMenuShowing() { m_isShowingContextMenu = true; }
634 void registerApplicationScheme(const String& scheme);
635 void applicationSchemeReply(const QtNetworkReplyData&);
636 void receivedApplicationSchemeRequest(const QNetworkRequest&, QtNetworkReply*);
637 void setUserScripts(const Vector<String>&);
639 void wheelEvent(const WebWheelEvent&);
640 #if ENABLE(GESTURE_EVENTS)
641 void gestureEvent(const WebGestureEvent&);
644 void numWheelEventHandlersChanged(unsigned);
645 void recomputeShortCircuitHorizontalWheelEventsState();
647 bool willGoToBackForwardItemCallbackEnabled() const { return m_willGoToBackForwardItemCallbackEnabled; }
649 #if ENABLE(PAGE_VISIBILITY_API)
650 void setVisibilityState(int visibilityState, bool isInitialState);
653 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
654 void setFocusedInputElementValue(const String& inputValue);
655 void getFocusedInputElementValue(String& inputValue);
658 #if ENABLE(TIZEN_READER)
659 void checkPageForReader(uint64_t callbackID);
662 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL)
663 void scrollOverflow(const WebCore::FloatPoint&, bool& scrolled);
664 void setPressedNodeAtPoint(const WebCore::IntPoint&, bool& pressed);
666 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE)
667 void scrollOverflowWithTrajectoryVector(const WebCore::FloatPoint&);
669 #if ENABLE(TIZEN_CUSTOM_HEADERS)
670 void addCustomHeader(const String& name, const String& value);
671 WebCore::HTTPHeaderMap customHeaders();
675 #if ENABLE(TIZEN_FIX_PLUGIN_DOWNLOAD)
676 void arePluginsEnabled(bool&);
677 #endif // ENABLE(TIZEN_FIX_PLUGIN_DOWNLOAD)
679 #if ENABLE(TIZEN_WEBKIT2_GET_TEXT_STYLE_FOR_SELECTION)
680 void getTextStyleStateForSelection();
683 #if ENABLE(TIZEN_RECORDING_SURFACE_SET)
684 bool m_recordingSurfaceSetEnable;
685 bool m_recordingSurfaceSetLoadStart;
686 bool m_recordingSurfaceSetLoadFinished;
687 bool m_recordingSurfaceSetSettings;
691 WebPage(uint64_t pageID, const WebPageCreationParameters&);
693 virtual Type type() const { return APIType; }
695 void platformInitialize();
697 void didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
698 void didReceiveSyncWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
701 static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
703 bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
706 bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
709 String sourceForFrame(WebFrame*);
711 void loadData(PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::KURL& baseURL, const WebCore::KURL& failingURL);
713 bool platformHasLocalDataForURL(const WebCore::KURL&);
717 void loadURL(const String&, const SandboxExtension::Handle&);
718 void loadURLRequest(const WebCore::ResourceRequest&, const SandboxExtension::Handle&);
719 void loadHTMLString(const String& htmlString, const String& baseURL);
720 void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL);
721 void loadPlainTextString(const String&);
722 void loadWebArchiveData(const CoreIPC::DataReference&);
724 void loadContentsbyMimeType(const CoreIPC::DataReference&, const String& mimeType, const String& encoding, const String& baseURL);
726 void linkClicked(const String& url, const WebMouseEvent&);
727 void reload(bool reloadFromOrigin, const SandboxExtension::Handle&);
728 void goForward(uint64_t);
729 void goBack(uint64_t);
730 void goToBackForwardItem(uint64_t);
731 void tryRestoreScrollPosition();
732 void setActive(bool);
733 void setFocused(bool);
734 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&);
735 void setWindowResizerSize(const WebCore::IntSize&);
736 void setIsInWindow(bool);
737 void validateCommand(const String&, uint64_t);
738 void executeEditCommand(const String&);
740 void executeEditCommandWithArgument(const String& command, const String& argument);
743 void mouseEvent(const WebMouseEvent&);
744 void mouseEventSyncForTesting(const WebMouseEvent&, bool&);
745 void wheelEventSyncForTesting(const WebWheelEvent&, bool&);
746 #if ENABLE(TIZEN_ISF_PORT)
747 void keyEvent(const NativeWebKeyboardEvent&);
749 void keyEvent(const WebKeyboardEvent&);
751 void keyEventSyncForTesting(const WebKeyboardEvent&, bool&);
752 #if ENABLE(TOUCH_EVENTS)
753 void touchEvent(const WebTouchEvent&);
754 void touchEventSyncForTesting(const WebTouchEvent&, bool& handled);
756 void highlightPotentialActivation(const WebCore::IntPoint&, const WebCore::IntSize& area);
759 #if ENABLE(CONTEXT_MENUS)
760 void contextMenuHidden() { m_isShowingContextMenu = false; }
763 static void scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
764 static void logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
766 uint64_t restoreSession(const SessionState&);
767 void restoreSessionAndNavigateToCurrentItem(const SessionState&);
769 void didRemoveBackForwardItem(uint64_t);
771 void setWillGoToBackForwardItemCallbackEnabled(bool enabled) { m_willGoToBackForwardItemCallbackEnabled = enabled; }
773 void setDrawsBackground(bool);
774 void setDrawsTransparentBackground(bool);
776 void viewWillStartLiveResize();
777 void viewWillEndLiveResize();
779 void getContentsAsString(uint64_t callbackID);
780 void getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID);
781 void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, uint64_t callbackID);
782 void getRenderTreeExternalRepresentation(uint64_t callbackID);
783 void getSelectionOrContentsAsString(uint64_t callbackID);
784 void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
785 void getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID);
786 void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
787 void forceRepaint(uint64_t callbackID);
789 void preferencesDidChange(const WebPreferencesStore&);
790 void platformPreferencesDidChange(const WebPreferencesStore&);
791 void updatePreferences(const WebPreferencesStore&);
793 void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID);
794 void setUserAgent(const String&);
795 void setCustomTextEncodingName(const String&);
796 void suspendActiveDOMObjectsAndAnimations();
797 void resumeActiveDOMObjectsAndAnimations();
800 void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
801 void performDictionaryLookupForRange(DictionaryPopupInfo::Type, WebCore::Frame*, WebCore::Range*, NSDictionary *options);
803 void setWindowIsVisible(bool windowIsVisible);
804 void windowAndViewFramesChanged(const WebCore::IntRect& windowFrameInScreenCoordinates, const WebCore::IntRect& viewFrameInWindowCoordinates, const WebCore::IntPoint& accessibilityViewCoordinates);
806 RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
807 void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
808 void drawRectToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
809 void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
812 void unapplyEditCommand(uint64_t commandID);
813 void reapplyEditCommand(uint64_t commandID);
814 void didRemoveEditCommand(uint64_t commandID);
816 void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
818 void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
821 void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area);
824 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
825 void setTextForActivePopupMenu(int32_t index);
828 void failedToShowPopupMenu();
831 void didChooseFilesForOpenPanel(const Vector<String>&);
832 void didCancelForOpenPanel();
833 #if ENABLE(WEB_PROCESS_SANDBOX)
834 void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
837 void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
839 void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
840 #if ENABLE(TIZEN_MEDIA_STREAM)
841 void didReceiveUserMediaPermissionDecision(uint64_t userMediaID, bool allowed);
844 void advanceToNextMisspelling(bool startBeforeSelection);
845 void changeSpellingToWord(const String& word);
847 void uppercaseWord();
848 void lowercaseWord();
849 void capitalizeWord();
851 void setSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled) { m_isSmartInsertDeleteEnabled = isSmartInsertDeleteEnabled; }
854 #if ENABLE(CONTEXT_MENUS)
855 void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
858 void setCanStartMediaTimerFired();
860 static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
862 OwnPtr<WebCore::Page> m_page;
863 RefPtr<WebFrame> m_mainFrame;
864 RefPtr<InjectedBundleBackForwardList> m_backForwardList;
866 RefPtr<WebPageGroupProxy> m_pageGroup;
870 WebCore::IntSize m_viewSize;
871 OwnPtr<DrawingArea> m_drawingArea;
873 HashSet<PluginView*> m_pluginViews;
875 bool m_useFixedLayout;
877 bool m_drawsBackground;
878 bool m_drawsTransparentBackground;
884 #if ENABLE(TIZEN_CUSTOM_HEADERS)
885 WebCore::HTTPHeaderMap m_customHeaders;
889 // Whether the containing window is visible or not.
890 bool m_windowIsVisible;
892 // Whether smart insert/delete is enabled or not.
893 bool m_isSmartInsertDeleteEnabled;
895 // The frame of the containing window in screen coordinates.
896 WebCore::IntRect m_windowFrameInScreenCoordinates;
898 // The frame of the view in window coordinates.
899 WebCore::IntRect m_viewFrameInWindowCoordinates;
901 // The accessibility position of the view.
902 WebCore::IntPoint m_accessibilityPosition;
904 // The layer hosting mode.
905 LayerHostingMode m_layerHostingMode;
907 RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
909 WebCore::KeyboardEvent* m_keyboardEventBeingInterpreted;
912 // Our view's window (in the UI process).
915 RefPtr<WebCore::Node> m_gestureTargetNode;
917 WebPageAccessibilityObject* m_accessibilityObject;
920 WebCore::RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
922 HashMap<uint64_t, RefPtr<WebUndoStep> > m_undoStepMap;
924 WebCore::IntSize m_windowResizerSize;
926 #if ENABLE(CONTEXT_MENUS)
927 InjectedBundlePageContextMenuClient m_contextMenuClient;
929 InjectedBundlePageEditorClient m_editorClient;
930 InjectedBundlePageFormClient m_formClient;
931 InjectedBundlePageLoaderClient m_loaderClient;
932 InjectedBundlePagePolicyClient m_policyClient;
933 InjectedBundlePageResourceLoadClient m_resourceLoadClient;
934 InjectedBundlePageUIClient m_uiClient;
935 #if ENABLE(FULLSCREEN_API)
936 InjectedBundlePageFullScreenClient m_fullScreenClient;
939 #if USE(TILED_BACKING_STORE)
940 WebCore::IntSize m_viewportSize;
943 FindController m_findController;
944 #if ENABLE(TOUCH_EVENTS) && PLATFORM(QT)
945 TapHighlightController m_tapHighlightController;
947 RefPtr<PageOverlay> m_pageOverlay;
949 RefPtr<WebPage> m_underlayPage;
951 #if ENABLE(INSPECTOR)
952 RefPtr<WebInspector> m_inspector;
954 #if ENABLE(FULLSCREEN_API)
955 RefPtr<WebFullScreenManager> m_fullScreenManager;
957 RefPtr<WebPopupMenu> m_activePopupMenu;
958 #if ENABLE(CONTEXT_MENUS)
959 RefPtr<WebContextMenu> m_contextMenu;
961 #if ENABLE(INPUT_TYPE_COLOR)
962 WebColorChooser* m_activeColorChooser;
964 RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
965 RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
966 #if ENABLE(TIZEN_MEDIA_STREAM)
967 RefPtr<UserMediaPermissionRequestManager> m_userMediaPermissionRequestManager;
970 #if ENABLE(GEOLOCATION)
971 GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
974 OwnPtr<WebCore::PrintContext> m_printContext;
976 RefPtr<WebPrintOperationGtk> m_printOperation;
979 SandboxExtensionTracker m_sandboxExtensionTracker;
982 RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
983 Vector<RefPtr<SandboxExtension> > m_pendingDropExtensionsForFileUpload;
985 bool m_canRunBeforeUnloadConfirmPanel;
988 bool m_isRunningModal;
990 bool m_cachedMainFrameIsPinnedToLeftSide;
991 bool m_cachedMainFrameIsPinnedToRightSide;
992 bool m_canShortCircuitHorizontalWheelEvents;
993 unsigned m_numWheelEventHandlers;
995 unsigned m_cachedPageCount;
997 #if ENABLE(CONTEXT_MENUS)
998 bool m_isShowingContextMenu;
1001 bool m_willGoToBackForwardItemCallbackEnabled;
1004 bool m_gestureReachedScrollingLimit;
1007 HashMap<String, QtNetworkReply*> m_applicationSchemeReplies;
1009 #if ENABLE(PAGE_VISIBILITY_API)
1010 WebCore::PageVisibilityState m_visibilityState;
1014 } // namespace WebKit