From 65f03d4f644ce73618e5f4f50dd694b26f55ae12 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Fri, 13 May 2011 16:23:25 +0100 Subject: Merge WebKit at r75993: Initial merge by git. Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3 --- Source/WebKit/haiku/ChangeLog | 658 ++++++++++++++++ .../haiku/WebCoreSupport/ChromeClientHaiku.cpp | 413 ++++++++++ .../haiku/WebCoreSupport/ChromeClientHaiku.h | 167 ++++ .../WebCoreSupport/ContextMenuClientHaiku.cpp | 85 ++ .../haiku/WebCoreSupport/ContextMenuClientHaiku.h | 53 ++ .../haiku/WebCoreSupport/DragClientHaiku.cpp | 74 ++ .../WebKit/haiku/WebCoreSupport/DragClientHaiku.h | 46 ++ .../haiku/WebCoreSupport/EditorClientHaiku.cpp | 484 ++++++++++++ .../haiku/WebCoreSupport/EditorClientHaiku.h | 125 +++ .../WebCoreSupport/FrameLoaderClientHaiku.cpp | 872 +++++++++++++++++++++ .../haiku/WebCoreSupport/FrameLoaderClientHaiku.h | 260 ++++++ .../haiku/WebCoreSupport/InspectorClientHaiku.cpp | 77 ++ .../haiku/WebCoreSupport/InspectorClientHaiku.h | 57 ++ 13 files changed, 3371 insertions(+) create mode 100644 Source/WebKit/haiku/ChangeLog create mode 100644 Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp create mode 100644 Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h create mode 100644 Source/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.cpp create mode 100644 Source/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.h create mode 100644 Source/WebKit/haiku/WebCoreSupport/DragClientHaiku.cpp create mode 100644 Source/WebKit/haiku/WebCoreSupport/DragClientHaiku.h create mode 100644 Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp create mode 100644 Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h create mode 100644 Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp create mode 100644 Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h create mode 100644 Source/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp create mode 100644 Source/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h (limited to 'Source/WebKit/haiku') diff --git a/Source/WebKit/haiku/ChangeLog b/Source/WebKit/haiku/ChangeLog new file mode 100644 index 0000000..4315bb5 --- /dev/null +++ b/Source/WebKit/haiku/ChangeLog @@ -0,0 +1,658 @@ +2010-12-22 Sam Weinig + + Reviewed by Darin Adler. + + WebKit2 needs to mirror the frame tree in the UIProcess + https://bugs.webkit.org/show_bug.cgi?id=51546 + + - Add client functions to notify that a frame has been added or + removed from the page cache. + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::didSaveToPageCache): + (WebCore::FrameLoaderClientHaiku::didRestoreFromPageCache): + * WebCoreSupport/FrameLoaderClientHaiku.h: + +2010-12-22 Ryosuke Niwa + + Reviewed by Eric Seidel. + + Editor.h doesn't need to include SelectionController.h + https://bugs.webkit.org/show_bug.cgi?id=51441 + + Renamed SelectionController::EDirection to SelectionDirection. + + * WebCoreSupport/EditorClientHaiku.cpp: + (WebCore::EditorClientHaiku::handleKeyboardEvent): + +2010-10-28 MORITA Hajime + + Reviewed by Ojan Vafai. + + spellcheck does not check pasted text + https://bugs.webkit.org/show_bug.cgi?id=40092 + + Added a stub implememntation. + + * WebCoreSupport/EditorClientHaiku.h: + (WebCore::EditorClientHaiku::requestCheckingOfString): + +2010-12-01 Jia Pu + + Reviewed by Darin Adler. + + Support multiple correction candidates panel for misspelled word on Mac OS X. + https://bugs.webkit.org/show_bug.cgi?id=50137 + + + Adopted new function signature defined in base class. + + * WebCoreSupport/EditorClientHaiku.cpp: + (WebCore::EditorClientHaiku::getGuessesForWord): + * WebCoreSupport/EditorClientHaiku.h: + +2010-11-08 Alexey Proskuryakov + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48685 + Notify UI process about focused frame + + Added an empty implementation of the new ChromeClient method. Also, added missing "virtual" + keywords all over the place. + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientHaiku::focusedFrameChanged): + * WebCoreSupport/ChromeClientHaiku.h: + (WebCore::ChromeClientHaiku::scrollbarsModeDidChange): + (WebCore::ChromeClientHaiku::cancelGeolocationPermissionRequestForFrame): + +2010-11-01 Brady Eidson + + Reviewed by Anders Carlsson. + + and https://bugs.webkit.org/show_bug.cgi?id=48699 + Context menu support for WebKit 2. + + * WebCoreSupport/ChromeClientHaiku.h: + (WebCore::ChromeClientHaiku::showContextMenu): + +2010-10-29 Alexey Proskuryakov + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48576 + Let WebKit2 client know when a frame is a frameset + + Added a blank implementation of the new FrameLoaderClient method. + + * WebCoreSupport/FrameLoaderClientHaiku.h: + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::dispatchDidBecomeFrameset): + +2010-10-26 Jenn Braithwaite + + Reviewed by Dmitry Titov. + + Resource tracking failure when trying to move a frame between documents + https://bugs.webkit.org/show_bug.cgi?id=44713 + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::transferLoadingResourceFromPage): + Empty method. + * WebCoreSupport/FrameLoaderClientHaiku.h: + +2010-10-22 Sam Weinig + + Reviewed by Anders Carlsson. + + WebKit2 needs to pass the current event modifier flags when requesting a new window + https://bugs.webkit.org/show_bug.cgi?id=48140 + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientHaiku::createWindow): + * WebCoreSupport/ChromeClientHaiku.h: + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::dispatchCreatePage): + * WebCoreSupport/FrameLoaderClientHaiku.h: + Add NavigationAction parameter. + +2010-09-28 Jenn Braithwaite + + Reviewed by Dmitry Titov. + + Added oldPage param to FrameLoaderClient::didTransferChildFrameToNewDocument. + https://bugs.webkit.org/show_bug.cgi?id=46663 + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::didTransferChildFrameToNewDocument): + * WebCoreSupport/FrameLoaderClientHaiku.h: + +2010-09-13 Enrica Casucci + + Reviewed by Sam Weinig. + + Paste should be implemented in WebCore like Copy and Cut for Mac also. + https://bugs.webkit.org/show_bug.cgi?id=45494 + + + On the Mac platform, the implementation of the paste operation is all done + at the WebKit level. In order to support it on WebKit2 it is necessary to + refactor the code and move this functionality at the level of WebCore like + we already have on Windows. + The original code relies on some in AppKit functions that call back into + WebKit causing problems in WebKit2. All this functionality has been moved + at the level of the editor client where it can be dealt with appropriately. + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::canShowMIMETypeAsHTML): Added stub. + * WebCoreSupport/FrameLoaderClientHaiku.h: + +2010-09-10 Adam Barth + + Reviewed by Darin Fisher. + + Move code from WebKit-layer to DocumentLoader + https://bugs.webkit.org/show_bug.cgi?id=45569 + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::committedLoad): + +2010-09-10 Adam Barth + + Reviewed by Eric Seidel. + + Main resource bytes shouldn't bounce through FrameLoader + https://bugs.webkit.org/show_bug.cgi?id=45496 + + Now return the bytes to the DocumentLoader. + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::committedLoad): + +2010-08-06 Gavin Barraclough + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * WebCoreSupport/FrameLoaderClientHaiku.h: + * WebCoreSupport/InspectorClientHaiku.h: + +2010-08-06 Jessie Berlin + + Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build. + Unreviewed. + + * WebCoreSupport/FrameLoaderClientHaiku.h: + * WebCoreSupport/InspectorClientHaiku.h: + +2010-07-27 Luiz Agostini + + Reviewed by Darin Fisher. + + PopupMenu refactoring in preparation to WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=42592 + + As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu + instances, concrete classes that inherit from ChromeClient needed to be changed to + implement the new methods. + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientHaiku::selectItemWritingDirectionIsNatural): + (WebCore::ChromeClientHaiku::createPopupMenu): + (WebCore::ChromeClientHaiku::createSearchPopupMenu): + * WebCoreSupport/ChromeClientHaiku.h: + +2010-08-02 Jeremy Orlow + + Speculative revert of 64425 due to Chromium instability + https://bugs.webkit.org/show_bug.cgi?id=43347 + + * WebCoreSupport/ChromeClientHaiku.cpp: + * WebCoreSupport/ChromeClientHaiku.h: + +2010-07-27 Luiz Agostini + + Reviewed by Darin Fisher. + + PopupMenu refactoring in preparation to WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=42592 + + As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu + instances, concrete classes that inherit from ChromeClient needed to be changed to + implement the new methods. + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientHaiku::selectItemWritingDirectionIsNatural): + (WebCore::ChromeClientHaiku::createPopupMenu): + (WebCore::ChromeClientHaiku::createSearchPopupMenu): + * WebCoreSupport/ChromeClientHaiku.h: + +2010-07-31 Sheriff Bot + + Unreviewed, rolling out r64422. + http://trac.webkit.org/changeset/64422 + https://bugs.webkit.org/show_bug.cgi?id=43304 + + Build fixes are needed for Snow Leopard and Windows. + (Requested by lca on #webkit). + + * WebCoreSupport/ChromeClientHaiku.cpp: + * WebCoreSupport/ChromeClientHaiku.h: + +2010-07-27 Luiz Agostini + + Reviewed by Darin Fisher. + + PopupMenu refactoring in preparation to WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=42592 + + As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu + instances, concrete classes that inherit from ChromeClient needed to be changed to + implement the new methods. + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientHaiku::selectItemWritingDirectionIsNatural): + (WebCore::ChromeClientHaiku::createPopupMenu): + (WebCore::ChromeClientHaiku::createSearchPopupMenu): + * WebCoreSupport/ChromeClientHaiku.h: + +2010-07-30 Joseph Pecoraro + + Reviewed by David Kilzer. + + Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas) + https://bugs.webkit.org/show_bug.cgi?id=40627 + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientWx::reachedApplicationCacheOriginQuota): + * WebCoreSupport/ChromeClientHaiku.h: + +2010-07-16 Zhe Su + + Reviewed by Darin Adler. + + REGRESSION(r61484): Broke focus behaviour on Qt and probably other platforms + https://bugs.webkit.org/show_bug.cgi?id=42253 + + Dummy implementation of EditorClient::willSetInputMethodState. + + * WebCoreSupport/EditorClientHaiku.cpp: + (WebCore::EditorClientHaiku::willSetInputMethodState): + * WebCoreSupport/EditorClientHaiku.h: + +2010-07-14 Sam Weinig + + Reviewed by Darin Adler. + + Patch for https://bugs.webkit.org/show_bug.cgi?id=42232 + Make changing Cursors work in WebKit2. + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientHaiku::setCursor): + * WebCoreSupport/ChromeClientHaiku.h: + Change prototype to match new one. + +2010-06-14 Ilya Tikhonovsky + + Reviewed by Pavel Feldman. + + WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc + data from inspected page to WebInspector as JSON string via http. The native + serialization to JSON string is supported by InspectorValue's classes. This patch + has the implementation of sendMessageToFrontend function. WebKit version of it still + uses ScriptFunctionCall and will be switched to another transport a little bit later. + https://bugs.webkit.org/show_bug.cgi?id=40134 + + * WebCoreSupport/InspectorClientHaiku.cpp: + (WebCore::InspectorClientHaiku::sendMessageToFrontend): + * WebCoreSupport/InspectorClientHaiku.h: + +2010-06-09 Sheriff Bot + + Unreviewed, rolling out r60889. + http://trac.webkit.org/changeset/60889 + https://bugs.webkit.org/show_bug.cgi?id=40365 + + gtk bot has some kind of memory corruption (Requested by + loislo on #webkit). + + * WebCoreSupport/InspectorClientHaiku.cpp: + * WebCoreSupport/InspectorClientHaiku.h: + +2010-06-07 Ilya Tikhonovsky + + Reviewed by Pavel Feldman. + + WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc + data from inspected page to WebInspector as JSON string via http. The native + serialization to JSON string is supported by InspectorValue's classes. This patch + has the implementation of sendMessageToFrontend function. WebKit version of it still + uses ScriptFunctionCall and will be switched to another transport a little bit later. + https://bugs.webkit.org/show_bug.cgi?id=40134 + + * WebCoreSupport/InspectorClientHaiku.cpp: + (WebCore::InspectorClientHaiku::sendMessageToFrontend): + * WebCoreSupport/InspectorClientHaiku.h: + +2010-05-31 Lyon Chen + + Reviewed by Kent Tamura. + + Enum value FORWARD, BACKWARD, RIGHT, LEFT are causing macro conflicts. + https://bugs.webkit.org/show_bug.cgi?id=35530 + + Change enum EAlteration from { MOVE, EXTEND } to { AlterationMove, AlterationExtend } and enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT} to { DirectionForward, DirectionBackward, DirectionRight, DirectionLeft } to avoid macro conflict, and also better coding style conformance. + + * WebCoreSupport/EditorClientHaiku.cpp: + (WebCore::EditorClientHaiku::handleKeyboardEvent): + +2010-05-30 Lyon Chen + + Reviewed by Kent Tamura. + + This is a coding style cleanup before fixing to bug 35530. + + Enum value FORWARD, BACKWARD, RIGHT, LEFT are causing macro conflicts. + https://bugs.webkit.org/show_bug.cgi?id=35530 + + * WebCoreSupport/EditorClientHaiku.cpp: + (WebCore::EditorClientHaiku::handleKeyboardEvent): + +2010-05-03 Jens Alfke + + Reviewed by Darin Fisher. + + [chromium] Add "willSendSubmitEvent" hook to WebFrameClient and FrameLoaderClient + https://bugs.webkit.org/show_bug.cgi?id=38397 + + No tests (functionality is exposed only through native WebKit API.) + + * WebCoreSupport/FrameLoaderClientHaiku.h: + (WebCore::FrameLoaderClientHaiku::dispatchWillSendSubmitEvent): + +2010-04-20 Adam Barth + + Reviewed by Eric Seidel. + + Factor DocumentWriter out of FrameLoader + https://bugs.webkit.org/show_bug.cgi?id=37175 + + Update these callsites because the method moved to DocumentWriter. + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::committedLoad): + +2010-04-20 Kent Tamura + + Reviewed by Darin Adler. + + Change a parameter type of chooseIconForFiles() + https://bugs.webkit.org/show_bug.cgi?id=37504 + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientHaiku::chooseIconForFiles): + * WebCoreSupport/ChromeClientHaiku.h: + +2010-04-11 Sheriff Bot + + Unreviewed, rolling out r57468. + http://trac.webkit.org/changeset/57468 + https://bugs.webkit.org/show_bug.cgi?id=37433 + + Broke the world... Must have applied the patch wrong + (Requested by abarth on #webkit). + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::committedLoad): + +2010-04-11 Adam Barth + + Reviewed by Eric Seidel. + + Factor DocumentWriter out of FrameLoader + https://bugs.webkit.org/show_bug.cgi?id=37175 + + Update these callsites because the method moved to DocumentWriter. + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::committedLoad): + +2010-04-07 Andrey Kosyakov + + Reviewed by Yury Semikhatsky. + + Removed redundant FrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest() + https://bugs.webkit.org/show_bug.cgi?id=36949 + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + * WebCoreSupport/FrameLoaderClientHaiku.h: + +2010-03-31 Marcus Bulach + + Reviewed by Jeremy Orlow. + + Adds Geolocation param for cancelGeolocationPermissionRequestForFrame. + https://bugs.webkit.org/show_bug.cgi?id=35031 + + * WebCoreSupport/ChromeClientHaiku.h: + (WebCore::ChromeClientHaiku::cancelGeolocationPermissionRequestForFrame): + +2010-03-28 Alexey Proskuryakov + + Build fix. Include WindowsKeyboardCodes.h instead of KeyboardCodes.h. + + * WebCoreSupport/EditorClientHaiku.cpp: + +2010-03-24 Kent Tamura + + Reviewed by Darin Adler. + + Make Icon::createIconForFiles() optional. + https://bugs.webkit.org/show_bug.cgi?id=35072 + + - Rename iconForFiles() to chooseIconForFiles(). + - Call Icon::createIconForFiles() from chooseIconForFiles(). + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientHaiku::chooseIconForFiles): + * WebCoreSupport/ChromeClientHaiku.h: + +2010-03-16 Yury Semikhatsky + + Reviewed by Pavel Feldman. + + Introduce InspectorFrontendClient that provides InspectorFrontend with an interface to the embedder. InspectorClient now serves as a delegate for InspectorController and does not contain methods for managing inspector frontend window. That allows to create remote InspectorFrontendHost. + + Introduce InspectorFrontendClient that would provide InspectorFrontend with an interface to the embedder + https://bugs.webkit.org/show_bug.cgi?id=35036 + + * WebCoreSupport/InspectorClientHaiku.cpp: + (WebCore::InspectorClientHaiku::openInspectorFrontend): + * WebCoreSupport/InspectorClientHaiku.h: + +2010-03-11 Anders Carlsson + + Reviewed by David Hyatt. + + Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents. + + * WebCoreSupport/ChromeClientHaiku.cpp: + * WebCoreSupport/ChromeClientHaiku.h: + +2010-03-02 Adam Treat + + Reviewed by Dave Hyatt. + + Adapt the haiku port to the refactoring of repaint methods. + + https://bugs.webkit.org/show_bug.cgi?id=34214 + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientHaiku::invalidateContents): + (WebCore::ChromeClientHaiku::invalidateWindow): + (WebCore::ChromeClientHaiku::invalidateContentsAndWindow): + (WebCore::ChromeClient::invalidateContentsForSlowScroll): + * WebCoreSupport/ChromeClientHaiku.h: + +2010-02-23 Steve Block + + Reviewed by Darin Adler. + + Adds ChromeClient::cancelGeolocationPermissionRequestForFrame + https://bugs.webkit.org/show_bug.cgi?id=34962 + + This method is required so that a Geolocation object can cancel an + asynchronous permission request. This allows the chrome client to cancel + any UI it is showing for the permission request. + + * WebCoreSupport/ChromeClientHaiku.h: + (WebCore::ChromeClientHaiku::cancelGeolocationPermissionRequestForFrame): + +2010-02-17 Dmitry Titov + + Reviewed by David Levin, Darin Fisher, Simon Hausmann. + + When a live iframe element is moved between pages, it still depends on the old page. + https://bugs.webkit.org/show_bug.cgi?id=34382 + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::didTransferChildFrameToNewDocument): + Added empty implementation of a new virtual method. + + * WebCoreSupport/FrameLoaderClientHaiku.h: + +2010-02-17 Kent Tamura + + Reviewed by Eric Seidel. + + Introduces new Icon loading interface in order to support + asynchronous loading. + https://bugs.webkit.org/show_bug.cgi?id=32054 + + Add an empty implementation of ChromeClient::iconForFiles(). + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientHaiku::iconForFiles): + * WebCoreSupport/ChromeClientHaiku.h: + +2009-12-06 Maxime Simon + + Reviewed by Adam Barth. + + Build fix. Add in FrameLoaderClientHaiku the declaration of three functions introduced in r51644. + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::dispatchDidPushStateWithinPage): + (WebCore::FrameLoaderClientHaiku::dispatchDidReplaceStateWithinPage): + (WebCore::FrameLoaderClientHaiku::dispatchDidPopStateWithinPage): + * WebCoreSupport/FrameLoaderClientHaiku.h: + +2009-12-03 Pavel Feldman + + Reviewed by Timothy Hatcher. + + Web Inspector: Simplify the settings support in inspector controller. + + https://bugs.webkit.org/show_bug.cgi?id=32076 + + * WebCoreSupport/InspectorClientHaiku.cpp: + (WebCore::InspectorClientHaiku::populateSetting): + (WebCore::InspectorClientHaiku::storeSetting): + * WebCoreSupport/InspectorClientHaiku.h: + +2009-12-03 Ben Murdoch + + Reviewed by Brady Eidson. + + [Android] The FrameLoaderClient is unaware of BackForwardList changes. + https://bugs.webkit.org/show_bug.cgi?id=31914 + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::dispatchDidAddBackForwardItem): Add an empty implementation. Method added to FrameLoaderClient by Android (see bug). + (WebCore::FrameLoaderClientHaiku::dispatchDidRemoveBackForwardItem): ditto. + (WebCore::FrameLoaderClientHaiku::dispatchDidChangeBackForwardIndex): ditto. + * WebCoreSupport/FrameLoaderClientHaiku.h: + +2009-11-13 Adam Roben + + Update for changes to FrameLoaderClient + + Fixes Tell the WebFrameLoadDelegate when + window objects in isolated worlds are cleared + + Reviewed by Dave Hyatt. + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::dispatchDidClearWindowObjectInWorld): + * WebCoreSupport/FrameLoaderClientHaiku.h: + Replaced windowObjectCleared with this function. Does nothing if the + passed-in world is not the mainThreadNormalWorld(). + +2009-10-30 Evan Stade + + Reviewed by David Levin. + + Notify the chrome when the focused node has changed. + https://bugs.webkit.org/show_bug.cgi?id=30832 + + Added stub implementation for new ChromeClient function. + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientHaiku::focusedNodeChanged): + * WebCoreSupport/ChromeClientHaiku.h: + +2009-10-07 Adam Barth + + Reviewed by Darin Adler. + + Factor PolicyChecker out of FrameLoader + https://bugs.webkit.org/show_bug.cgi?id=30155 + + Move the policy callback to the policy object. + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::dispatchWillSubmitForm): + (WebCore::FrameLoaderClientHaiku::dispatchDecidePolicyForMIMEType): + (WebCore::FrameLoaderClientHaiku::dispatchDecidePolicyForNewWindowAction): + (WebCore::FrameLoaderClientHaiku::dispatchDecidePolicyForNavigationAction): + +2009-09-17 Kenneth Rohde Christiansen + + Reviewed by Simon Hausmann. + + Make PlatformWindow return something else than PlatformWidget + https://bugs.webkit.org/show_bug.cgi?id=29085 + + Reflect the rename of platformWindow and it's return type. + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientHaiku::platformPageClient): + * WebCoreSupport/ChromeClientHaiku.h: + +2009-08-28 Gustavo Noronha Silva + + Reviewed by Holger Freyther. + + https://bugs.webkit.org/show_bug.cgi?id=25889 + [GTK] scrollbar policy for main frame is not implementable + + Add empty implementation for new ChromeClient method. + + * WebCoreSupport/ChromeClientHaiku.h: + (ChromeClientHaiku::scrollbarsModeDidChange): + +2009-07-29 Kevin McCullough + + Reviewed by Darin Adler. + + Added foundation work to allow a testing infrastructure for the Web + Inspector. + + * WebCoreSupport/InspectorClientHaiku.cpp: + (WebCore::InspectorClientHaiku::inspectorWindowObjectCleared): + * WebCoreSupport/InspectorClientHaiku.h: + diff --git a/Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp b/Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp new file mode 100644 index 0000000..01b9c1d --- /dev/null +++ b/Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp @@ -0,0 +1,413 @@ +/* + * Copyright (C) 2006 Zack Rusin + * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2007 Ryan Leavengood All rights reserved. + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "config.h" +#include "ChromeClientHaiku.h" + +#include "Frame.h" +#include "FrameLoadRequest.h" +#include "FrameView.h" +#include "HitTestResult.h" +#include "Icon.h" +#include "NavigationAction.h" +#include "NotImplemented.h" +#include "PlatformString.h" +#include "SecurityOrigin.h" +#include "PopupMenuHaiku.h" +#include "SearchPopupMenuHaiku.h" + +#include +#include + + +namespace WebCore { + +ChromeClientHaiku::ChromeClientHaiku() +{ +} + +ChromeClientHaiku::~ChromeClientHaiku() +{ +} + +void ChromeClientHaiku::chromeDestroyed() +{ + notImplemented(); +} + +void ChromeClientHaiku::setWindowRect(const FloatRect&) +{ + notImplemented(); +} + +FloatRect ChromeClientHaiku::windowRect() +{ + notImplemented(); + return FloatRect(0, 0, 200, 200); +} + +FloatRect ChromeClientHaiku::pageRect() +{ + notImplemented(); + return FloatRect(0, 0, 200, 200); +} + +float ChromeClientHaiku::scaleFactor() +{ + notImplemented(); + return 1.0; +} + +void ChromeClientHaiku::focus() +{ + notImplemented(); +} + +void ChromeClientHaiku::unfocus() +{ + notImplemented(); +} + +bool ChromeClientHaiku::canTakeFocus(FocusDirection) +{ + notImplemented(); + return true; +} + +void ChromeClientHaiku::takeFocus(FocusDirection) +{ + notImplemented(); +} + +void ChromeClientHaiku::focusedNodeChanged(Node*) +{ +} + +void ChromeClientHaiku::focusedFrameChanged(Frame*) +{ +} + +Page* ChromeClientHaiku::createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&) +{ + notImplemented(); + return 0; +} + +Page* ChromeClientHaiku::createModalDialog(Frame*, const FrameLoadRequest&) +{ + notImplemented(); + return 0; +} + +void ChromeClientHaiku::show() +{ + notImplemented(); +} + +bool ChromeClientHaiku::canRunModal() +{ + notImplemented(); + return false; +} + +void ChromeClientHaiku::runModal() +{ + notImplemented(); +} + +void ChromeClientHaiku::setToolbarsVisible(bool) +{ + notImplemented(); +} + +bool ChromeClientHaiku::toolbarsVisible() +{ + notImplemented(); + return false; +} + +void ChromeClientHaiku::setStatusbarVisible(bool) +{ + notImplemented(); +} + +bool ChromeClientHaiku::statusbarVisible() +{ + notImplemented(); + return false; +} + +void ChromeClientHaiku::setScrollbarsVisible(bool) +{ + notImplemented(); +} + +bool ChromeClientHaiku::scrollbarsVisible() +{ + notImplemented(); + return true; +} + +void ChromeClientHaiku::setMenubarVisible(bool) +{ + notImplemented(); +} + +bool ChromeClientHaiku::menubarVisible() +{ + notImplemented(); + return false; +} + +void ChromeClientHaiku::setResizable(bool) +{ + notImplemented(); +} + +void ChromeClientHaiku::addMessageToConsole(const String& message, unsigned int lineNumber, + const String& sourceID) +{ + printf("MESSAGE %s:%i %s\n", BString(sourceID).String(), lineNumber, BString(message).String()); +} + +void ChromeClientHaiku::addMessageToConsole(MessageSource, MessageLevel, const String& message, + unsigned int lineNumber, const String& sourceID) +{ + printf("MESSAGE %s:%i %s\n", BString(sourceID).String(), lineNumber, BString(message).String()); +} + +void ChromeClientHaiku::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, + unsigned int lineNumber, const String& sourceID) +{ + printf("MESSAGE %s:%i %s\n", BString(sourceID).String(), lineNumber, BString(message).String()); +} + +bool ChromeClientHaiku::canRunBeforeUnloadConfirmPanel() +{ + notImplemented(); + return false; +} + +bool ChromeClientHaiku::runBeforeUnloadConfirmPanel(const String& message, Frame* frame) +{ + notImplemented(); + return false; +} + +void ChromeClientHaiku::closeWindowSoon() +{ + notImplemented(); +} + +void ChromeClientHaiku::runJavaScriptAlert(Frame*, const String& msg) +{ + BAlert* alert = new BAlert("JavaScript", BString(msg).String(), "OK"); + alert->Go(); +} + +bool ChromeClientHaiku::runJavaScriptConfirm(Frame*, const String& msg) +{ + BAlert* alert = new BAlert("JavaScript", BString(msg).String(), "Yes", "No"); + return !alert->Go(); +} + +bool ChromeClientHaiku::runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result) +{ + notImplemented(); + return false; +} + +void ChromeClientHaiku::setStatusbarText(const String&) +{ + notImplemented(); +} + +bool ChromeClientHaiku::shouldInterruptJavaScript() +{ + notImplemented(); + return false; +} + +bool ChromeClientHaiku::tabsToLinks() const +{ + return false; +} + +IntRect ChromeClientHaiku::windowResizerRect() const +{ + return IntRect(); +} + +void ChromeClientHaiku::invalidateWindow(const IntRect&, bool) +{ + notImplemented(); +} + +void ChromeClientHaiku::invalidateContentsAndWindow(const IntRect&, bool) +{ + notImplemented(); +} + +void ChromeClientHaiku::invalidateContentsForSlowScroll(const IntRect&, bool) +{ + notImplemented(); +} + +void ChromeClientHaiku::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) +{ + notImplemented(); +} + +IntPoint ChromeClientHaiku::screenToWindow(const IntPoint&) const +{ + notImplemented(); + return IntPoint(); +} + +IntRect ChromeClientHaiku::windowToScreen(const IntRect&) const +{ + notImplemented(); + return IntRect(); +} + +PlatformPageClient ChromeClientHaiku::platformPageClient() const +{ + notImplemented(); + return PlatformWidget(); +} + +void ChromeClientHaiku::contentsSizeChanged(Frame*, const IntSize&) const +{ + notImplemented(); +} + +void ChromeClientHaiku::scrollRectIntoView(const IntRect&, const ScrollView*) const +{ + notImplemented(); +} + +void ChromeClientHaiku::addToDirtyRegion(const IntRect&) +{ +} + +void ChromeClientHaiku::scrollBackingStore(int, int, const IntRect&, const IntRect&) +{ +} + +void ChromeClientHaiku::updateBackingStore() +{ +} + +void ChromeClientHaiku::mouseDidMoveOverElement(const HitTestResult& hit, unsigned /*modifierFlags*/) +{ + // Some extra info + notImplemented(); +} + +void ChromeClientHaiku::setToolTip(const String& tip) +{ + notImplemented(); +} + +void ChromeClientHaiku::setToolTip(const String& tip, TextDirection) +{ + notImplemented(); +} + +void ChromeClientHaiku::print(Frame*) +{ + notImplemented(); +} + +void ChromeClientHaiku::exceededDatabaseQuota(Frame*, const String& databaseName) +{ + notImplemented(); +} + +#if ENABLE(OFFLINE_WEB_APPLICATIONS) +void ChromeClientWx::reachedMaxAppCacheSize(int64_t spaceNeeded) +{ + notImplemented(); +} + +void ChromeClientWx::reachedApplicationCacheOriginQuota(SecurityOrigin*) +{ + notImplemented(); +} +#endif + +void ChromeClientHaiku::requestGeolocationPermissionForFrame(Frame*, Geolocation*) +{ + notImplemented(); +} + +void ChromeClientHaiku::runOpenPanel(Frame*, PassRefPtr) +{ + notImplemented(); +} + +void ChromeClientHaiku::chooseIconForFiles(const Vector& filenames, FileChooser* chooser) +{ + chooser->iconLoaded(Icon::createIconForFiles(filenames)); +} + +void ChromeClientHaiku::setCursor(const Cursor&) +{ + notImplemented(); +} + +// Notification that the given form element has changed. This function +// will be called frequently, so handling should be very fast. +void ChromeClientHaiku::formStateDidChange(const Node*) +{ + notImplemented(); +} + +PassOwnPtr ChromeClientHaiku::createHTMLParserQuirks() +{ + notImplemented(); + return 0; +} + +bool ChromeClientHaiku::selectItemWritingDirectionIsNatural() +{ + return false; +} + +PassRefPtr ChromeClientHaiku::createPopupMenu(PopupMenuClient* client) const +{ + return adoptRef(new PopupMenuHaiku(client)); +} + +PassRefPtr ChromeClientHaiku::createSearchPopupMenu(PopupMenuClient* client) const +{ + return adoptRef(new SearchPopupMenuHaiku(client)); +} + +} // namespace WebCore + diff --git a/Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h b/Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h new file mode 100644 index 0000000..deb3678 --- /dev/null +++ b/Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h @@ -0,0 +1,167 @@ +/* + * Copyright (C) 2006 Zack Rusin + * Copyright (C) 2007 Ryan Leavengood All rights reserved. + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ChromeClientHaiku_h +#define ChromeClientHaiku_h + +#include "ChromeClient.h" +#include "FloatRect.h" +#include "RefCounted.h" + +namespace WebCore { + + class FloatRect; + class Page; + struct FrameLoadRequest; + + class ChromeClientHaiku : public ChromeClient { + public: + ChromeClientHaiku(); + virtual ~ChromeClientHaiku(); + virtual void chromeDestroyed(); + + virtual void setWindowRect(const FloatRect&); + virtual FloatRect windowRect(); + + virtual FloatRect pageRect(); + + virtual float scaleFactor(); + + virtual void focus(); + virtual void unfocus(); + + virtual bool canTakeFocus(FocusDirection); + virtual void takeFocus(FocusDirection); + + virtual void focusedNodeChanged(Node*); + virtual void focusedFrameChanged(Frame*); + + virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&); + virtual Page* createModalDialog(Frame*, const FrameLoadRequest&); + virtual void show(); + + virtual bool canRunModal(); + virtual void runModal(); + + virtual void setToolbarsVisible(bool); + virtual bool toolbarsVisible(); + + virtual void setStatusbarVisible(bool); + virtual bool statusbarVisible(); + + virtual void setScrollbarsVisible(bool); + virtual bool scrollbarsVisible(); + + virtual void setMenubarVisible(bool); + virtual bool menubarVisible(); + + virtual void setResizable(bool); + + virtual void addMessageToConsole(const String& message, unsigned int lineNumber, + const String& sourceID); + virtual void addMessageToConsole(MessageSource, MessageLevel, const String& message, + unsigned int lineNumber, const String& sourceID); + virtual void addMessageToConsole(MessageSource, MessageType, MessageLevel, + const String&, unsigned int, const String&); + + virtual bool canRunBeforeUnloadConfirmPanel(); + + virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame); + + virtual void closeWindowSoon(); + + virtual void runJavaScriptAlert(Frame*, const String&); + virtual bool runJavaScriptConfirm(Frame*, const String&); + virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result); + virtual bool shouldInterruptJavaScript(); + + virtual void setStatusbarText(const WTF::String&); + virtual bool tabsToLinks() const; + virtual IntRect windowResizerRect() const; + + virtual void invalidateWindow(const IntRect&, bool); + virtual void invalidateContentsAndWindow(const IntRect&, bool); + virtual void invalidateContentsForSlowScroll(const IntRect&, bool); + virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); + + virtual IntPoint screenToWindow(const IntPoint&) const; + virtual IntRect windowToScreen(const IntRect&) const; + virtual PlatformPageClient platformPageClient() const; + virtual void contentsSizeChanged(Frame*, const IntSize&) const; + virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const; + + void addToDirtyRegion(const IntRect&); + void scrollBackingStore(int, int, const IntRect&, const IntRect&); + void updateBackingStore(); + + virtual void scrollbarsModeDidChange() const { } + virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags); + + void setToolTip(const String&); + + virtual void setToolTip(const String&, TextDirection); + + void print(Frame*); + +#if ENABLE(DATABASE) + virtual void exceededDatabaseQuota(Frame*, const String& databaseName); +#endif + + virtual bool selectItemWritingDirectionIsNatural(); + virtual PassRefPtr createPopupMenu(PopupMenuClient*) const; + virtual PassRefPtr createSearchPopupMenu(PopupMenuClient*) const; + +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); + virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*); +#endif +#if ENABLE(CONTEXT_MENUS) + virtual void showContextMenu() { } +#endif + + // This is an asynchronous call. The ChromeClient can display UI asking the user for permission + // to use Geolococation. + virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*); + virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*) { } + + virtual void runOpenPanel(Frame*, PassRefPtr); + virtual void chooseIconForFiles(const Vector&, FileChooser*); + + virtual void setCursor(const Cursor&); + + // Notification that the given form element has changed. This function + // will be called frequently, so handling should be very fast. + virtual void formStateDidChange(const Node*); + + virtual PassOwnPtr createHTMLParserQuirks(); + }; + +} // namespace WebCore + +#endif + diff --git a/Source/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.cpp b/Source/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.cpp new file mode 100644 index 0000000..228adc7 --- /dev/null +++ b/Source/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.cpp @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2006 Zack Rusin + * Copyright (C) 2007 Ryan Leavengood + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "config.h" +#include "ContextMenuClientHaiku.h" + +#include "ContextMenu.h" +#include "HitTestResult.h" +#include "KURL.h" + +#include "NotImplemented.h" + + +namespace WebCore { + +void ContextMenuClientHaiku::contextMenuDestroyed() +{ + notImplemented(); +} + +PlatformMenuDescription ContextMenuClientHaiku::getCustomMenuFromDefaultItems(ContextMenu* menu) +{ + return menu->platformDescription(); +} + +void ContextMenuClientHaiku::contextMenuItemSelected(ContextMenuItem*, const ContextMenu*) +{ + notImplemented(); +} + +void ContextMenuClientHaiku::downloadURL(const KURL& url) +{ + notImplemented(); +} + +void ContextMenuClientHaiku::lookUpInDictionary(Frame*) +{ + notImplemented(); +} + +void ContextMenuClientHaiku::speak(const String&) +{ + notImplemented(); +} + +bool ContextMenuClientHaiku::isSpeaking() +{ + notImplemented(); + return false; +} + +void ContextMenuClientHaiku::stopSpeaking() +{ + notImplemented(); +} + +void ContextMenuClientHaiku::searchWithGoogle(const Frame*) +{ + notImplemented(); +} + +} // namespace WebCore + diff --git a/Source/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.h b/Source/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.h new file mode 100644 index 0000000..756b3cf --- /dev/null +++ b/Source/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2006 Zack Rusin + * Copyright (C) 2007 Ryan Leavengood + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ContextMenuClientHaiku_h +#define ContextMenuClientHaiku_h + +#include "ContextMenuClient.h" + + +namespace WebCore { + class ContextMenu; + + class ContextMenuClientHaiku : public ContextMenuClient { + public: + virtual void contextMenuDestroyed(); + + virtual PlatformMenuDescription getCustomMenuFromDefaultItems(ContextMenu*); + virtual void contextMenuItemSelected(ContextMenuItem*, const ContextMenu*); + + virtual void downloadURL(const KURL& url); + virtual void searchWithGoogle(const Frame*); + virtual void lookUpInDictionary(Frame*); + virtual void speak(const String&); + virtual bool isSpeaking(); + virtual void stopSpeaking(); + }; +} // namespace WebCore + +#endif // ContextMenuClientHaiku_h + diff --git a/Source/WebKit/haiku/WebCoreSupport/DragClientHaiku.cpp b/Source/WebKit/haiku/WebCoreSupport/DragClientHaiku.cpp new file mode 100644 index 0000000..8964c69 --- /dev/null +++ b/Source/WebKit/haiku/WebCoreSupport/DragClientHaiku.cpp @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2007 Ryan Leavengood + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "DragClientHaiku.h" + +#include "NotImplemented.h" + + +namespace WebCore { + +DragDestinationAction DragClientHaiku::actionMaskForDrag(DragData*) +{ + notImplemented(); + return DragDestinationActionAny; +} + +void DragClientHaiku::willPerformDragDestinationAction(DragDestinationAction, DragData*) +{ + notImplemented(); +} + +void DragClientHaiku::dragControllerDestroyed() +{ + notImplemented(); +} + +DragSourceAction DragClientHaiku::dragSourceActionMaskForPoint(const IntPoint&) +{ + notImplemented(); + return DragSourceActionAny; +} + +void DragClientHaiku::willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*) +{ + notImplemented(); +} + +void DragClientHaiku::startDrag(DragImageRef dragImage, const IntPoint&, const IntPoint&, Clipboard*, Frame*, bool) +{ + notImplemented(); +} + +DragImageRef DragClientHaiku::createDragImageForLink(KURL&, const String&, Frame*) +{ + notImplemented(); + return 0; +} + +} // namespace WebCore + diff --git a/Source/WebKit/haiku/WebCoreSupport/DragClientHaiku.h b/Source/WebKit/haiku/WebCoreSupport/DragClientHaiku.h new file mode 100644 index 0000000..b184322 --- /dev/null +++ b/Source/WebKit/haiku/WebCoreSupport/DragClientHaiku.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2007 Ryan Leavengood + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "DragClient.h" + + +namespace WebCore { + + class DragClientHaiku : public DragClient { + public: + virtual void willPerformDragDestinationAction(DragDestinationAction, + DragData*); + virtual WebCore::DragDestinationAction actionMaskForDrag(DragData*); + virtual void dragControllerDestroyed(); + virtual DragSourceAction dragSourceActionMaskForPoint(const IntPoint&); + virtual void willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*); + virtual void startDrag(DragImageRef dragImage, const IntPoint& dragImageOrigin, + const IntPoint& eventPos, Clipboard*, Frame*, bool linkDrag = false); + virtual DragImageRef createDragImageForLink(KURL&, const String& label, Frame*); + }; + +} // namespace WebCore + diff --git a/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp b/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp new file mode 100644 index 0000000..2b175d8 --- /dev/null +++ b/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp @@ -0,0 +1,484 @@ +/* + * Copyright (C) 2006 Nikolas Zimmermann + * Copyright (C) 2006 Zack Rusin + * Copyright (C) 2006 Apple Computer, Inc. + * Copyright (C) 2007 Ryan Leavengood + * Copyright (C) 2007 Andrea Anzani + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "EditorClientHaiku.h" + +#include "Document.h" +#include "Editor.h" +#include "FocusController.h" +#include "Frame.h" +#include "KeyboardEvent.h" +#include "NotImplemented.h" +#include "Page.h" +#include "PlatformKeyboardEvent.h" +#include "WindowsKeyboardCodes.h" + + +namespace WebCore { + +EditorClientHaiku::EditorClientHaiku() + : m_editing(false) + , m_inUndoRedo(false) +{ +} + +void EditorClientHaiku::setPage(Page* page) +{ + m_page = page; +} + +void EditorClientHaiku::pageDestroyed() +{ + notImplemented(); +} + +bool EditorClientHaiku::shouldDeleteRange(Range*) +{ + notImplemented(); + return true; +} + +bool EditorClientHaiku::shouldShowDeleteInterface(HTMLElement*) +{ + notImplemented(); + return false; +} + +bool EditorClientHaiku::smartInsertDeleteEnabled() +{ + notImplemented(); + return false; +} + +bool EditorClientHaiku::isSelectTrailingWhitespaceEnabled() +{ + notImplemented(); + return false; +} + +bool EditorClientHaiku::isContinuousSpellCheckingEnabled() +{ + notImplemented(); + return false; +} + +void EditorClientHaiku::toggleContinuousSpellChecking() +{ + notImplemented(); +} + +bool EditorClientHaiku::isGrammarCheckingEnabled() +{ + notImplemented(); + return false; +} + +void EditorClientHaiku::toggleGrammarChecking() +{ + notImplemented(); +} + +int EditorClientHaiku::spellCheckerDocumentTag() +{ + notImplemented(); + return 0; +} + +bool EditorClientHaiku::isEditable() +{ + // FIXME: should be controllable + return false; +} + +bool EditorClientHaiku::shouldBeginEditing(WebCore::Range*) +{ + notImplemented(); + return true; +} + +bool EditorClientHaiku::shouldEndEditing(WebCore::Range*) +{ + notImplemented(); + return true; +} + +bool EditorClientHaiku::shouldInsertNode(Node*, Range*, EditorInsertAction) +{ + notImplemented(); + return true; +} + +bool EditorClientHaiku::shouldInsertText(const String&, Range*, EditorInsertAction) +{ + notImplemented(); + return true; +} + +bool EditorClientHaiku::shouldChangeSelectedRange(Range* fromRange, Range* toRange, + EAffinity, bool stillSelecting) +{ + notImplemented(); + return true; +} + +bool EditorClientHaiku::shouldApplyStyle(WebCore::CSSStyleDeclaration*, + WebCore::Range*) +{ + notImplemented(); + return true; +} + +bool EditorClientHaiku::shouldMoveRangeAfterDelete(Range*, Range*) +{ + notImplemented(); + return true; +} + +void EditorClientHaiku::didBeginEditing() +{ + notImplemented(); + m_editing = true; +} + +void EditorClientHaiku::respondToChangedContents() +{ + notImplemented(); +} + +void EditorClientHaiku::respondToChangedSelection() +{ + notImplemented(); +} + +void EditorClientHaiku::didEndEditing() +{ + notImplemented(); + m_editing = false; +} + +void EditorClientHaiku::didWriteSelectionToPasteboard() +{ + notImplemented(); +} + +void EditorClientHaiku::didSetSelectionTypesForPasteboard() +{ + notImplemented(); +} + +void EditorClientHaiku::registerCommandForUndo(WTF::PassRefPtr cmd) +{ + notImplemented(); +} + +void EditorClientHaiku::registerCommandForRedo(WTF::PassRefPtr) +{ + notImplemented(); +} + +void EditorClientHaiku::clearUndoRedoOperations() +{ + notImplemented(); +} + +bool EditorClientHaiku::canUndo() const +{ + notImplemented(); + return false; +} + +bool EditorClientHaiku::canRedo() const +{ + notImplemented(); + return false; +} + +void EditorClientHaiku::undo() +{ + notImplemented(); + m_inUndoRedo = true; + m_inUndoRedo = false; +} + +void EditorClientHaiku::redo() +{ + notImplemented(); + m_inUndoRedo = true; + m_inUndoRedo = false; +} + +void EditorClientHaiku::handleKeyboardEvent(KeyboardEvent* event) +{ + Frame* frame = m_page->focusController()->focusedOrMainFrame(); + if (!frame || !frame->document()->focusedNode()) + return; + + const PlatformKeyboardEvent* kevent = event->keyEvent(); + if (!kevent || kevent->type() == PlatformKeyboardEvent::KeyUp) + return; + + Node* start = frame->selection()->start().node(); + if (!start) + return; + + if (start->isContentEditable()) { + switch (kevent->windowsVirtualKeyCode()) { + case VK_BACK: + frame->editor()->deleteWithDirection(DirectionBackward, + kevent->ctrlKey() ? WordGranularity : CharacterGranularity, + false, true); + break; + case VK_DELETE: + frame->editor()->deleteWithDirection(DirectionForward, + kevent->ctrlKey() ? WordGranularity : CharacterGranularity, + false, true); + break; + case VK_LEFT: + frame->selection()->modify(kevent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove, + DirectionLeft, + kevent->ctrlKey() ? WordGranularity : CharacterGranularity, + true); + break; + case VK_RIGHT: + frame->selection()->modify(kevent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove, + DirectionRight, + kevent->ctrlKey() ? WordGranularity : CharacterGranularity, + true); + break; + case VK_UP: + frame->selection()->modify(kevent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove, + DirectionBackward, + kevent->ctrlKey() ? ParagraphGranularity : LineGranularity, + true); + break; + case VK_DOWN: + frame->selection()->modify(kevent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove, + DirectionForward, + kevent->ctrlKey() ? ParagraphGranularity : LineGranularity, + true); + break; + case VK_PRIOR: // PageUp + frame->editor()->command("MoveUpByPageAndModifyCaret"); + break; + case VK_NEXT: // PageDown + frame->editor()->command("MoveDownByPageAndModifyCaret"); + break; + case VK_RETURN: + frame->editor()->command("InsertLineBreak"); + break; + case VK_TAB: + return; + default: + if (!kevent->ctrlKey() && !kevent->altKey() && !kevent->text().isEmpty()) { + if (kevent->text().length() == 1) { + UChar ch = kevent->text()[0]; + // Don't insert null or control characters as they can result in unexpected behaviour + if (ch < ' ') + break; + } + frame->editor()->insertText(kevent->text(), event); + } else if (kevent->ctrlKey()) { + switch (kevent->windowsVirtualKeyCode()) { + case VK_A: + frame->editor()->command("SelectAll"); + break; + case VK_B: + frame->editor()->command("ToggleBold"); + break; + case VK_C: + frame->editor()->command("Copy"); + break; + case VK_I: + frame->editor()->command("ToggleItalic"); + break; + case VK_V: + frame->editor()->command("Paste"); + break; + case VK_X: + frame->editor()->command("Cut"); + break; + case VK_Y: + frame->editor()->command("Redo"); + break; + case VK_Z: + frame->editor()->command("Undo"); + break; + default: + return; + } + } else + return; + } + } else { + switch (kevent->windowsVirtualKeyCode()) { + case VK_UP: + frame->editor()->command("MoveUp"); + break; + case VK_DOWN: + frame->editor()->command("MoveDown"); + break; + case VK_PRIOR: // PageUp + frame->editor()->command("MoveUpByPageAndModifyCaret"); + break; + case VK_NEXT: // PageDown + frame->editor()->command("MoveDownByPageAndModifyCaret"); + break; + case VK_HOME: + if (kevent->ctrlKey()) + frame->editor()->command("MoveToBeginningOfDocument"); + break; + case VK_END: + if (kevent->ctrlKey()) + frame->editor()->command("MoveToEndOfDocument"); + break; + default: + if (kevent->ctrlKey()) { + switch (kevent->windowsVirtualKeyCode()) { + case VK_A: + frame->editor()->command("SelectAll"); + break; + case VK_C: case VK_X: + frame->editor()->command("Copy"); + break; + default: + return; + } + } else + return; + } + } + event->setDefaultHandled(); +} + +void EditorClientHaiku::handleInputMethodKeydown(KeyboardEvent*) +{ + notImplemented(); +} + +void EditorClientHaiku::textFieldDidBeginEditing(Element*) +{ + m_editing = true; +} + +void EditorClientHaiku::textFieldDidEndEditing(Element*) +{ + m_editing = false; +} + +void EditorClientHaiku::textDidChangeInTextField(Element*) +{ + notImplemented(); +} + +bool EditorClientHaiku::doTextFieldCommandFromEvent(Element*, KeyboardEvent*) +{ + return false; +} + +void EditorClientHaiku::textWillBeDeletedInTextField(Element*) +{ + notImplemented(); +} + +void EditorClientHaiku::textDidChangeInTextArea(Element*) +{ + notImplemented(); +} + +void EditorClientHaiku::ignoreWordInSpellDocument(const String&) +{ + notImplemented(); +} + +void EditorClientHaiku::learnWord(const String&) +{ + notImplemented(); +} + +void EditorClientHaiku::checkSpellingOfString(const UChar*, int, int*, int*) +{ + notImplemented(); +} + +String EditorClientHaiku::getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord) +{ + notImplemented(); + return String(); +} + +void EditorClientHaiku::checkGrammarOfString(const UChar*, int, Vector&, int*, int*) +{ + notImplemented(); +} + +void EditorClientHaiku::updateSpellingUIWithGrammarString(const String&, const GrammarDetail&) +{ + notImplemented(); +} + +void EditorClientHaiku::updateSpellingUIWithMisspelledWord(const String&) +{ + notImplemented(); +} + +void EditorClientHaiku::showSpellingUI(bool) +{ + notImplemented(); +} + +bool EditorClientHaiku::spellingUIIsShowing() +{ + notImplemented(); + return false; +} + +void EditorClientHaiku::getGuessesForWord(const String& word, const String& context, Vector& guesses) +{ + notImplemented(); +} + +void EditorClientHaiku::willSetInputMethodState() +{ + notImplemented(); +} + +void EditorClientHaiku::setInputMethodState(bool enabled) +{ + notImplemented(); +} + +bool EditorClientHaiku::isEditing() const +{ + return m_editing; +} + +} // namespace WebCore diff --git a/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h b/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h new file mode 100644 index 0000000..ca270e9 --- /dev/null +++ b/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2006 Nikolas Zimmermann + * Copyright (C) 2006 Zack Rusin + * Copyright (C) 2006 Apple Computer, Inc. + * Copyright (C) 2007 Ryan Leavengood + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef EditorClientHaiku_H +#define EditorClientHaiku_H + +#include "EditorClient.h" +#include "RefCounted.h" +#include "Page.h" + +#include + + +namespace WebCore { + + class EditorClientHaiku : public EditorClient { + public: + EditorClientHaiku(); + void setPage( Page* page ); + + virtual void pageDestroyed(); + + virtual bool shouldDeleteRange(Range*); + virtual bool shouldShowDeleteInterface(HTMLElement*); + virtual bool smartInsertDeleteEnabled(); + virtual bool isSelectTrailingWhitespaceEnabled(); + virtual bool isContinuousSpellCheckingEnabled(); + virtual void toggleContinuousSpellChecking(); + virtual bool isGrammarCheckingEnabled(); + virtual void toggleGrammarChecking(); + virtual int spellCheckerDocumentTag(); + + virtual bool isEditable(); + + virtual bool shouldBeginEditing(Range*); + virtual bool shouldEndEditing(Range*); + virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction); + virtual bool shouldInsertText(const String&, Range*, EditorInsertAction); + virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, + EAffinity, bool stillSelecting); + + virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*); + virtual bool shouldMoveRangeAfterDelete(Range*, Range*); + + virtual void didBeginEditing(); + virtual void respondToChangedContents(); + virtual void respondToChangedSelection(); + virtual void didEndEditing(); + virtual void didWriteSelectionToPasteboard(); + virtual void didSetSelectionTypesForPasteboard(); + + virtual void registerCommandForUndo(PassRefPtr); + virtual void registerCommandForRedo(PassRefPtr); + virtual void clearUndoRedoOperations(); + + virtual bool canUndo() const; + virtual bool canRedo() const; + + virtual void undo(); + virtual void redo(); + + virtual void handleKeyboardEvent(KeyboardEvent*); + virtual void handleInputMethodKeydown(KeyboardEvent*); + + virtual void textFieldDidBeginEditing(Element*); + virtual void textFieldDidEndEditing(Element*); + virtual void textDidChangeInTextField(Element*); + virtual bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*); + virtual void textWillBeDeletedInTextField(Element*); + virtual void textDidChangeInTextArea(Element*); + + virtual void ignoreWordInSpellDocument(const String&); + virtual void learnWord(const String&); + virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, + int* misspellingLength); + virtual String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord); + virtual void checkGrammarOfString(const UChar*, int length, Vector&, + int* badGrammarLocation, int* badGrammarLength); + virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&); + virtual void updateSpellingUIWithMisspelledWord(const String&); + virtual void showSpellingUI(bool show); + virtual bool spellingUIIsShowing(); + virtual void getGuessesForWord(const String& word, const String& context, Vector& guesses); + virtual void willSetInputMethodState(); + virtual void setInputMethodState(bool enabled); + virtual void requestCheckingOfString(SpellChecker*, int, const String&) {} + + bool isEditing() const; + + private: + Page* m_page; + bool m_editing; + bool m_inUndoRedo; // our undo stack works differently - don't re-enter! + }; + +} // namespace WebCore + +#endif // EditorClientHaiku_h diff --git a/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp b/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp new file mode 100644 index 0000000..48c65a1 --- /dev/null +++ b/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp @@ -0,0 +1,872 @@ +/* + * Copyright (C) 2006 Don Gibson + * Copyright (C) 2006 Zack Rusin + * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2007 Trolltech ASA + * Copyright (C) 2007 Ryan Leavengood All rights reserved. + * Copyright (C) 2009 Maxime Simon All rights reserved. + * + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "FrameLoaderClientHaiku.h" + +#include "DocumentLoader.h" +#include "Frame.h" +#include "FrameLoader.h" +#include "FrameTree.h" +#include "FrameView.h" +#include "HTMLFrameOwnerElement.h" +#include "NotImplemented.h" +#include "Page.h" +#include "PlatformString.h" +#include "ResourceRequest.h" +#include "ScriptController.h" +#include "WebView.h" + +#include +#include + +#include + + +namespace WebCore { + +FrameLoaderClientHaiku::FrameLoaderClientHaiku() + : m_frame(0) +{ +} + +void FrameLoaderClientHaiku::setFrame(Frame* frame) +{ + m_frame = frame; +} + +void FrameLoaderClientHaiku::setWebView(WebView* webview) +{ + m_webView = webview; + m_messenger = new BMessenger(m_webView); + ASSERT(m_messenger->IsValid()); +} + +void FrameLoaderClientHaiku::detachFrameLoader() +{ + m_frame = 0; +} + +bool FrameLoaderClientHaiku::hasWebView() const +{ + return m_webView; +} + +bool FrameLoaderClientHaiku::hasBackForwardList() const +{ + notImplemented(); + return true; +} + +void FrameLoaderClientHaiku::resetBackForwardList() +{ + notImplemented(); +} + +bool FrameLoaderClientHaiku::provisionalItemIsTarget() const +{ + notImplemented(); + return false; +} + +void FrameLoaderClientHaiku::makeRepresentation(DocumentLoader*) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::forceLayout() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::forceLayoutForNonHTML() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::updateHistoryForCommit() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::updateHistoryForBackForwardNavigation() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::updateHistoryForReload() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::updateHistoryForStandardLoad() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::updateHistoryForInternalLoad() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::updateHistoryAfterClientRedirect() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::setCopiesOnScroll() +{ + // apparently mac specific + notImplemented(); +} + +LoadErrorResetToken* FrameLoaderClientHaiku::tokenForLoadErrorReset() +{ + notImplemented(); + return 0; +} + +void FrameLoaderClientHaiku::resetAfterLoadError(LoadErrorResetToken*) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::doNotResetAfterLoadError(LoadErrorResetToken*) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::willCloseDocument() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::detachedFromParent2() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::detachedFromParent3() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidHandleOnloadEvents() +{ + if (m_webView) { + BMessage message(LOAD_ONLOAD_HANDLE); + message.AddString("url", m_frame->loader()->documentLoader()->request().url().string()); + m_messenger->SendMessage(&message); + } +} + +void FrameLoaderClientHaiku::dispatchDidReceiveServerRedirectForProvisionalLoad() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidCancelClientRedirect() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchWillPerformClientRedirect(const KURL&, double interval, double fireDate) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidChangeLocationWithinPage() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidPushStateWithinPage() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidReplaceStateWithinPage() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidPopStateWithinPage() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchWillClose() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidStartProvisionalLoad() +{ + if (m_webView) { + BMessage message(LOAD_NEGOCIATING); + message.AddString("url", m_frame->loader()->provisionalDocumentLoader()->request().url().string()); + m_messenger->SendMessage(&message); + } +} + +void FrameLoaderClientHaiku::dispatchDidReceiveTitle(const String& title) +{ + if (m_webView) { + m_webView->SetPageTitle(title); + + BMessage message(TITLE_CHANGED); + message.AddString("title", title); + m_messenger->SendMessage(&message); + } +} + +void FrameLoaderClientHaiku::dispatchDidCommitLoad() +{ + if (m_webView) { + BMessage message(LOAD_TRANSFERRING); + message.AddString("url", m_frame->loader()->documentLoader()->request().url().string()); + m_messenger->SendMessage(&message); + } +} + +void FrameLoaderClientHaiku::dispatchDidFinishDocumentLoad() +{ + if (m_webView) { + BMessage message(LOAD_DOC_COMPLETED); + message.AddString("url", m_frame->loader()->url().string()); + m_messenger->SendMessage(&message); + } +} + +void FrameLoaderClientHaiku::dispatchDidFinishLoad() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidFirstLayout() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidFirstVisuallyNonEmptyLayout() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchShow() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::cancelPolicyCheck() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchWillSubmitForm(FramePolicyFunction function, PassRefPtr) +{ + // FIXME: Send an event to allow for alerts and cancellation. + if (!m_frame) + return; + (m_frame->loader()->policyChecker()->*function)(PolicyUse); +} + +void FrameLoaderClientHaiku::dispatchDidLoadMainResource(DocumentLoader*) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::revertToProvisionalState(DocumentLoader*) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::postProgressStartedNotification() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::postProgressEstimateChangedNotification() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::postProgressFinishedNotification() +{ + if (m_webView) { + BMessage message(LOAD_DL_COMPLETED); + message.AddString("url", m_frame->loader()->url().string()); + m_messenger->SendMessage(&message); + } +} + +void FrameLoaderClientHaiku::progressStarted() +{ + notImplemented(); +} + + +void FrameLoaderClientHaiku::progressCompleted() +{ + notImplemented(); +} + + +void FrameLoaderClientHaiku::setMainFrameDocumentReady(bool) +{ + notImplemented(); + // this is only interesting once we provide an external API for the DOM +} + +void FrameLoaderClientHaiku::willChangeTitle(DocumentLoader*) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::didChangeTitle(DocumentLoader* docLoader) +{ + setTitle(docLoader->title(), docLoader->url()); +} + +void FrameLoaderClientHaiku::finishedLoading(DocumentLoader*) +{ + notImplemented(); +} + +bool FrameLoaderClientHaiku::canShowMIMETypeAsHTML(const String& MIMEType) const +{ + notImplemented(); + return false; +} + +bool FrameLoaderClientHaiku::canShowMIMEType(const String& MIMEType) const +{ + notImplemented(); + return true; +} + +bool FrameLoaderClientHaiku::representationExistsForURLScheme(const String& URLScheme) const +{ + notImplemented(); + return false; +} + +String FrameLoaderClientHaiku::generatedMIMETypeForURLScheme(const String& URLScheme) const +{ + notImplemented(); + return String(); +} + +void FrameLoaderClientHaiku::frameLoadCompleted() +{ + if (m_webView->LockLooper()) { + m_webView->Draw(m_webView->Bounds()); + m_webView->UnlockLooper(); + } +} + +void FrameLoaderClientHaiku::saveViewStateToItem(HistoryItem*) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::restoreViewState() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::restoreScrollPositionAndViewState() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::provisionalLoadStarted() +{ + notImplemented(); +} + +bool FrameLoaderClientHaiku::shouldTreatURLAsSameAsCurrent(const KURL&) const +{ + notImplemented(); + return false; +} + +void FrameLoaderClientHaiku::addHistoryItemForFragmentScroll() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::didFinishLoad() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::prepareForDataSourceReplacement() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::setTitle(const String& title, const KURL&) +{ + notImplemented(); +} + +String FrameLoaderClientHaiku::userAgent(const KURL&) +{ + return String("Mozilla/5.0 (compatible; U; InfiNet 0.1; Haiku) AppleWebKit/420+ (KHTML, like Gecko)"); +} + +void FrameLoaderClientHaiku::dispatchDidReceiveIcon() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::frameLoaderDestroyed() +{ + m_frame = 0; + m_messenger = 0; + delete this; +} + +bool FrameLoaderClientHaiku::canHandleRequest(const WebCore::ResourceRequest&) const +{ + notImplemented(); + return true; +} + +void FrameLoaderClientHaiku::partClearedInBegin() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::updateGlobalHistory() +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::updateGlobalHistoryRedirectLinks() +{ + notImplemented(); +} + +bool FrameLoaderClientHaiku::shouldGoToHistoryItem(WebCore::HistoryItem*) const +{ + notImplemented(); + return true; +} + +void FrameLoaderClientHaiku::dispatchDidAddBackForwardItem(WebCore::HistoryItem*) const +{ +} + +void FrameLoaderClientHaiku::dispatchDidRemoveBackForwardItem(WebCore::HistoryItem*) const +{ +} + +void FrameLoaderClientHaiku::dispatchDidChangeBackForwardIndex() const +{ +} + +void FrameLoaderClientHaiku::saveScrollPositionAndViewStateToItem(WebCore::HistoryItem*) +{ + notImplemented(); +} + +bool FrameLoaderClientHaiku::canCachePage() const +{ + return false; +} + +void FrameLoaderClientHaiku::setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length) +{ + loader->commitData(data, length); +} + +WebCore::ResourceError FrameLoaderClientHaiku::cancelledError(const WebCore::ResourceRequest& request) +{ + notImplemented(); + return ResourceError(String(), WebKitErrorCannotShowURL, request.url().string(), String()); +} + +WebCore::ResourceError FrameLoaderClientHaiku::blockedError(const ResourceRequest& request) +{ + notImplemented(); + return ResourceError(String(), WebKitErrorCannotShowURL, request.url().string(), String()); +} + +WebCore::ResourceError FrameLoaderClientHaiku::cannotShowURLError(const WebCore::ResourceRequest& request) +{ + return ResourceError(String(), WebKitErrorCannotShowURL, request.url().string(), String()); +} + +WebCore::ResourceError FrameLoaderClientHaiku::interruptForPolicyChangeError(const WebCore::ResourceRequest& request) +{ + notImplemented(); + return ResourceError(String(), WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(), String()); +} + +WebCore::ResourceError FrameLoaderClientHaiku::cannotShowMIMETypeError(const WebCore::ResourceResponse& response) +{ + notImplemented(); + return ResourceError(String(), WebKitErrorCannotShowMIMEType, response.url().string(), String()); +} + +WebCore::ResourceError FrameLoaderClientHaiku::fileDoesNotExistError(const WebCore::ResourceResponse& response) +{ + notImplemented(); + return ResourceError(String(), WebKitErrorCannotShowURL, response.url().string(), String()); +} + +bool FrameLoaderClientHaiku::shouldFallBack(const WebCore::ResourceError& error) +{ + notImplemented(); + return false; +} + +WTF::PassRefPtr FrameLoaderClientHaiku::createDocumentLoader(const ResourceRequest& request, + const SubstituteData& substituteData) +{ + return DocumentLoader::create(request, substituteData); +} + +void FrameLoaderClientHaiku::download(ResourceHandle*, const ResourceRequest&, + const ResourceRequest&, const ResourceResponse&) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, + const ResourceRequest&) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest& request, + const ResourceResponse& response) +{ + notImplemented(); +} + +bool FrameLoaderClientHaiku::shouldUseCredentialStorage(DocumentLoader*, unsigned long) +{ + notImplemented(); + return false; +} + +void FrameLoaderClientHaiku::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, + unsigned long, const AuthenticationChallenge&) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidCancelAuthenticationChallenge(DocumentLoader*, + unsigned long, const AuthenticationChallenge&) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long id, + const ResourceResponse& response) +{ + notImplemented(); + m_response = response; + m_firstData = true; +} + +void FrameLoaderClientHaiku::dispatchDidReceiveContentLength(DocumentLoader* loader, + unsigned long id, int length) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidFinishLoading(DocumentLoader*, unsigned long) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidFailLoading(DocumentLoader* loader, + unsigned long, const ResourceError&) +{ + if (m_webView) { + BMessage message(LOAD_FAILED); + message.AddString("url", m_frame->loader()->documentLoader()->request().url().string()); + m_messenger->SendMessage(&message); + } +} + +bool FrameLoaderClientHaiku::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, + const ResourceRequest&, + const ResourceResponse&, int) +{ + notImplemented(); + return false; +} + +void FrameLoaderClientHaiku::dispatchDidFailProvisionalLoad(const ResourceError&) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::dispatchDidFailLoad(const ResourceError&) +{ + notImplemented(); +} + +Frame* FrameLoaderClientHaiku::dispatchCreatePage(const WebCore::NavigationAction&) +{ + notImplemented(); + return false; +} + +void FrameLoaderClientHaiku::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, + const String& mimetype, + const ResourceRequest& request) +{ + if (!m_frame) + return; + + notImplemented(); + (m_frame->loader()->policyChecker()->*function)(PolicyUse); +} + +void FrameLoaderClientHaiku::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, + const NavigationAction&, + const ResourceRequest& request, + PassRefPtr, const String& targetName) +{ + if (!m_frame) + return; + + if (m_webView) { + BMessage message(NEW_WINDOW_REQUESTED); + message.AddString("url", request.url().string()); + if (m_messenger->SendMessage(&message)) { + (m_frame->loader()->policyChecker()->*function)(PolicyIgnore); + return; + } + } + + (m_frame->loader()->policyChecker()->*function)(PolicyUse); +} + +void FrameLoaderClientHaiku::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, + const NavigationAction& action, + const ResourceRequest& request, + PassRefPtr) +{ + if (!m_frame || !function) + return; + + if (m_webView) { + BMessage message(NAVIGATION_REQUESTED); + message.AddString("url", request.url().string()); + m_messenger->SendMessage(&message); + + (m_frame->loader()->policyChecker()->*function)(PolicyUse); + } +} + +void FrameLoaderClientHaiku::dispatchUnableToImplementPolicy(const ResourceError&) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::startDownload(const ResourceRequest&) +{ + notImplemented(); +} + +PassRefPtr FrameLoaderClientHaiku::createFrame(const KURL& url, const String& name, + HTMLFrameOwnerElement* ownerElement, + const String& referrer, bool allowsScrolling, + int marginWidth, int marginHeight) +{ + // FIXME: We should apply the right property to the frameView. (scrollbar,margins) + + RefPtr childFrame = Frame::create(m_frame->page(), ownerElement, this); + setFrame(childFrame.get()); + + RefPtr frameView = FrameView::create(childFrame.get()); + + frameView->setAllowsScrolling(allowsScrolling); + frameView->deref(); + childFrame->setView(frameView.get()); + childFrame->init(); + + childFrame->tree()->setName(name); + m_frame->tree()->appendChild(childFrame); + + childFrame->loader()->loadURLIntoChildFrame(url, referrer, childFrame.get()); + + // The frame's onload handler may have removed it from the document. + if (!childFrame->tree()->parent()) + return 0; + + return childFrame.release(); + + notImplemented(); + return 0; +} + +void FrameLoaderClientHaiku::didTransferChildFrameToNewDocument(Page*) +{ +} + +void FrameLoaderClientHaiku::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*) +{ +} + +ObjectContentType FrameLoaderClientHaiku::objectContentType(const KURL& url, const String& mimeType) +{ + notImplemented(); + return ObjectContentType(); +} + +PassRefPtr FrameLoaderClientHaiku::createPlugin(const IntSize&, HTMLPlugInElement*, + const KURL&, const Vector&, + const Vector&, const String&, + bool loadManually) +{ + notImplemented(); + return 0; +} + +void FrameLoaderClientHaiku::redirectDataToPlugin(Widget* pluginWidget) +{ + notImplemented(); + return; +} + +ResourceError FrameLoaderClientHaiku::pluginWillHandleLoadError(const ResourceResponse& response) +{ + notImplemented(); + return ResourceError(String(), WebKitErrorCannotLoadPlugIn, response.url().string(), String()); +} + +PassRefPtr FrameLoaderClientHaiku::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, + const KURL& baseURL, + const Vector& paramNames, + const Vector& paramValues) +{ + notImplemented(); + return 0; +} + +String FrameLoaderClientHaiku::overrideMediaType() const +{ + notImplemented(); + return String(); +} + +void FrameLoaderClientHaiku::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world) +{ + if (world != mainThreadNormalWorld()) + return; + + if (m_webView) { + BMessage message(JAVASCRIPT_WINDOW_OBJECT_CLEARED); + m_messenger->SendMessage(&message); + } +} + +void FrameLoaderClientHaiku::documentElementAvailable() +{ +} + +void FrameLoaderClientHaiku::didPerformFirstNavigation() const +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::registerForIconNotification(bool listen) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::savePlatformDataToCachedFrame(CachedFrame*) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::transitionToCommittedFromCachedFrame(CachedFrame*) +{ + notImplemented(); +} + +void FrameLoaderClientHaiku::transitionToCommittedForNewPage() +{ + ASSERT(m_frame); + ASSERT(m_webView); + + Page* page = m_frame->page(); + ASSERT(page); + + bool isMainFrame = m_frame == page->mainFrame(); + + m_frame->setView(0); + + RefPtr frameView; + if (isMainFrame) { + if (m_webView->LockLooper()) { + // We lock the looper in order to get the bounds of the WebView. + frameView = FrameView::create(m_frame, IntRect(m_webView->Bounds()).size()); + m_webView->UnlockLooper(); + } + } else + frameView = FrameView::create(m_frame); + + ASSERT(frameView); + m_frame->setView(frameView); + + frameView->setPlatformWidget(m_webView); + + if (HTMLFrameOwnerElement* owner = m_frame->ownerElement()) + m_frame->view()->setScrollbarModes(owner->scrollingMode(), owner->scrollingMode()); +} + +void FrameLoaderClientHaiku::didSaveToPageCache() +{ +} + +void FrameLoaderClientHaiku::didRestoreFromPageCache() +{ +} + +void FrameLoaderClientHaiku::dispatchDidBecomeFrameset(bool) +{ +} + +} // namespace WebCore diff --git a/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h b/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h new file mode 100644 index 0000000..e54ba03 --- /dev/null +++ b/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h @@ -0,0 +1,260 @@ +/* + * Copyright (C) 2006 Zack Rusin + * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2007 Ryan Leavengood All rights reserved. + * + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FrameLoaderClientHaiku_h +#define FrameLoaderClientHaiku_h + +#include "FrameLoader.h" +#include "FrameLoaderClient.h" +#include "KURL.h" +#include "ResourceResponse.h" +#include + +class BMessenger; +class WebView; + +namespace WebCore { + class AuthenticationChallenge; + class DocumentLoader; + class Element; + class FormState; + class NavigationAction; + class ResourceLoader; + + struct LoadErrorResetToken; + + class FrameLoaderClientHaiku : public FrameLoaderClient { + public: + FrameLoaderClientHaiku(); + ~FrameLoaderClientHaiku() { } + void setFrame(Frame*); + void setWebView(WebView*); + virtual void detachFrameLoader(); + + virtual bool hasWebView() const; + + virtual bool hasBackForwardList() const; + virtual void resetBackForwardList(); + + virtual bool provisionalItemIsTarget() const; + + virtual void makeRepresentation(DocumentLoader*); + virtual void forceLayout(); + virtual void forceLayoutForNonHTML(); + + virtual void updateHistoryForCommit(); + + virtual void updateHistoryForBackForwardNavigation(); + virtual void updateHistoryForReload(); + virtual void updateHistoryForStandardLoad(); + virtual void updateHistoryForInternalLoad(); + + virtual void updateHistoryAfterClientRedirect(); + + virtual void setCopiesOnScroll(); + + virtual LoadErrorResetToken* tokenForLoadErrorReset(); + virtual void resetAfterLoadError(LoadErrorResetToken*); + virtual void doNotResetAfterLoadError(LoadErrorResetToken*); + + virtual void willCloseDocument(); + + virtual void detachedFromParent2(); + virtual void detachedFromParent3(); + + virtual void frameLoaderDestroyed(); + + virtual bool canHandleRequest(const ResourceRequest&) const; + + virtual void dispatchDidHandleOnloadEvents(); + virtual void dispatchDidReceiveServerRedirectForProvisionalLoad(); + virtual void dispatchDidCancelClientRedirect(); + virtual void dispatchWillPerformClientRedirect(const KURL&, double interval, double fireDate); + virtual void dispatchDidChangeLocationWithinPage(); + virtual void dispatchDidPushStateWithinPage(); + virtual void dispatchDidReplaceStateWithinPage(); + virtual void dispatchDidPopStateWithinPage(); + virtual void dispatchWillClose(); + virtual void dispatchDidReceiveIcon(); + virtual void dispatchDidStartProvisionalLoad(); + virtual void dispatchDidReceiveTitle(const String& title); + virtual void dispatchDidCommitLoad(); + virtual void dispatchDidFinishDocumentLoad(); + virtual void dispatchDidFinishLoad(); + virtual void dispatchDidFirstLayout(); + virtual void dispatchDidFirstVisuallyNonEmptyLayout(); + + virtual void dispatchShow(); + virtual void cancelPolicyCheck(); + + virtual void dispatchWillSendSubmitEvent(HTMLFormElement*) { } + virtual void dispatchWillSubmitForm(FramePolicyFunction, PassRefPtr); + + virtual void dispatchDidLoadMainResource(DocumentLoader*); + virtual void revertToProvisionalState(DocumentLoader*); + + virtual void postProgressStartedNotification(); + virtual void postProgressEstimateChangedNotification(); + virtual void postProgressFinishedNotification(); + + virtual void progressStarted(); + virtual void progressCompleted(); + virtual void setMainFrameDocumentReady(bool); + virtual void willChangeTitle(DocumentLoader*); + virtual void didChangeTitle(DocumentLoader*); + virtual void finishedLoading(DocumentLoader*); + + virtual bool canShowMIMEType(const String& MIMEType) const; + virtual bool canShowMIMETypeAsHTML(const String& MIMEType) const; + virtual bool representationExistsForURLScheme(const String& URLScheme) const; + virtual String generatedMIMETypeForURLScheme(const String& URLScheme) const; + + virtual void frameLoadCompleted(); + virtual void saveViewStateToItem(HistoryItem*); + virtual void restoreViewState(); + virtual void restoreScrollPositionAndViewState(); + virtual void provisionalLoadStarted(); + virtual bool shouldTreatURLAsSameAsCurrent(const KURL&) const; + virtual void addHistoryItemForFragmentScroll(); + virtual void didFinishLoad(); + virtual void prepareForDataSourceReplacement(); + virtual void setTitle(const String& title, const KURL&); + + virtual String userAgent(const KURL&); + + virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); + virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); + virtual void transitionToCommittedForNewPage(); + + virtual void didSaveToPageCache(); + virtual void didRestoreFromPageCache(); + + virtual void dispatchDidBecomeFrameset(bool); + + virtual void updateGlobalHistory(); + virtual void updateGlobalHistoryRedirectLinks(); + virtual bool shouldGoToHistoryItem(HistoryItem*) const; + virtual void dispatchDidAddBackForwardItem(HistoryItem*) const; + virtual void dispatchDidRemoveBackForwardItem(HistoryItem*) const; + virtual void dispatchDidChangeBackForwardIndex() const; + virtual void saveScrollPositionAndViewStateToItem(HistoryItem*); + virtual bool canCachePage() const; + + virtual void setMainDocumentError(DocumentLoader*, const ResourceError&); + virtual void committedLoad(DocumentLoader*, const char*, int); + virtual ResourceError cancelledError(const ResourceRequest&); + virtual ResourceError blockedError(const ResourceRequest&); + virtual ResourceError cannotShowURLError(const ResourceRequest&); + virtual ResourceError interruptForPolicyChangeError(const ResourceRequest&); + virtual ResourceError cannotShowMIMETypeError(const ResourceResponse&); + virtual ResourceError fileDoesNotExistError(const ResourceResponse&); + virtual bool shouldFallBack(const ResourceError&); + virtual WTF::PassRefPtr createDocumentLoader(const ResourceRequest&, + const SubstituteData&); + virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, + const ResourceResponse&); + + virtual void assignIdentifierToInitialRequest(unsigned long identifier, + DocumentLoader*, + const ResourceRequest&); + + virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, + const ResourceResponse&); + virtual bool shouldUseCredentialStorage(DocumentLoader*, unsigned long identifier); + virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, + unsigned long identifier, + const AuthenticationChallenge&); + virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, + unsigned long identifier, + const AuthenticationChallenge&); + virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long, + const ResourceResponse&); + virtual void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long, int); + virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long); + virtual void dispatchDidFailLoading(DocumentLoader*, unsigned long, + const ResourceError&); + virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, + const ResourceRequest&, + const ResourceResponse&, int); + + virtual void dispatchDidFailProvisionalLoad(const ResourceError&); + virtual void dispatchDidFailLoad(const ResourceError&); + virtual Frame* dispatchCreatePage(const NavigationAction&); + virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction, + const String&, + const ResourceRequest&); + virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction, + const NavigationAction&, + const ResourceRequest&, + PassRefPtr, const String&); + virtual void dispatchDecidePolicyForNavigationAction(FramePolicyFunction, + const NavigationAction&, + const ResourceRequest&, + PassRefPtr); + virtual void dispatchUnableToImplementPolicy(const ResourceError&); + + virtual void startDownload(const ResourceRequest&); + + // FIXME: This should probably not be here, but it's needed for the tests currently. + virtual void partClearedInBegin(); + + virtual PassRefPtr createFrame(const KURL& url, const String& name, + HTMLFrameOwnerElement*, const String& referrer, + bool allowsScrolling, int marginWidth, int marginHeight); + virtual void didTransferChildFrameToNewDocument(WebCore::Page*); + virtual void transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const ResourceRequest&, WebCore::Page*); + virtual PassRefPtr createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, + const Vector&, const Vector&, const String&, + bool loadManually); + virtual void redirectDataToPlugin(Widget* pluginWidget); + virtual ResourceError pluginWillHandleLoadError(const ResourceResponse&); + + virtual PassRefPtr createJavaAppletWidget(const IntSize&, HTMLAppletElement*, + const KURL& baseURL, const Vector& paramNames, + const Vector& paramValues); + + virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType); + virtual String overrideMediaType() const; + + virtual void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*); + virtual void documentElementAvailable(); + + virtual void didPerformFirstNavigation() const; + + virtual void registerForIconNotification(bool listen = true); + + private: + Frame* m_frame; + WebView* m_webView; + BMessenger* m_messenger; + ResourceResponse m_response; + bool m_firstData; + }; +} // namespace WebCore + +#endif // FrameLoaderClientHaiku_h diff --git a/Source/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp b/Source/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp new file mode 100644 index 0000000..883fcd3 --- /dev/null +++ b/Source/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2007 Ryan Leavengood + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "InspectorClientHaiku.h" + +#include "PlatformString.h" + +#include "NotImplemented.h" + + +namespace WebCore { + +void InspectorClientHaiku::inspectorDestroyed() +{ + notImplemented(); +} + +void InspectorClientHaiku::openInspectorFrontend(WebCore::InspectorController*) +{ + notImplemented(); +} + +void InspectorClientHaiku::highlight(Node* node) +{ + notImplemented(); +} + +void InspectorClientHaiku::hideHighlight() +{ + notImplemented(); +} + +void InspectorClientHaiku::populateSetting(const String& key, String* value) +{ + notImplemented(); +} + +void InspectorClientHaiku::storeSetting(const String& key, const String& value) +{ + notImplemented(); +} + +bool InspectorClientHaiku::sendMessageToFrontend(const String&) +{ + notImplemented(); + return false; +} + +} // namespace WebCore + diff --git a/Source/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h b/Source/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h new file mode 100644 index 0000000..d6df4c6 --- /dev/null +++ b/Source/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2007 Ryan Leavengood + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef InspectorClientHaiku_h +#define InspectorClientHaiku_h + +#include "InspectorClient.h" +#include + +namespace WebCore { + class Node; + class Page; + + class InspectorClientHaiku : public InspectorClient { + public: + virtual void inspectorDestroyed(); + + virtual void openInspectorFrontend(WebCore::InspectorController*); + + virtual void highlight(Node*); + virtual void hideHighlight(); + + virtual void populateSetting(const WTF::String& key, WTF::String* value); + virtual void storeSetting(const WTF::String& key, const WTF::String& value); + + virtual bool sendMessageToFrontend(const WTF::String&); + }; +} // namespace WebCore + +#endif // InspectorClientHaiku_h + -- cgit v1.1