Commit d773bc13 authored by weinig@apple.com's avatar weinig@apple.com

Add WebKit2/WebProcess directory.

Patch by Anders Carlsson <andersca@apple.com> on 2010-04-08
Reviewed by Sam Weinig and Oliver Hunt.

* WebProcess: Added.
* WebProcess/Launching: Added.
* WebProcess/Launching/mac: Added.
* WebProcess/Launching/mac/WebProcessMain.mm: Added.
* WebProcess/Launching/win: Added.
* WebProcess/Launching/win/WebProcessWinMain.cpp: Added.
* WebProcess/WebCoreSupport: Added.
* WebProcess/WebCoreSupport/WebChromeClient.cpp: Added.
* WebProcess/WebCoreSupport/WebChromeClient.h: Added.
* WebProcess/WebCoreSupport/WebContextMenuClient.cpp: Added.
* WebProcess/WebCoreSupport/WebContextMenuClient.h: Added.
* WebProcess/WebCoreSupport/WebDragClient.cpp: Added.
* WebProcess/WebCoreSupport/WebDragClient.h: Added.
* WebProcess/WebCoreSupport/WebEditorClient.cpp: Added.
* WebProcess/WebCoreSupport/WebEditorClient.h: Added.
* WebProcess/WebCoreSupport/WebErrors.h: Added.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Added.
* WebProcess/WebCoreSupport/WebInspectorClient.h: Added.
* WebProcess/WebCoreSupport/mac: Added.
* WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: Added.
* WebProcess/WebCoreSupport/mac/WebSystemInterface.h: Added.
* WebProcess/WebCoreSupport/mac/WebSystemInterface.m: Added.
* WebProcess/WebCoreSupport/win: Added.
* WebProcess/WebCoreSupport/win/WebCoreLocalizedStrings.cpp: Added.
* WebProcess/WebCoreSupport/win/WebErrorsWin.cpp: Added.
* WebProcess/WebPage: Added.
* WebProcess/WebPage/DrawingArea.cpp: Added.
* WebProcess/WebPage/DrawingArea.h: Added.
* WebProcess/WebPage/WebFrame.cpp: Added.
* WebProcess/WebPage/WebFrame.h: Added.
* WebProcess/WebPage/WebPage.cpp: Added.
* WebProcess/WebPage/WebPage.h: Added.
* WebProcess/WebPage/mac: Added.
* WebProcess/WebPage/mac/DrawingAreaUpdateChunk.cpp: Added.
* WebProcess/WebPage/mac/DrawingAreaUpdateChunk.h: Added.
* WebProcess/WebPage/mac/WebPageMac.mm: Added.
* WebProcess/WebPage/win: Added.
* WebProcess/WebPage/win/DrawingAreaUpdateChunk.cpp: Added.
* WebProcess/WebPage/win/DrawingAreaUpdateChunk.h: Added.
* WebProcess/WebPage/win/WebPageWin.cpp: Added.
* WebProcess/WebProcess.cpp: Added.
* WebProcess/WebProcess.h: Added.
* WebProcess/win: Added.
* WebProcess/win/DllMain.cpp: Added.
* WebProcess/win/WebLocalizableStrings.cpp: Added.
* WebProcess/win/WebLocalizableStrings.h: Added.
* WebProcess/win/WebProcessMain.cpp: Added.
* WebProcess/win/WebProcessMain.h: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@57309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 65c2a4bc
2010-04-08 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig and Oliver Hunt.
Add WebKit2/WebProcess directory.
* WebProcess: Added.
* WebProcess/Launching: Added.
* WebProcess/Launching/mac: Added.
* WebProcess/Launching/mac/WebProcessMain.mm: Added.
* WebProcess/Launching/win: Added.
* WebProcess/Launching/win/WebProcessWinMain.cpp: Added.
* WebProcess/WebCoreSupport: Added.
* WebProcess/WebCoreSupport/WebChromeClient.cpp: Added.
* WebProcess/WebCoreSupport/WebChromeClient.h: Added.
* WebProcess/WebCoreSupport/WebContextMenuClient.cpp: Added.
* WebProcess/WebCoreSupport/WebContextMenuClient.h: Added.
* WebProcess/WebCoreSupport/WebDragClient.cpp: Added.
* WebProcess/WebCoreSupport/WebDragClient.h: Added.
* WebProcess/WebCoreSupport/WebEditorClient.cpp: Added.
* WebProcess/WebCoreSupport/WebEditorClient.h: Added.
* WebProcess/WebCoreSupport/WebErrors.h: Added.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Added.
* WebProcess/WebCoreSupport/WebInspectorClient.h: Added.
* WebProcess/WebCoreSupport/mac: Added.
* WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: Added.
* WebProcess/WebCoreSupport/mac/WebSystemInterface.h: Added.
* WebProcess/WebCoreSupport/mac/WebSystemInterface.m: Added.
* WebProcess/WebCoreSupport/win: Added.
* WebProcess/WebCoreSupport/win/WebCoreLocalizedStrings.cpp: Added.
* WebProcess/WebCoreSupport/win/WebErrorsWin.cpp: Added.
* WebProcess/WebPage: Added.
* WebProcess/WebPage/DrawingArea.cpp: Added.
* WebProcess/WebPage/DrawingArea.h: Added.
* WebProcess/WebPage/WebFrame.cpp: Added.
* WebProcess/WebPage/WebFrame.h: Added.
* WebProcess/WebPage/WebPage.cpp: Added.
* WebProcess/WebPage/WebPage.h: Added.
* WebProcess/WebPage/mac: Added.
* WebProcess/WebPage/mac/DrawingAreaUpdateChunk.cpp: Added.
* WebProcess/WebPage/mac/DrawingAreaUpdateChunk.h: Added.
* WebProcess/WebPage/mac/WebPageMac.mm: Added.
* WebProcess/WebPage/win: Added.
* WebProcess/WebPage/win/DrawingAreaUpdateChunk.cpp: Added.
* WebProcess/WebPage/win/DrawingAreaUpdateChunk.h: Added.
* WebProcess/WebPage/win/WebPageWin.cpp: Added.
* WebProcess/WebProcess.cpp: Added.
* WebProcess/WebProcess.h: Added.
* WebProcess/win: Added.
* WebProcess/win/DllMain.cpp: Added.
* WebProcess/win/WebLocalizableStrings.cpp: Added.
* WebProcess/win/WebLocalizableStrings.h: Added.
* WebProcess/win/WebProcessMain.cpp: Added.
* WebProcess/win/WebProcessMain.h: Added.
2010-04-08 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
......
/*
* Copyright (C) 2010 Apple Inc. 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 INC. 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 INC. 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.
*/
#import "RunLoop.h"
#import "WebProcess.h"
#import "WebSystemInterface.h"
#import <runtime/InitializeThreading.h>
#import <servers/bootstrap.h>
#import <signal.h>
#import <unistd.h>
// FIXME: We should be doing this another way.
extern "C" kern_return_t bootstrap_look_up2(mach_port_t, const name_t, mach_port_t*, pid_t, uint64_t);
#define SHOW_CRASH_REPORTER 0
using namespace WebKit;
int main(int argc, char** argv)
{
mach_port_t serverPort;
kern_return_t kr = bootstrap_look_up2(bootstrap_port, "com.apple.WebKit.WebProcess", &serverPort, getppid(), /* BOOTSTRAP_PER_PID_SERVICE */ 1);
if (kr) {
printf("bootstrap_look_up2 result: %x", kr);
return 2;
}
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
#if !SHOW_CRASH_REPORTER
// Installs signal handlers that exit on a crash so that CrashReporter does not show up.
signal(SIGILL, _exit);
signal(SIGFPE, _exit);
signal(SIGBUS, _exit);
signal(SIGSEGV, _exit);
#endif
InitWebCoreSystemInterface();
JSC::initializeThreading();
RunLoop::initializeMainRunLoop();
// Create the connection.
WebProcess::shared().initialize(serverPort, RunLoop::mainRunLoop());
[pool drain];
// Initialize AppKit.
[NSApplication sharedApplication];
RunLoop::mainRunLoop()->run();
// FIXME: Do more cleanup here.
return 0;
}
/*
* Copyright (C) 2010 Apple Inc. 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 INC. 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 INC. 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 <windows.h>
#include <tchar.h>
#include "WebProcessMain.h"
#if defined _M_IX86
#define PROCESSORARCHITECTURE "x86"
#elif defined _M_IA64
#define PROCESSORARCHITECTURE "ia64"
#elif defined _M_X64
#define PROCESSORARCHITECTURE "amd64"
#else
#define PROCESSORARCHITECTURE "*"
#endif
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='" PROCESSORARCHITECTURE "' publicKeyToken='6595b64144ccf1df' language='*'\"")
static void enableTerminationOnHeapCorruption()
{
// Enable termination on heap corruption on OSes that support it (Vista and XPSP3).
// http://msdn.microsoft.com/en-us/library/aa366705(VS.85).aspx
const HEAP_INFORMATION_CLASS heapEnableTerminationOnCorruption = static_cast<HEAP_INFORMATION_CLASS>(1);
HMODULE hMod = ::GetModuleHandleW(L"kernel32.dll");
if (!hMod)
return;
typedef BOOL (WINAPI*HSI)(HANDLE, HEAP_INFORMATION_CLASS, PVOID, SIZE_T);
HSI heapSetInformation = reinterpret_cast<HSI>(::GetProcAddress(hMod, "HeapSetInformation"));
if (!heapSetInformation)
return;
heapSetInformation(0, heapEnableTerminationOnCorruption, 0, 0);
}
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int /*nCmdShow*/)
{
enableTerminationOnHeapCorruption();
return WebKit::WebProcessMain(hInstance, lpstrCmdLine);
}
This diff is collapsed.
/*
* Copyright (C) 2010 Apple Inc. 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 INC. 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 INC. 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 WebChromeClient_h
#define WebChromeClient_h
#include <WebCore/ChromeClient.h>
#include <WebCore/PlatformString.h>
namespace WebKit {
class WebPage;
class WebChromeClient : public WebCore::ChromeClient {
public:
WebChromeClient(WebPage* page)
: m_page(page)
{
}
private:
virtual void chromeDestroyed();
virtual void setWindowRect(const WebCore::FloatRect&);
virtual WebCore::FloatRect windowRect();
virtual WebCore::FloatRect pageRect();
virtual float scaleFactor();
virtual void focus();
virtual void unfocus();
virtual bool canTakeFocus(WebCore::FocusDirection);
virtual void takeFocus(WebCore::FocusDirection);
virtual void focusedNodeChanged(WebCore::Node*);
// The Frame pointer provides the ChromeClient with context about which
// Frame wants to create the new Page. Also, the newly created window
// should not be shown to the user until the ChromeClient of the newly
// created Page has its show method called.
virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&);
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(WebCore::MessageSource, WebCore::MessageType, WebCore::MessageLevel, const WebCore::String& message, unsigned int lineNumber, const WebCore::String& sourceID);
virtual bool canRunBeforeUnloadConfirmPanel();
virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame);
virtual void closeWindowSoon();
virtual void runJavaScriptAlert(WebCore::Frame*, const WebCore::String&);
virtual bool runJavaScriptConfirm(WebCore::Frame*, const WebCore::String&);
virtual bool runJavaScriptPrompt(WebCore::Frame*, const WebCore::String& message, const WebCore::String& defaultValue, WebCore::String& result);
virtual void setStatusbarText(const WebCore::String&);
virtual bool shouldInterruptJavaScript();
virtual bool tabsToLinks() const;
virtual WebCore::IntRect windowResizerRect() const;
// Methods used by HostWindow.
virtual void invalidateWindow(const WebCore::IntRect&, bool);
virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, const WebCore::IntRect& clipRect);
virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const;
virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const;
virtual PlatformPageClient platformPageClient() const;
virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const;
virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const; // Currently only Mac has a non empty implementation.
// End methods used by HostWindow.
virtual void scrollbarsModeDidChange() const;
virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);
virtual void setToolTip(const WebCore::String&, WebCore::TextDirection);
virtual void print(WebCore::Frame*);
#if ENABLE(DATABASE)
virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String& databaseName);
#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
#endif
#if ENABLE(DASHBOARD_SUPPORT)
virtual void dashboardRegionsChanged();
#endif
virtual void populateVisitedLinks();
virtual WebCore::FloatRect customHighlightRect(WebCore::Node*, const WebCore::AtomicString& type, const WebCore::FloatRect& lineRect);
virtual void paintCustomHighlight(WebCore::Node*, const WebCore::AtomicString& type, const WebCore::FloatRect& boxRect, const WebCore::FloatRect& lineRect,
bool behindText, bool entireLine);
virtual bool shouldReplaceWithGeneratedFileForUpload(const WebCore::String& path, WebCore::String& generatedFilename);
virtual WebCore::String generateReplacementFile(const WebCore::String& path);
virtual bool paintCustomScrollbar(WebCore::GraphicsContext*, const WebCore::FloatRect&, WebCore::ScrollbarControlSize,
WebCore::ScrollbarControlState, WebCore::ScrollbarPart pressedPart, bool vertical,
float value, float proportion, WebCore::ScrollbarControlPartMask);
virtual bool paintCustomScrollCorner(WebCore::GraphicsContext*, const WebCore::FloatRect&);
// This is an asynchronous call. The ChromeClient can display UI asking the user for permission
// to use Geolococation. The ChromeClient must call Geolocation::setShouldClearCache() appropriately.
virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*);
virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
virtual void chooseIconForFiles(const Vector<WebCore::String>&, PassRefPtr<WebCore::FileChooser>);
virtual bool setCursor(WebCore::PlatformCursorHandle);
// Notification that the given form element has changed. This function
// will be called frequently, so handling should be very fast.
virtual void formStateDidChange(const WebCore::Node*);
virtual void formDidFocus(const WebCore::Node*);
virtual void formDidBlur(const WebCore::Node*);
virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks();
#if USE(ACCELERATED_COMPOSITING)
virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*);
virtual void setNeedsOneShotDrawingSynchronization();
virtual void scheduleCompositingLayerSync();
#endif
WebCore::String m_cachedToolTip;
WebPage* m_page;
};
} // namespace WebKit
#endif // WebChromeClient_h
/*
* Copyright (C) 2010 Apple Inc. 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 INC. 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 INC. 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 "WebContextMenuClient.h"
#include "NotImplemented.h"
using namespace WebCore;
namespace WebKit {
void WebContextMenuClient::contextMenuDestroyed()
{
delete this;
}
PlatformMenuDescription WebContextMenuClient::getCustomMenuFromDefaultItems(ContextMenu*)
{
notImplemented();
return 0;
}
void WebContextMenuClient::contextMenuItemSelected(ContextMenuItem*, const ContextMenu*)
{
notImplemented();
}
void WebContextMenuClient::downloadURL(const KURL& url)
{
notImplemented();
}
void WebContextMenuClient::searchWithGoogle(const Frame*)
{
notImplemented();
}
void WebContextMenuClient::lookUpInDictionary(Frame*)
{
notImplemented();
}
bool WebContextMenuClient::isSpeaking()
{
notImplemented();
return false;
}
void WebContextMenuClient::speak(const String&)
{
notImplemented();
}
void WebContextMenuClient::stopSpeaking()
{
notImplemented();
}
#if PLATFORM(MAC)
void WebContextMenuClient::searchWithSpotlight()
{
notImplemented();
}
#endif
} // namespace WebKit
/*
* Copyright (C) 2010 Apple Inc. 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 INC. 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 INC. 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 WebContextMenuClient_h
#define WebContextMenuClient_h
#include <WebCore/ContextMenuClient.h>
namespace WebKit {
class WebPage;
class WebContextMenuClient : public WebCore::ContextMenuClient {
public:
WebContextMenuClient(WebPage* page)
: m_page(page)
{
}
private:
virtual void contextMenuDestroyed();
virtual WebCore::PlatformMenuDescription getCustomMenuFromDefaultItems(WebCore::ContextMenu*);
virtual void contextMenuItemSelected(WebCore::ContextMenuItem*, const WebCore::ContextMenu*);
virtual void downloadURL(const WebCore::KURL& url);
virtual void searchWithGoogle(const WebCore::Frame*);
virtual void lookUpInDictionary(WebCore::Frame*);
virtual bool isSpeaking();
virtual void speak(const WebCore::String&);
virtual void stopSpeaking();
#if PLATFORM(MAC)
virtual void searchWithSpotlight();
#endif
WebPage* m_page;
};
} // namespace WebKit
#endif // WebContextMenuClient_h
/*
* Copyright (C) 2010 Apple Inc. 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 INC. 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 INC. 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 "WebDragClient.h"
#include "NotImplemented.h"
using namespace WebCore;
namespace WebKit {
void WebDragClient::willPerformDragDestinationAction(DragDestinationAction, DragData*)
{
notImplemented();
}
void WebDragClient::willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*)
{
notImplemented();
}
DragDestinationAction WebDragClient::actionMaskForDrag(DragData*)
{
notImplemented();
return DragDestinationActionNone;
}
DragSourceAction WebDragClient::dragSourceActionMaskForPoint(const IntPoint& windowPoint)
{
notImplemented();
return DragSourceActionNone;
}
void WebDragClient::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipboard*, Frame*, bool)
{
notImplemented();
}
DragImageRef WebDragClient::createDragImageForLink(KURL&, const String&, Frame*)
{
notImplemented();
return 0;
}
void WebDragClient::dragControllerDestroyed()
{
delete this;
}
} // namespace WebKit
/*
* Copyright (C) 2010 Apple Inc. 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 INC. 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 INC. 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 WebDragClient_h
#define WebDragClient_h
#include <WebCore/DragClient.h>
namespace WebKit {
class WebPage;
class WebDragClient : public WebCore::DragClient {
public:
WebDragClient(WebPage* page)
: m_page(page)
{
}