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>
105 #if ENABLE(TIZEN_DATALIST_ELEMENT)
106 #include "HTMLDataListElement.h"
110 class ArgumentDecoder;
116 class GraphicsContext;
119 class HTMLPlugInElement;
124 class ResourceRequest;
126 class VisibleSelection;
127 struct KeypressCommand;
129 #if ENABLE(TIZEN_DATALIST_ELEMENT)
130 class HTMLDataListElement;
137 class InjectedBundleBackForwardList;
138 class NotificationPermissionRequestManager;
142 class WebColorChooser;
143 class WebContextMenu;
144 class WebContextMenuItemData;
147 class WebFullScreenManager;
150 class WebKeyboardEvent;
152 class WebNotificationClient;
153 class WebOpenPanelResultListener;
154 class WebPageGroupProxy;
157 struct AttributedString;
160 struct WebPageCreationParameters;
161 struct WebPreferencesStore;
163 #if ENABLE(GESTURE_EVENTS)
164 class WebGestureEvent;
167 #if ENABLE(TOUCH_EVENTS)
171 #if ENABLE(TIZEN_MEDIA_STREAM)
172 class UserMediaPermissionRequestManager;
173 class WebUserMediaClient;
176 #if ENABLE(TIZEN_ISF_PORT)
177 class NativeWebKeyboardEvent;
180 class WebPage : public APIObject, public CoreIPC::MessageSender<WebPage> {
182 static const Type APIType = TypeBundlePage;
184 static PassRefPtr<WebPage> create(uint64_t pageID, const WebPageCreationParameters&);
187 // Used by MessageSender.
188 CoreIPC::Connection* connection() const;
189 uint64_t destinationID() const { return pageID(); }
193 WebCore::Page* corePage() const { return m_page.get(); }
194 uint64_t pageID() const { return m_pageID; }
196 void setSize(const WebCore::IntSize&);
197 const WebCore::IntSize& size() const { return m_viewSize; }
198 WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
200 InjectedBundleBackForwardList* backForwardList();
201 DrawingArea* drawingArea() const { return m_drawingArea.get(); }
203 WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
205 void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
207 void scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
209 void centerSelectionInVisibleArea();
212 void confirmComposition(const String& compositionString);
213 void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
214 #if ENABLE(TIZEN_TEXT_CARET_HANDLING_WK2)
215 bool setCaretPosition(const WebCore::IntPoint&);
216 void getCaretPosition(WebCore::IntRect&);
218 #if ENABLE(TIZEN_ISF_PORT)
219 void getCursorOffsetPosition(int& offset);
220 void getContentOfPosition(String& content);
221 void deleteSurroundingPosition(bool& result);
223 void scrollMainFrameBy(const WebCore::IntSize&);
224 void scrollMainFrameTo(const WebCore::IntPoint&);
225 void createSnapshot(const WebCore::IntRect, float, ShareableBitmap::Handle&);
226 void requestUpdateFormNavigation();
227 void moveFocus(int newIndex);
228 #if ENABLE(TIZEN_MOBILE_WEB_PRINT)
229 void createPagesToPDF(const WebCore::IntSize&, const String&);
231 #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
232 void hitTestResultAtPoint(const WebCore::IntPoint&, int hitTestMode, WebHitTestResult::Data&);
235 #if ENABLE(TIZEN_SUPPORT_RSS_LINK_PARSING)
236 void getRssItems(uint64_t callbackID);
239 #if ENABLE(TIZEN_WEB_STORAGE)
240 void getStorageQuotaBytes(uint64_t callbackID);
241 void setStorageQuotaBytes(uint32_t quota);
244 #if ENABLE(TIZEN_WEBKIT2_THEME_SET)
245 void setThemePath(const String& path);
248 #if ENABLE(TIZEN_WEBKIT_PASTEBOARD)
249 void setDataToPasteboardWithType(const String&, uint64_t type);
251 void suspendJavaScriptAndResources();
252 void resumeJavaScriptAndResources();
253 #if ENABLE(TIZEN_NPAPI)
254 void suspendPlugin();
258 #if ENABLE(TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR)
259 void startInspectorServer(uint32_t port, uint32_t& assignedPort);
260 void stopInspectorServer(bool& result);
262 #if ENABLE(TIZEN_ORIENTATION_EVENTS)
263 void sendOrientationChangeEvent(int orientation);
266 #if ENABLE(INSPECTOR)
267 WebInspector* inspector();
270 #if ENABLE(FULLSCREEN_API)
271 WebFullScreenManager* fullScreenManager();
274 // -- Called by the DrawingArea.
275 // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
276 void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
277 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
278 void selectClosestWord(uint64_t frameID, const WebCore::IntPoint&, bool isStartedTextSelectionFromOutside, bool& result);
279 void setLeftSelection(uint64_t frameID, const WebCore::IntPoint&, bool& result);
280 void setRightSelection(uint64_t frameID, const WebCore::IntPoint&, bool& result);
281 void getSelectionHandlers(uint64_t frameID, bool& result, WebCore::IntRect& leftRect, WebCore::IntRect& rightRect);
282 void getSelectionText(uint64_t frameID, String& result);
283 void selectionRangeClear(uint64_t frameID, bool& result);
286 void drawPageOverlay(WebCore::GraphicsContext&, const WebCore::IntRect&);
287 void layoutIfNeeded();
288 #if ENABLE(TIZEN_RECORDING_SURFACE_SET)
289 void recordingSurfaceSetEnableSet(bool enable);
290 void recordingSurfaceSetEnableURL(const String&);
293 // -- Called from WebCore clients.
295 bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*, bool saveCommands);
297 bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
301 String userAgent() const { return m_userAgent; }
302 WebCore::IntRect windowResizerRect() const;
303 WebCore::KeyboardUIMode keyboardUIMode();
305 WebUndoStep* webUndoStep(uint64_t);
306 void addWebUndoStep(uint64_t, WebUndoStep*);
307 void removeWebEditCommand(uint64_t);
308 bool isInRedo() const { return m_isInRedo; }
310 void setActivePopupMenu(WebPopupMenu*);
312 #if ENABLE(INPUT_TYPE_COLOR)
313 WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
314 void setActiveColorChooser(WebColorChooser*);
315 void didChooseColor(const WebCore::Color&);
316 void didEndColorChooser();
319 WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
320 void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>);
322 // -- Called from WebProcess.
323 void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
324 void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
326 // -- InjectedBundle methods
327 #if ENABLE(CONTEXT_MENUS)
328 void initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClient*);
330 void initializeInjectedBundleEditorClient(WKBundlePageEditorClient*);
331 void initializeInjectedBundleFormClient(WKBundlePageFormClient*);
332 void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClient*);
333 void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClient*);
334 void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClient*);
335 void initializeInjectedBundleUIClient(WKBundlePageUIClient*);
336 #if ENABLE(FULLSCREEN_API)
337 void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClient*);
340 #if ENABLE(CONTEXT_MENUS)
341 InjectedBundlePageContextMenuClient& injectedBundleContextMenuClient() { return m_contextMenuClient; }
343 InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; }
344 InjectedBundlePageFormClient& injectedBundleFormClient() { return m_formClient; }
345 InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; }
346 InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
347 InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
348 InjectedBundlePageUIClient& injectedBundleUIClient() { return m_uiClient; }
349 #if ENABLE(FULLSCREEN_API)
350 InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
353 void setUnderlayPage(PassRefPtr<WebPage> underlayPage) { m_underlayPage = underlayPage; }
355 bool findStringFromInjectedBundle(const String&, FindOptions);
357 WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
359 WebCore::Frame* mainFrame() const; // May return 0.
360 WebCore::FrameView* mainFrameView() const; // May return 0.
362 PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&);
364 EditorState editorState() const;
366 String renderTreeExternalRepresentation() const;
367 uint64_t renderTreeSize() const;
368 void setPaintedObjectsCounterThreshold(uint64_t);
370 void setTracksRepaints(bool);
371 bool isTrackingRepaints() const;
372 void resetTrackedRepaints();
373 PassRefPtr<ImmutableArray> trackedRepaintRects();
375 void executeEditingCommand(const String& commandName, const String& argument);
376 bool isEditingCommandEnabled(const String& commandName);
377 void clearMainFrameName();
380 double textZoomFactor() const;
381 void setTextZoomFactor(double);
382 double pageZoomFactor() const;
383 void setPageZoomFactor(double);
384 void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
385 void windowScreenDidChange(uint64_t);
387 void scalePage(double scale, const WebCore::IntPoint& origin);
388 double pageScaleFactor() const;
390 void setUseFixedLayout(bool);
391 bool useFixedLayout() const { return m_useFixedLayout; }
392 void setFixedLayoutSize(const WebCore::IntSize&);
394 void setPaginationMode(uint32_t /* WebCore::Page::Pagination::Mode */);
395 void setPaginationBehavesLikeColumns(bool);
396 void setPageLength(double);
397 void setGapBetweenPages(double);
399 bool drawsBackground() const { return m_drawsBackground; }
400 bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
403 void stopLoadingFrame(uint64_t frameID);
404 void setDefersLoading(bool deferLoading);
406 #if USE(ACCELERATED_COMPOSITING)
407 void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
408 void exitAcceleratedCompositingMode();
411 void addPluginView(PluginView*);
412 void removePluginView(PluginView*);
415 LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
416 void setLayerHostingMode(LayerHostingMode);
418 bool windowIsVisible() const { return m_windowIsVisible; }
419 void updatePluginsActiveAndFocusedState();
420 const WebCore::IntRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
421 const WebCore::IntRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
423 HWND nativeWindow() const { return m_nativeWindow; }
426 bool windowIsFocused() const;
427 bool windowAndWebPageAreFocused() const;
428 void installPageOverlay(PassRefPtr<PageOverlay>);
429 void uninstallPageOverlay(PageOverlay*, bool fadeOut);
430 bool hasPageOverlay() const { return m_pageOverlay; }
431 WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
432 WebCore::IntRect windowToScreen(const WebCore::IntRect&);
434 PassRefPtr<WebImage> snapshotInViewCoordinates(const WebCore::IntRect&, ImageOptions);
435 PassRefPtr<WebImage> scaledSnapshotInViewCoordinates(const WebCore::IntRect&, double scaleFactor, ImageOptions);
436 PassRefPtr<WebImage> snapshotInDocumentCoordinates(const WebCore::IntRect&, ImageOptions);
437 PassRefPtr<WebImage> scaledSnapshotInDocumentCoordinates(const WebCore::IntRect&, double scaleFactor, ImageOptions);
439 static const WebEvent* currentEvent();
441 FindController& findController() { return m_findController; }
442 #if ENABLE(TOUCH_EVENTS) && PLATFORM(QT)
443 TapHighlightController& tapHighlightController() { return m_tapHighlightController; }
446 #if ENABLE(GEOLOCATION)
447 GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager; }
450 NotificationPermissionRequestManager* notificationPermissionRequestManager();
451 #if ENABLE(TIZEN_MEDIA_STREAM)
452 UserMediaPermissionRequestManager* userMediaPermissionRequestManager();
454 void pageDidScroll();
455 #if USE(TILED_BACKING_STORE)
456 void pageDidRequestScroll(const WebCore::IntPoint&);
457 void setFixedVisibleContentRect(const WebCore::IntRect&);
458 void setResizesToContentsUsingLayoutSize(const WebCore::IntSize&);
459 void resizeToContentsIfNeeded();
460 void sendViewportAttributesChanged();
461 void setViewportSize(const WebCore::IntSize&);
462 WebCore::IntSize viewportSize() const { return m_viewportSize; }
464 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
465 WebCore::IntSize contentsSize() const;
470 #if ENABLE(CONTEXT_MENUS)
471 WebContextMenu* contextMenu();
474 bool hasLocalDataForURL(const WebCore::KURL&);
475 String cachedResponseMIMETypeForURL(const WebCore::KURL&);
476 String cachedSuggestedFilenameForURL(const WebCore::KURL&);
477 PassRefPtr<WebCore::SharedBuffer> cachedResponseDataForURL(const WebCore::KURL&);
479 static bool canHandleRequest(const WebCore::ResourceRequest&);
481 class SandboxExtensionTracker {
483 ~SandboxExtensionTracker();
487 void beginLoad(WebFrame*, const SandboxExtension::Handle& handle);
488 void willPerformLoadDragDestinationAction(PassRefPtr<SandboxExtension> pendingDropSandboxExtension);
489 void didStartProvisionalLoad(WebFrame*);
490 void didCommitProvisionalLoad(WebFrame*);
491 void didFailProvisionalLoad(WebFrame*);
494 void setPendingProvisionalSandboxExtension(PassRefPtr<SandboxExtension>);
496 RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
497 RefPtr<SandboxExtension> m_provisionalSandboxExtension;
498 RefPtr<SandboxExtension> m_committedSandboxExtension;
501 SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
504 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
505 void confirmComposition(const String& text, int64_t selectionStart, int64_t selectionLength);
506 void cancelComposition();
510 void registerUIProcessAccessibilityTokens(const CoreIPC::DataReference& elemenToken, const CoreIPC::DataReference& windowToken);
511 WKAccessibilityWebPageObject* accessibilityRemoteObject();
512 WebCore::IntPoint accessibilityPosition() const { return m_accessibilityPosition; }
514 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
516 void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, EditorState& newState);
517 void confirmComposition(EditorState& newState);
518 void cancelComposition(EditorState& newState);
519 void insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, bool& handled, EditorState& newState);
520 void getMarkedRange(uint64_t& location, uint64_t& length);
521 void getSelectedRange(uint64_t& location, uint64_t& length);
522 void getAttributedSubstringFromRange(uint64_t location, uint64_t length, AttributedString&);
523 void characterIndexForPoint(const WebCore::IntPoint point, uint64_t& result);
524 void firstRectForCharacterRange(uint64_t location, uint64_t length, WebCore::IntRect& resultRect);
525 void executeKeypressCommands(const Vector<WebCore::KeypressCommand>&, bool& handled, EditorState& newState);
526 void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
527 void getStringSelectionForPasteboard(WTF::String& stringValue);
528 void getDataSelectionForPasteboard(const WTF::String pasteboardType, SharedMemory::Handle& handle, uint64_t& size);
529 void shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent&, bool& result);
530 void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
531 bool performNonEditingBehaviorForSelector(const String&);
534 void confirmComposition(const String& compositionString);
535 void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
536 void firstRectForCharacterInSelectedRange(const uint64_t characterPosition, WebCore::IntRect& resultRect);
537 void getSelectedText(WTF::String&);
539 void gestureWillBegin(const WebCore::IntPoint&, bool& canBeginPanning);
540 void gestureDidScroll(const WebCore::IntSize&);
541 void gestureDidEnd();
544 void updateAccessibilityTree();
547 void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
548 bool hasCompositionForTesting();
549 void confirmCompositionForTesting(const String& compositionString);
551 #if ENABLE(TIZEN_GEOLOCATION)
552 int numberOfPendingGeolocationPermissionRequests();
554 // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
555 // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
559 void performDictionaryLookupForSelection(DictionaryPopupInfo::Type, WebCore::Frame*, const WebCore::VisibleSelection&);
562 void speak(const String&);
565 bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
568 void replaceSelectionWithText(WebCore::Frame*, const String&);
569 void clearSelection();
571 #if ENABLE(DRAG_SUPPORT)
573 void performDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, const WebCore::DragDataMap&, uint32_t flags);
574 #elif PLATFORM(QT) || PLATFORM(GTK)
575 void performDragControllerAction(uint64_t action, WebCore::DragData);
577 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&);
579 void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
581 void willPerformLoadDragDestinationAction();
582 void mayPerformUploadDragDestinationAction();
583 #endif // ENABLE(DRAG_SUPPORT)
585 void beginPrinting(uint64_t frameID, const PrintInfo&);
587 void computePagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
588 #if PLATFORM(MAC) || PLATFORM(WIN)
589 void drawRectToPDF(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, uint64_t callbackID);
590 void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, uint64_t callbackID);
592 void drawPagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
595 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
596 void getWebAppCapable(uint64_t callbackID);
597 void getWebAppIconURL(uint64_t callbackID);
600 void setMediaVolume(float);
602 bool mainFrameHasCustomRepresentation() const;
604 void didChangeScrollOffsetForMainFrame();
606 void mainFrameDidLayout();
608 bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
609 void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
611 bool canRunModal() const { return m_canRunModal; }
612 void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
616 void setDeviceScaleFactor(float);
617 float deviceScaleFactor() const;
619 void setMemoryCacheMessagesEnabled(bool);
621 void forceRepaintWithoutCallback();
623 void unmarkAllMisspellings();
624 void unmarkAllBadGrammar();
626 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD)
627 void handleAlternativeTextUIResult(const String&);
630 // For testing purpose.
631 void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
632 void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
633 void simulateMouseMotion(WebCore::IntPoint, double time);
634 String viewportConfigurationAsText(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight);
636 #if ENABLE(CONTEXT_MENUS)
637 void contextMenuShowing() { m_isShowingContextMenu = true; }
641 void registerApplicationScheme(const String& scheme);
642 void applicationSchemeReply(const QtNetworkReplyData&);
643 void receivedApplicationSchemeRequest(const QNetworkRequest&, QtNetworkReply*);
644 void setUserScripts(const Vector<String>&);
646 void wheelEvent(const WebWheelEvent&);
647 #if ENABLE(GESTURE_EVENTS)
648 void gestureEvent(const WebGestureEvent&);
651 void numWheelEventHandlersChanged(unsigned);
652 void recomputeShortCircuitHorizontalWheelEventsState();
654 bool willGoToBackForwardItemCallbackEnabled() const { return m_willGoToBackForwardItemCallbackEnabled; }
656 #if ENABLE(PAGE_VISIBILITY_API)
657 void setVisibilityState(int visibilityState, bool isInitialState);
660 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
661 void setFocusedInputElementValue(const String& inputValue);
662 void getFocusedInputElementValue(String& inputValue);
665 #if ENABLE(TIZEN_DATALIST_ELEMENT)
666 void getFocusedInputElementDataList(Vector<String>&);
669 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL)
670 void scrollOverflow(const WebCore::FloatPoint&, bool& scrolled);
671 void setPressedNodeAtPoint(const WebCore::IntPoint&, bool& pressed);
673 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE)
674 void scrollOverflowWithTrajectoryVector(const WebCore::FloatPoint&);
676 #if ENABLE(TIZEN_CUSTOM_HEADERS)
677 void addCustomHeader(const String& name, const String& value);
678 WebCore::HTTPHeaderMap customHeaders();
682 #if ENABLE(TIZEN_FIX_PLUGIN_DOWNLOAD)
683 void arePluginsEnabled(bool&);
684 #endif // ENABLE(TIZEN_FIX_PLUGIN_DOWNLOAD)
686 #if ENABLE(TIZEN_WEBKIT2_GET_TEXT_STYLE_FOR_SELECTION)
687 void getTextStyleStateForSelection();
690 #if ENABLE(TIZEN_RECORDING_SURFACE_SET)
691 bool m_recordingSurfaceSetEnable;
692 bool m_recordingSurfaceSetLoadStart;
693 bool m_recordingSurfaceSetLoadFinished;
694 bool m_recordingSurfaceSetSettings;
698 WebPage(uint64_t pageID, const WebPageCreationParameters&);
700 virtual Type type() const { return APIType; }
702 void platformInitialize();
704 void didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
705 void didReceiveSyncWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
708 static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
710 bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
713 bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
716 String sourceForFrame(WebFrame*);
718 void loadData(PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::KURL& baseURL, const WebCore::KURL& failingURL);
720 bool platformHasLocalDataForURL(const WebCore::KURL&);
724 void loadURL(const String&, const SandboxExtension::Handle&);
725 void loadURLRequest(const WebCore::ResourceRequest&, const SandboxExtension::Handle&);
726 void loadHTMLString(const String& htmlString, const String& baseURL);
727 void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL);
728 void loadPlainTextString(const String&);
729 void loadWebArchiveData(const CoreIPC::DataReference&);
731 void loadContentsbyMimeType(const CoreIPC::DataReference&, const String& mimeType, const String& encoding, const String& baseURL);
733 void linkClicked(const String& url, const WebMouseEvent&);
734 void reload(bool reloadFromOrigin, const SandboxExtension::Handle&);
735 void goForward(uint64_t);
736 void goBack(uint64_t);
737 void goToBackForwardItem(uint64_t);
738 void tryRestoreScrollPosition();
739 void setActive(bool);
740 void setFocused(bool);
741 void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&);
742 void setWindowResizerSize(const WebCore::IntSize&);
743 void setIsInWindow(bool);
744 void validateCommand(const String&, uint64_t);
745 void executeEditCommand(const String&);
747 void executeEditCommandWithArgument(const String& command, const String& argument);
750 void mouseEvent(const WebMouseEvent&);
751 void mouseEventSyncForTesting(const WebMouseEvent&, bool&);
752 void wheelEventSyncForTesting(const WebWheelEvent&, bool&);
753 #if ENABLE(TIZEN_ISF_PORT)
754 void keyEvent(const NativeWebKeyboardEvent&);
756 void keyEvent(const WebKeyboardEvent&);
758 void keyEventSyncForTesting(const WebKeyboardEvent&, bool&);
759 #if ENABLE(TOUCH_EVENTS)
760 void touchEvent(const WebTouchEvent&);
761 void touchEventSyncForTesting(const WebTouchEvent&, bool& handled);
763 void highlightPotentialActivation(const WebCore::IntPoint&, const WebCore::IntSize& area);
766 #if ENABLE(CONTEXT_MENUS)
767 void contextMenuHidden() { m_isShowingContextMenu = false; }
770 static void scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
771 static void logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
773 uint64_t restoreSession(const SessionState&);
774 void restoreSessionAndNavigateToCurrentItem(const SessionState&);
776 void didRemoveBackForwardItem(uint64_t);
778 void setWillGoToBackForwardItemCallbackEnabled(bool enabled) { m_willGoToBackForwardItemCallbackEnabled = enabled; }
780 void setDrawsBackground(bool);
781 void setDrawsTransparentBackground(bool);
783 void viewWillStartLiveResize();
784 void viewWillEndLiveResize();
786 void getContentsAsString(uint64_t callbackID);
787 void getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID);
788 void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, uint64_t callbackID);
789 void getRenderTreeExternalRepresentation(uint64_t callbackID);
790 void getSelectionOrContentsAsString(uint64_t callbackID);
791 void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
792 void getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID);
793 void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
794 void forceRepaint(uint64_t callbackID);
796 void preferencesDidChange(const WebPreferencesStore&);
797 void platformPreferencesDidChange(const WebPreferencesStore&);
798 void updatePreferences(const WebPreferencesStore&);
800 void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID);
801 void setUserAgent(const String&);
802 void setCustomTextEncodingName(const String&);
803 void suspendActiveDOMObjectsAndAnimations();
804 void resumeActiveDOMObjectsAndAnimations();
807 void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
808 void performDictionaryLookupForRange(DictionaryPopupInfo::Type, WebCore::Frame*, WebCore::Range*, NSDictionary *options);
810 void setWindowIsVisible(bool windowIsVisible);
811 void windowAndViewFramesChanged(const WebCore::IntRect& windowFrameInScreenCoordinates, const WebCore::IntRect& viewFrameInWindowCoordinates, const WebCore::IntPoint& accessibilityViewCoordinates);
813 RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
814 void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
815 void drawRectToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
816 void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
819 void unapplyEditCommand(uint64_t commandID);
820 void reapplyEditCommand(uint64_t commandID);
821 void didRemoveEditCommand(uint64_t commandID);
823 void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
825 void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
827 #if PLATFORM(QT) || OS(TIZEN)
828 void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area);
831 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
832 void setTextForActivePopupMenu(int32_t index);
835 void failedToShowPopupMenu();
838 void didChooseFilesForOpenPanel(const Vector<String>&);
839 void didCancelForOpenPanel();
840 #if ENABLE(WEB_PROCESS_SANDBOX)
841 void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
844 void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
846 void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
847 #if ENABLE(TIZEN_MEDIA_STREAM)
848 void didReceiveUserMediaPermissionDecision(uint64_t userMediaID, bool allowed);
851 void advanceToNextMisspelling(bool startBeforeSelection);
852 void changeSpellingToWord(const String& word);
854 void uppercaseWord();
855 void lowercaseWord();
856 void capitalizeWord();
858 void setSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled) { m_isSmartInsertDeleteEnabled = isSmartInsertDeleteEnabled; }
861 #if ENABLE(CONTEXT_MENUS)
862 void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
865 void setCanStartMediaTimerFired();
867 static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
869 OwnPtr<WebCore::Page> m_page;
870 RefPtr<WebFrame> m_mainFrame;
871 RefPtr<InjectedBundleBackForwardList> m_backForwardList;
873 RefPtr<WebPageGroupProxy> m_pageGroup;
877 WebCore::IntSize m_viewSize;
878 OwnPtr<DrawingArea> m_drawingArea;
880 HashSet<PluginView*> m_pluginViews;
882 bool m_useFixedLayout;
884 bool m_drawsBackground;
885 bool m_drawsTransparentBackground;
891 #if ENABLE(TIZEN_CUSTOM_HEADERS)
892 WebCore::HTTPHeaderMap m_customHeaders;
896 // Whether the containing window is visible or not.
897 bool m_windowIsVisible;
899 // Whether smart insert/delete is enabled or not.
900 bool m_isSmartInsertDeleteEnabled;
902 // The frame of the containing window in screen coordinates.
903 WebCore::IntRect m_windowFrameInScreenCoordinates;
905 // The frame of the view in window coordinates.
906 WebCore::IntRect m_viewFrameInWindowCoordinates;
908 // The accessibility position of the view.
909 WebCore::IntPoint m_accessibilityPosition;
911 // The layer hosting mode.
912 LayerHostingMode m_layerHostingMode;
914 RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement;
916 WebCore::KeyboardEvent* m_keyboardEventBeingInterpreted;
919 // Our view's window (in the UI process).
922 RefPtr<WebCore::Node> m_gestureTargetNode;
924 WebPageAccessibilityObject* m_accessibilityObject;
927 WebCore::RunLoop::Timer<WebPage> m_setCanStartMediaTimer;
929 HashMap<uint64_t, RefPtr<WebUndoStep> > m_undoStepMap;
931 WebCore::IntSize m_windowResizerSize;
933 #if ENABLE(CONTEXT_MENUS)
934 InjectedBundlePageContextMenuClient m_contextMenuClient;
936 InjectedBundlePageEditorClient m_editorClient;
937 InjectedBundlePageFormClient m_formClient;
938 InjectedBundlePageLoaderClient m_loaderClient;
939 InjectedBundlePagePolicyClient m_policyClient;
940 InjectedBundlePageResourceLoadClient m_resourceLoadClient;
941 InjectedBundlePageUIClient m_uiClient;
942 #if ENABLE(FULLSCREEN_API)
943 InjectedBundlePageFullScreenClient m_fullScreenClient;
946 #if USE(TILED_BACKING_STORE)
947 WebCore::IntSize m_viewportSize;
950 FindController m_findController;
951 #if ENABLE(TOUCH_EVENTS) && PLATFORM(QT)
952 TapHighlightController m_tapHighlightController;
954 RefPtr<PageOverlay> m_pageOverlay;
956 RefPtr<WebPage> m_underlayPage;
958 #if ENABLE(INSPECTOR)
959 RefPtr<WebInspector> m_inspector;
961 #if ENABLE(FULLSCREEN_API)
962 RefPtr<WebFullScreenManager> m_fullScreenManager;
964 RefPtr<WebPopupMenu> m_activePopupMenu;
965 #if ENABLE(CONTEXT_MENUS)
966 RefPtr<WebContextMenu> m_contextMenu;
968 #if ENABLE(INPUT_TYPE_COLOR)
969 WebColorChooser* m_activeColorChooser;
971 RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
972 RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
973 #if ENABLE(TIZEN_MEDIA_STREAM)
974 RefPtr<UserMediaPermissionRequestManager> m_userMediaPermissionRequestManager;
977 #if ENABLE(GEOLOCATION)
978 GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
981 OwnPtr<WebCore::PrintContext> m_printContext;
983 RefPtr<WebPrintOperationGtk> m_printOperation;
986 SandboxExtensionTracker m_sandboxExtensionTracker;
989 RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
990 Vector<RefPtr<SandboxExtension> > m_pendingDropExtensionsForFileUpload;
992 bool m_canRunBeforeUnloadConfirmPanel;
995 bool m_isRunningModal;
997 bool m_cachedMainFrameIsPinnedToLeftSide;
998 bool m_cachedMainFrameIsPinnedToRightSide;
999 bool m_canShortCircuitHorizontalWheelEvents;
1000 unsigned m_numWheelEventHandlers;
1002 unsigned m_cachedPageCount;
1004 #if ENABLE(CONTEXT_MENUS)
1005 bool m_isShowingContextMenu;
1008 bool m_willGoToBackForwardItemCallbackEnabled;
1011 bool m_gestureReachedScrollingLimit;
1014 HashMap<String, QtNetworkReply*> m_applicationSchemeReplies;
1016 #if ENABLE(PAGE_VISIBILITY_API)
1017 WebCore::PageVisibilityState m_visibilityState;
1021 } // namespace WebKit