diff options
Diffstat (limited to 'Source/WebKit2/WebProcess/InjectedBundle/API/c')
23 files changed, 417 insertions, 374 deletions
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp index 627d748ec..8fee4cc51 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp @@ -31,6 +31,7 @@ #include "WKAPICast.h" #include "WKBundleAPICast.h" #include "WKBundlePrivate.h" +#include "WebData.h" using namespace WebKit; @@ -212,6 +213,11 @@ void WKBundleResetOriginAccessWhitelists(WKBundleRef bundleRef) toImpl(bundleRef)->resetOriginAccessWhitelists(); } +void WKBundleSetAsynchronousSpellCheckingEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled) +{ + toImpl(bundleRef)->setAsynchronousSpellCheckingEnabled(toImpl(pageGroupRef), enabled); +} + void WKBundleReportException(JSContextRef context, JSValueRef exception) { InjectedBundle::reportException(context, exception); @@ -263,9 +269,10 @@ WKArrayRef WKBundleCopyOriginsWithApplicationCache(WKBundleRef bundleRef) return toAPI(origins.release().leakRef()); } -void WKBundleSetMinimumTimerInterval(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, double seconds) +WKDataRef WKBundleCreateWKDataFromUInt8Array(WKBundleRef bundle, JSContextRef context, JSValueRef data) { - toImpl(bundleRef)->setMinimumTimerInterval(toImpl(pageGroupRef), seconds); + RefPtr<WebData> webData = toImpl(bundle)->createWebDataFromUint8Array(context, data); + return toAPI(webData.release().leakRef()); } int WKBundleNumberOfPages(WKBundleRef bundleRef, WKBundleFrameRef frameRef, double pageWidthInPixels, double pageHeightInPixels) @@ -293,12 +300,6 @@ bool WKBundleIsProcessingUserGesture(WKBundleRef) return InjectedBundle::isProcessingUserGesture(); } -size_t WKBundleGetWorkerThreadCount(WKBundleRef) -{ - // Actually do not need argument here, keeping it however for consistency. - return InjectedBundle::workerThreadCount(); -} - void WKBundleSetUserStyleSheetLocation(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, WKStringRef location) { toImpl(bundleRef)->setUserStyleSheetLocation(toImpl(pageGroupRef), toWTFString(location)); @@ -334,6 +335,11 @@ void WKBundleSetShadowDOMEnabled(WKBundleRef bundleRef, bool enabled) toImpl(bundleRef)->setShadowDOMEnabled(enabled); } +void WKBundleSetSeamlessIFramesEnabled(WKBundleRef bundleRef, bool enabled) +{ + toImpl(bundleRef)->setSeamlessIFramesEnabled(enabled); +} + void WKBundleDispatchPendingLoadRequests(WKBundleRef bundleRef) { toImpl(bundleRef)->dispatchPendingLoadRequests(); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h index 59c3570bd..15ac158bd 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h @@ -44,12 +44,11 @@ class InjectedBundleBackForwardList; class InjectedBundleBackForwardListItem; class InjectedBundleDOMWindowExtension; class InjectedBundleHitTestResult; -class InjectedBundleIntent; -class InjectedBundleIntentRequest; class InjectedBundleNavigationAction; class InjectedBundleNodeHandle; class InjectedBundleRangeHandle; class InjectedBundleScriptWorld; +class PageBanner; class PageOverlay; class WebFrame; class WebInspector; @@ -63,10 +62,9 @@ WK_ADD_API_MAPPING(WKBundleDOMWindowExtensionRef, InjectedBundleDOMWindowExtensi WK_ADD_API_MAPPING(WKBundleFrameRef, WebFrame) WK_ADD_API_MAPPING(WKBundleHitTestResultRef, InjectedBundleHitTestResult) WK_ADD_API_MAPPING(WKBundleInspectorRef, WebInspector) -WK_ADD_API_MAPPING(WKBundleIntentRef, InjectedBundleIntent) -WK_ADD_API_MAPPING(WKBundleIntentRequestRef, InjectedBundleIntentRequest) WK_ADD_API_MAPPING(WKBundleNavigationActionRef, InjectedBundleNavigationAction) WK_ADD_API_MAPPING(WKBundleNodeHandleRef, InjectedBundleNodeHandle) +WK_ADD_API_MAPPING(WKBundlePageBannerRef, PageBanner) WK_ADD_API_MAPPING(WKBundlePageGroupRef, WebPageGroupProxy) WK_ADD_API_MAPPING(WKBundlePageOverlayRef, PageOverlay) WK_ADD_API_MAPPING(WKBundlePageRef, WebPage) diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp index 4b32b3481..3a49bbf26 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp @@ -72,6 +72,11 @@ bool WKBundleBackForwardListItemIsInPageCache(WKBundleBackForwardListItemRef ite return toImpl(itemRef)->isInPageCache(); } +bool WKBundleBackForwardListItemHasCachedPageExpired(WKBundleBackForwardListItemRef itemRef) +{ + return toImpl(itemRef)->hasCachedPageExpired(); +} + WKArrayRef WKBundleBackForwardListItemCopyChildren(WKBundleBackForwardListItemRef itemRef) { return toAPI(toImpl(itemRef)->children().leakRef()); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h index e9475ac1e..5ad9abe79 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h @@ -44,6 +44,7 @@ WK_EXPORT WKStringRef WKBundleBackForwardListItemCopyTarget(WKBundleBackForwardL WK_EXPORT bool WKBundleBackForwardListItemIsTargetItem(WKBundleBackForwardListItemRef item); WK_EXPORT bool WKBundleBackForwardListItemIsInPageCache(WKBundleBackForwardListItemRef item); +WK_EXPORT bool WKBundleBackForwardListItemHasCachedPageExpired(WKBundleBackForwardListItemRef item); WK_EXPORT WKArrayRef WKBundleBackForwardListItemCopyChildren(WKBundleBackForwardListItemRef item); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp index 55c29279e..61b380803 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp @@ -33,7 +33,9 @@ #include "WKData.h" #include "WebFrame.h" #include "WebSecurityOrigin.h" +#include <WebCore/Document.h> #include <WebCore/Frame.h> +#include <WebCore/FrameLoader.h> #include <WebCore/FrameView.h> using namespace WebCore; @@ -92,31 +94,6 @@ WKArrayRef WKBundleFrameCopyChildFrames(WKBundleFrameRef frameRef) return toAPI(toImpl(frameRef)->childFrames().leakRef()); } -unsigned WKBundleFrameGetNumberOfActiveAnimations(WKBundleFrameRef frameRef) -{ - return toImpl(frameRef)->numberOfActiveAnimations(); -} - -bool WKBundleFramePauseAnimationOnElementWithId(WKBundleFrameRef frameRef, WKStringRef animationName, WKStringRef elementID, double time) -{ - return toImpl(frameRef)->pauseAnimationOnElementWithId(toWTFString(animationName), toWTFString(elementID), time); -} - -bool WKBundleFramePauseTransitionOnElementWithId(WKBundleFrameRef frameRef, WKStringRef propertyName, WKStringRef elementID, double time) -{ - return toImpl(frameRef)->pauseTransitionOnElementWithId(toWTFString(propertyName), toWTFString(elementID), time); -} - -void WKBundleFrameSuspendAnimations(WKBundleFrameRef frameRef) -{ - toImpl(frameRef)->suspendAnimations(); -} - -void WKBundleFrameResumeAnimations(WKBundleFrameRef frameRef) -{ - toImpl(frameRef)->resumeAnimations(); -} - JSGlobalContextRef WKBundleFrameGetJavaScriptContext(WKBundleFrameRef frameRef) { return toImpl(frameRef)->jsContext(); @@ -147,21 +124,11 @@ WKStringRef WKBundleFrameCopyName(WKBundleFrameRef frameRef) return toCopiedAPI(toImpl(frameRef)->name()); } -JSValueRef WKBundleFrameGetComputedStyleIncludingVisitedInfo(WKBundleFrameRef frameRef, JSObjectRef element) -{ - return toImpl(frameRef)->computedStyleIncludingVisitedInfo(element); -} - WKStringRef WKBundleFrameCopyCounterValue(WKBundleFrameRef frameRef, JSObjectRef element) { return toCopiedAPI(toImpl(frameRef)->counterValue(element)); } -WKStringRef WKBundleFrameCopyMarkerText(WKBundleFrameRef frameRef, JSObjectRef element) -{ - return toCopiedAPI(toImpl(frameRef)->markerText(element)); -} - WKStringRef WKBundleFrameCopyInnerText(WKBundleFrameRef frameRef) { return toCopiedAPI(toImpl(frameRef)->innerText()); @@ -254,6 +221,11 @@ bool WKBundleFrameContainsAnyFormElements(WKBundleFrameRef frameRef) return toImpl(frameRef)->containsAnyFormElements(); } +bool WKBundleFrameContainsAnyFormControls(WKBundleFrameRef frameRef) +{ + return toImpl(frameRef)->containsAnyFormControls(); +} + void WKBundleFrameSetTextDirection(WKBundleFrameRef frameRef, WKStringRef directionRef) { toImpl(frameRef)->setTextDirection(toWTFString(directionRef)); @@ -266,7 +238,7 @@ WKDataRef WKBundleFrameCopyWebArchive(WKBundleFrameRef frameRef) WKDataRef WKBundleFrameCopyWebArchiveFilteringSubframes(WKBundleFrameRef frameRef, WKBundleFrameFrameFilterCallback frameFilterCallback, void* context) { -#if PLATFORM(MAC) || PLATFORM(WIN) +#if PLATFORM(MAC) RetainPtr<CFDataRef> data = toImpl(frameRef)->webArchiveData(frameFilterCallback, context); if (data) return WKDataCreate(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get())); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h index b7aeaf978..4e81d898e 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h @@ -39,19 +39,13 @@ extern "C" { WK_EXPORT WKStringRef WKBundleFrameCopyInnerText(WKBundleFrameRef frame); WK_EXPORT WKStringRef WKBundleFrameCopyCounterValue(WKBundleFrameRef frame, JSObjectRef element); -WK_EXPORT WKStringRef WKBundleFrameCopyMarkerText(WKBundleFrameRef frame, JSObjectRef element); -WK_EXPORT JSValueRef WKBundleFrameGetComputedStyleIncludingVisitedInfo(WKBundleFrameRef frame, JSObjectRef element); -WK_EXPORT unsigned WKBundleFrameGetNumberOfActiveAnimations(WKBundleFrameRef frame); -WK_EXPORT bool WKBundleFramePauseAnimationOnElementWithId(WKBundleFrameRef frame, WKStringRef animationName, WKStringRef elementID, double time); -WK_EXPORT bool WKBundleFramePauseTransitionOnElementWithId(WKBundleFrameRef frame, WKStringRef propertyName, WKStringRef elementID, double time); -WK_EXPORT void WKBundleFrameSuspendAnimations(WKBundleFrameRef frame); -WK_EXPORT void WKBundleFrameResumeAnimations(WKBundleFrameRef frame); WK_EXPORT unsigned WKBundleFrameGetPendingUnloadCount(WKBundleFrameRef frame); WK_EXPORT WKStringRef WKBundleFrameCopyLayerTreeAsText(WKBundleFrameRef frame); WK_EXPORT void WKBundleFrameClearOpener(WKBundleFrameRef frame); WK_EXPORT void WKBundleFrameStopLoading(WKBundleFrameRef frame); WK_EXPORT bool WKBundleFrameContainsAnyFormElements(WKBundleFrameRef frame); +WK_EXPORT bool WKBundleFrameContainsAnyFormControls(WKBundleFrameRef frame); WK_EXPORT void WKBundleFrameSetTextDirection(WKBundleFrameRef frame, WKStringRef); WK_EXPORT bool WKBundleFrameCallShouldCloseOnWebView(WKBundleFrameRef frame); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp index 9cb225033..60a4c68b0 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp @@ -74,6 +74,21 @@ WKURLRef WKBundleHitTestResultCopyAbsoluteMediaURL(WKBundleHitTestResultRef hitT return toCopiedURLAPI(toImpl(hitTestResultRef)->absoluteMediaURL()); } +bool WKBundleHitTestResultMediaIsInFullscreen(WKBundleHitTestResultRef hitTestResultRef) +{ + return toImpl(hitTestResultRef)->mediaIsInFullscreen(); +} + +bool WKBundleHitTestResultMediaHasAudio(WKBundleHitTestResultRef hitTestResultRef) +{ + return toImpl(hitTestResultRef)->mediaHasAudio(); +} + +WKBundleHitTestResultMediaType WKBundleHitTestResultGetMediaType(WKBundleHitTestResultRef hitTestResultRef) +{ + return toAPI(toImpl(hitTestResultRef)->mediaType()); +} + WKRect WKBundleHitTestResultGetImageRect(WKBundleHitTestResultRef hitTestResultRef) { return toAPI(toImpl(hitTestResultRef)->imageRect()); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h index 37c5019da..839e9850d 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h @@ -33,6 +33,13 @@ extern "C" { #endif +enum { + kWKBundleHitTestResultMediaTypeNone, + kWKBundleHitTestResultMediaTypeAudio, + kWKBundleHitTestResultMediaTypeVideo +}; +typedef uint32_t WKBundleHitTestResultMediaType; + WK_EXPORT WKTypeID WKBundleHitTestResultGetTypeID(); WK_EXPORT WKBundleNodeHandleRef WKBundleHitTestResultCopyNodeHandle(WKBundleHitTestResultRef hitTestResult); @@ -44,6 +51,9 @@ WK_EXPORT WKURLRef WKBundleHitTestResultCopyAbsoluteImageURL(WKBundleHitTestResu WK_EXPORT WKURLRef WKBundleHitTestResultCopyAbsolutePDFURL(WKBundleHitTestResultRef hitTestResult); WK_EXPORT WKURLRef WKBundleHitTestResultCopyAbsoluteLinkURL(WKBundleHitTestResultRef hitTestResult); WK_EXPORT WKURLRef WKBundleHitTestResultCopyAbsoluteMediaURL(WKBundleHitTestResultRef hitTestResult); +WK_EXPORT bool WKBundleHitTestResultMediaIsInFullscreen(WKBundleHitTestResultRef hitTestResult); +WK_EXPORT bool WKBundleHitTestResultMediaHasAudio(WKBundleHitTestResultRef hitTestResult); +WK_EXPORT WKBundleHitTestResultMediaType WKBundleHitTestResultGetMediaType(WKBundleHitTestResultRef hitTestResult); WK_EXPORT WKRect WKBundleHitTestResultGetImageRect(WKBundleHitTestResultRef hitTestResult); WK_EXPORT bool WKBundleHitTestResultGetIsSelected(WKBundleHitTestResultRef hitTestResult); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp deleted file mode 100644 index 66bee90b0..000000000 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (C) 2012 Intel Corporation. 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 "config.h" -#include "WKBundleIntent.h" - -#if ENABLE(WEB_INTENTS) -#include "ImmutableArray.h" -#include "ImmutableDictionary.h" -#include "InjectedBundleIntent.h" -#include "WKAPICast.h" -#include "WKBundleAPICast.h" -#include "WKDictionary.h" -#include "WKRetainPtr.h" -#include "WKString.h" -#include "WebSerializedScriptValue.h" - -using namespace WebCore; -using namespace WebKit; -#endif - -WKTypeID WKBundleIntentGetTypeID() -{ -#if ENABLE(WEB_INTENTS) - return toAPI(InjectedBundleIntent::APIType); -#else - return 0; -#endif -} - -WKBundleIntentRef WKBundleIntentCreate(WKDictionaryRef dictionaryRef) -{ -#if ENABLE(WEB_INTENTS) - WKRetainPtr<WKStringRef> actionKey(AdoptWK, WKStringCreateWithUTF8CString("action")); - WKStringRef action = static_cast<WKStringRef>(WKDictionaryGetItemForKey(dictionaryRef, actionKey.get())); - ASSERT(action); - WKRetainPtr<WKStringRef> typeKey(AdoptWK, WKStringCreateWithUTF8CString("type")); - WKStringRef type = static_cast<WKStringRef>(WKDictionaryGetItemForKey(dictionaryRef, typeKey.get())); - ASSERT(type); - WKRetainPtr<WKStringRef> dataKey(AdoptWK, WKStringCreateWithUTF8CString("data")); - WKSerializedScriptValueRef data = static_cast<WKSerializedScriptValueRef>(WKDictionaryGetItemForKey(dictionaryRef, dataKey.get())); - MessagePortArray dummyPorts; - ExceptionCode ec; - - RefPtr<Intent> coreIntent = Intent::create(toWTFString(action), toWTFString(type), data ? static_cast<SerializedScriptValue*>(toImpl(data)->internalRepresentation()) : 0, dummyPorts, ec); - - return toAPI(InjectedBundleIntent::create(coreIntent.get()).leakRef()); -#else - return 0; -#endif -} - -WKStringRef WKBundleIntentCopyAction(WKBundleIntentRef intentRef) -{ -#if ENABLE(WEB_INTENTS) - return toCopiedAPI(toImpl(intentRef)->action()); -#else - return 0; -#endif -} - -WKStringRef WKBundleIntentCopyType(WKBundleIntentRef intentRef) -{ -#if ENABLE(WEB_INTENTS) - return toCopiedAPI(toImpl(intentRef)->payloadType()); -#else - return 0; -#endif -} - -WKURLRef WKBundleIntentCopyService(WKBundleIntentRef intentRef) -{ -#if ENABLE(WEB_INTENTS) - return toCopiedURLAPI(toImpl(intentRef)->service()); -#else - return 0; -#endif -} - -WKArrayRef WKBundleIntentCopySuggestions(WKBundleIntentRef intentRef) -{ -#if ENABLE(WEB_INTENTS) - return toAPI(toImpl(intentRef)->suggestions().leakRef()); -#else - return 0; -#endif -} - -WKStringRef WKBundleIntentCopyExtraValue(WKBundleIntentRef intentRef, WKStringRef key) -{ -#if ENABLE(WEB_INTENTS) - return toCopiedAPI(toImpl(intentRef)->extra(toWTFString(key))); -#else - return 0; -#endif -} - -WKDictionaryRef WKBundleIntentCopyExtras(WKBundleIntentRef intentRef) -{ -#if ENABLE(WEB_INTENTS) - return toAPI(toImpl(intentRef)->extras().leakRef()); -#else - return 0; -#endif -} - -size_t WKBundleIntentMessagePortCount(WKBundleIntentRef intentRef) -{ -#if ENABLE(WEB_INTENTS) - MessagePortChannelArray* messagePorts = toImpl(intentRef)->coreIntent()->messagePorts(); - - return messagePorts ? messagePorts->size() : 0; -#else - return 0; -#endif -} diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.h deleted file mode 100644 index 503fe0284..000000000 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntent.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2012 Intel Corporation. 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 WKBundleIntent_h -#define WKBundleIntent_h - -#include <WebKit2/WKBase.h> - -#ifdef __cplusplus -extern "C" { -#endif - -WK_EXPORT WKTypeID WKBundleIntentGetTypeID(); - -WK_EXPORT WKBundleIntentRef WKBundleIntentCreate(WKDictionaryRef dictionaryRef); - -WK_EXPORT WKStringRef WKBundleIntentCopyAction(WKBundleIntentRef intentRef); -WK_EXPORT WKStringRef WKBundleIntentCopyType(WKBundleIntentRef intentRef); -WK_EXPORT WKURLRef WKBundleIntentCopyService(WKBundleIntentRef intentRef); -WK_EXPORT WKArrayRef WKBundleIntentCopySuggestions(WKBundleIntentRef intentRef); -WK_EXPORT WKStringRef WKBundleIntentCopyExtraValue(WKBundleIntentRef intentRef, WKStringRef key); -WK_EXPORT WKDictionaryRef WKBundleIntentCopyExtras(WKBundleIntentRef intentRef); -WK_EXPORT size_t WKBundleIntentMessagePortCount(WKBundleIntentRef intentRef); - -#ifdef __cplusplus -} -#endif - -#endif // WKBundleIntent_h diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp deleted file mode 100644 index a4772ea56..000000000 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2012 Intel Corporation. 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 "config.h" -#include "WKBundleIntentRequest.h" - -#if ENABLE(WEB_INTENTS) -#include "InjectedBundleIntent.h" -#include "InjectedBundleIntentRequest.h" -#include "WKAPICast.h" -#include "WKBundleAPICast.h" - -using namespace WebKit; -#endif - -WKTypeID WKBundleIntentRequestGetTypeID() -{ -#if ENABLE(WEB_INTENTS) - return toAPI(InjectedBundleIntentRequest::APIType); -#else - return 0; -#endif -} - -WKBundleIntentRef WKBundleIntentRequestCopyIntent(WKBundleIntentRequestRef requestRef) -{ -#if ENABLE(WEB_INTENTS) - RefPtr<InjectedBundleIntent> webIntent = toImpl(requestRef)->intent(); - return toAPI(webIntent.release().leakRef()); -#else - return 0; -#endif -} - -void WKBundleIntentRequestPostResult(WKBundleIntentRequestRef requestRef, WKSerializedScriptValueRef serializedDataRef) -{ -#if ENABLE(WEB_INTENTS) - return toImpl(requestRef)->postResult(toImpl(serializedDataRef)); -#endif -} - -void WKBundleIntentRequestPostFailure(WKBundleIntentRequestRef requestRef, WKSerializedScriptValueRef serializedDataRef) -{ -#if ENABLE(WEB_INTENTS) - return toImpl(requestRef)->postFailure(toImpl(serializedDataRef)); -#endif -} diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp index 77b87c90d..cb3f9b6e6 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp @@ -31,6 +31,7 @@ #include "WKAPICast.h" #include "WKBundleAPICast.h" #include "WebFrame.h" +#include "WebImage.h" using namespace WebKit; @@ -56,6 +57,12 @@ WKRect WKBundleNodeHandleGetRenderRect(WKBundleNodeHandleRef nodeHandleRef, bool return toAPI(toImpl(nodeHandleRef)->renderRect(isReplaced)); } +WKImageRef WKBundleNodeHandleCopySnapshotWithOptions(WKBundleNodeHandleRef nodeHandleRef, WKSnapshotOptions options) +{ + RefPtr<WebImage> image = toImpl(nodeHandleRef)->renderedImage(toSnapshotOptions(options)); + return toAPI(image.release().leakRef()); +} + WKRect WKBundleNodeHandleGetElementBounds(WKBundleNodeHandleRef elementHandleRef) { return toAPI(toImpl(elementHandleRef)->elementBounds()); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h index 245c56555..1ad192915 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h @@ -29,6 +29,7 @@ #include <JavaScriptCore/JavaScript.h> #include <WebKit2/WKBase.h> #include <WebKit2/WKGeometry.h> +#include <WebKit2/WKImage.h> #ifdef __cplusplus extern "C" { @@ -43,6 +44,7 @@ WK_EXPORT WKBundleNodeHandleRef WKBundleNodeHandleCopyDocument(WKBundleNodeHandl /* Additional DOM Operations */ WK_EXPORT WKRect WKBundleNodeHandleGetRenderRect(WKBundleNodeHandleRef nodeHandle, bool* isReplaced); +WK_EXPORT WKImageRef WKBundleNodeHandleCopySnapshotWithOptions(WKBundleNodeHandleRef nodeHandle, WKSnapshotOptions options); /* Element Specific Operations */ WK_EXPORT WKRect WKBundleNodeHandleGetElementBounds(WKBundleNodeHandleRef elementHandle); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp index 005811ac0..d45e48e88 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2011, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +29,7 @@ #include "InjectedBundleBackForwardList.h" #include "InjectedBundleNodeHandle.h" +#include "PageBanner.h" #include "WKAPICast.h" #include "WKArray.h" #include "WKBundleAPICast.h" @@ -50,12 +51,8 @@ #include <WebCore/AccessibilityObject.h> #include <WebCore/Frame.h> #include <WebCore/KURL.h> -#include <WebCore/MIMETypeRegistry.h> #include <WebCore/Page.h> - -#if ENABLE(WEB_INTENTS) -#include "InjectedBundleIntent.h" -#endif +#include <wtf/OwnArrayPtr.h> using namespace WebKit; @@ -167,6 +164,27 @@ WKArrayRef WKBundlePageCopyContextMenuItemTitles(WKBundlePageRef pageRef) #endif } +WKArrayRef WKBundlePageCopyContextMenuAtPointInWindow(WKBundlePageRef pageRef, WKPoint point) +{ +#if ENABLE(CONTEXT_MENUS) + WebContextMenu* contextMenu = toImpl(pageRef)->contextMenuAtPointInWindow(toIntPoint(point)); + if (!contextMenu) + return 0; + + const Vector<WebContextMenuItemData>& items = contextMenu->items(); + size_t arrayLength = items.size(); + + RefPtr<MutableArray> menuArray = MutableArray::create(); + menuArray->reserveCapacity(arrayLength); + for (unsigned i = 0; i < arrayLength; ++i) + menuArray->append(WebContextMenuItem::create(items[i]).get()); + + return toAPI(menuArray.release().leakRef()); +#else + return 0; +#endif +} + void* WKAccessibilityRootObject(WKBundlePageRef pageRef) { #if HAVE(ACCESSIBILITY) @@ -232,6 +250,11 @@ WKStringRef WKBundlePageCopyRenderTreeExternalRepresentation(WKBundlePageRef pag return toCopiedAPI(toImpl(pageRef)->renderTreeExternalRepresentation()); } +WKStringRef WKBundlePageCopyRenderTreeExternalRepresentationForPrinting(WKBundlePageRef pageRef) +{ + return toCopiedAPI(toImpl(pageRef)->renderTreeExternalRepresentationForPrinting()); +} + void WKBundlePageExecuteEditingCommand(WKBundlePageRef pageRef, WKStringRef name, WKStringRef argument) { toImpl(pageRef)->executeEditingCommand(toWTFString(name), toWTFString(argument)); @@ -294,7 +317,47 @@ void WKBundlePageInstallPageOverlay(WKBundlePageRef pageRef, WKBundlePageOverlay void WKBundlePageUninstallPageOverlay(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef) { - toImpl(pageRef)->uninstallPageOverlay(toImpl(pageOverlayRef), false); + toImpl(pageRef)->uninstallPageOverlay(toImpl(pageOverlayRef)); +} + +void WKBundlePageInstallPageOverlayWithAnimation(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef) +{ + toImpl(pageRef)->installPageOverlay(toImpl(pageOverlayRef), true); +} + +void WKBundlePageUninstallPageOverlayWithAnimation(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef) +{ + toImpl(pageRef)->uninstallPageOverlay(toImpl(pageOverlayRef), true); +} + +void WKBundlePageSetTopOverhangImage(WKBundlePageRef pageRef, WKImageRef imageRef) +{ +#if PLATFORM(MAC) + toImpl(pageRef)->setTopOverhangImage(toImpl(imageRef)); +#else + UNUSED_PARAM(pageRef); + UNUSED_PARAM(imageRef); +#endif +} + +void WKBundlePageSetBottomOverhangImage(WKBundlePageRef pageRef, WKImageRef imageRef) +{ +#if PLATFORM(MAC) + toImpl(pageRef)->setBottomOverhangImage(toImpl(imageRef)); +#else + UNUSED_PARAM(pageRef); + UNUSED_PARAM(imageRef); +#endif +} + +void WKBundlePageSetHeaderBanner(WKBundlePageRef pageRef, WKBundlePageBannerRef bannerRef) +{ + toImpl(pageRef)->setHeaderPageBanner(toImpl(bannerRef)); +} + +void WKBundlePageSetFooterBanner(WKBundlePageRef pageRef, WKBundlePageBannerRef bannerRef) +{ + toImpl(pageRef)->setFooterPageBanner(toImpl(bannerRef)); } bool WKBundlePageHasLocalDataForURL(WKBundlePageRef pageRef, WKURLRef urlRef) @@ -348,19 +411,15 @@ void WKBundlePageListenForLayoutMilestones(WKBundlePageRef pageRef, WKLayoutMile toImpl(pageRef)->listenForLayoutMilestones(toLayoutMilestones(milestones)); } -void WKBundlePageDeliverIntentToFrame(WKBundlePageRef pageRef, WKBundleFrameRef frameRef, WKBundleIntentRef intentRef) -{ -#if ENABLE(WEB_INTENTS) - toImpl(pageRef)->deliverCoreIntentToFrame(toImpl(frameRef)->frameID(), toImpl(intentRef)->coreIntent()); -#endif -} - -#if defined(ENABLE_INSPECTOR) && ENABLE_INSPECTOR WKBundleInspectorRef WKBundlePageGetInspector(WKBundlePageRef pageRef) { +#if ENABLE(INSPECTOR) return toAPI(toImpl(pageRef)->inspector()); -} +#else + UNUSED_PARAM(pageRef); + return 0; #endif +} void WKBundlePageForceRepaint(WKBundlePageRef page) { @@ -443,9 +502,17 @@ void WKBundlePageConfirmCompositionWithText(WKBundlePageRef pageRef, WKStringRef toImpl(pageRef)->confirmCompositionForTesting(toWTFString(text)); } -bool WKBundlePageCanShowMIMEType(WKBundlePageRef, WKStringRef mimeTypeRef) +bool WKBundlePageCanShowMIMEType(WKBundlePageRef pageRef, WKStringRef mimeTypeRef) +{ + return toImpl(pageRef)->canShowMIMEType(toWTFString(mimeTypeRef)); +} + +WKRenderingSuppressionToken WKBundlePageExtendIncrementalRenderingSuppression(WKBundlePageRef pageRef) { - const String mimeType = toWTFString(mimeTypeRef); + return toImpl(pageRef)->extendIncrementalRenderingSuppression(); +} - return WebCore::MIMETypeRegistry::canShowMIMEType(mimeType); +void WKBundlePageStopExtendingIncrementalRenderingSuppression(WKBundlePageRef pageRef, WKRenderingSuppressionToken token) +{ + toImpl(pageRef)->stopExtendingIncrementalRenderingSuppression(token); } diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h index c2b37894a..103f478a1 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h @@ -109,9 +109,10 @@ typedef void (*WKBundlePageWillDisconnectDOMWindowExtensionFromGlobalObjectCallb typedef void (*WKBundlePageDidReconnectDOMWindowExtensionToGlobalObjectCallback)(WKBundlePageRef page, WKBundleDOMWindowExtensionRef, const void* clientInfo); typedef void (*WKBundlePageWillDestroyGlobalObjectForDOMWindowExtensionCallback)(WKBundlePageRef page, WKBundleDOMWindowExtensionRef, const void* clientInfo); typedef bool (*WKBundlePageShouldForceUniversalAccessFromLocalURLCallback)(WKBundlePageRef, WKStringRef url, const void* clientInfo); -typedef void (*WKBundlePageDidReceiveIntentForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleIntentRequestRef intentRequest, WKTypeRef* userData, const void* clientInfo); -typedef void (*WKBundlePageRegisterIntentServiceForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKIntentServiceInfoRef serviceInfo, WKTypeRef* userData, const void* clientInfo); typedef void (*WKBundlePageDidLayoutCallback)(WKBundlePageRef page, WKLayoutMilestones milestones, WKTypeRef* userData, const void *clientInfo); +typedef void (*WKBundlePageFeaturesUsedInPageCallback)(WKBundlePageRef page, WKArrayRef featureStrings, const void *clientInfo); +typedef void (*WKBundlePageWillLoadURLRequestCallback)(WKBundlePageRef page, WKURLRequestRef request, WKTypeRef userData, const void *clientInfo); +typedef void (*WKBundlePageWillLoadDataRequestCallback)(WKBundlePageRef page, WKURLRequestRef request, WKDataRef data, WKStringRef MIMEType, WKStringRef encodingName, WKURLRef unreachableURL, WKTypeRef userData, const void *clientInfo); struct WKBundlePageLoaderClient { int version; @@ -152,15 +153,22 @@ struct WKBundlePageLoaderClient { WKBundlePageShouldForceUniversalAccessFromLocalURLCallback shouldForceUniversalAccessFromLocalURL; // Version 3 - WKBundlePageDidReceiveIntentForFrameCallback didReceiveIntentForFrame; - WKBundlePageRegisterIntentServiceForFrameCallback registerIntentServiceForFrame; + void * didReceiveIntentForFrame_unavailable; + void * registerIntentServiceForFrame_unavailable; // Version 4 WKBundlePageDidLayoutCallback didLayout; + + // Version 5 + WKBundlePageFeaturesUsedInPageCallback featuresUsedInPage; + + // Version 6 + WKBundlePageWillLoadURLRequestCallback willLoadURLRequest; + WKBundlePageWillLoadDataRequestCallback willLoadDataRequest; }; typedef struct WKBundlePageLoaderClient WKBundlePageLoaderClient; -enum { kWKBundlePageLoaderClientCurrentVersion = 4 }; +enum { kWKBundlePageLoaderClientCurrentVersion = 6 }; enum { WKBundlePagePolicyActionPassThrough, @@ -225,7 +233,13 @@ enum { WKBundlePageUIElementHidden }; typedef uint32_t WKBundlePageUIElementVisibility; - + +enum { + WKBundlePageLabelSizeSmall, + WKBundlePageLabelSizeLarge, +}; +typedef uint32_t WKBundlePageLabelSize; + // UI Client typedef void (*WKBundlePageWillAddMessageToConsoleCallback)(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo); typedef void (*WKBundlePageWillSetStatusbarTextCallback)(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo); @@ -242,6 +256,10 @@ typedef WKBundlePageUIElementVisibility (*WKBundlePageMenuBarIsVisibleCallback)( typedef WKBundlePageUIElementVisibility (*WKBundlePageToolbarsAreVisibleCallback)(WKBundlePageRef page, const void *clientInfo); typedef void (*WKBundlePageReachedAppCacheOriginQuotaCallback)(WKBundlePageRef page, WKSecurityOriginRef origin, int64_t totalBytesNeeded, const void *clientInfo); typedef uint64_t (*WKBundlePageExceededDatabaseQuotaCallback)(WKBundlePageRef page, WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef databaseDisplayName, uint64_t currentQuotaBytes, uint64_t currentOriginUsageBytes, uint64_t currentDatabaseUsageBytes, uint64_t expectedUsageBytes, const void *clientInfo); +typedef WKStringRef (*WKBundlePagePlugInCreateStartLabelTitleCallback)(WKStringRef mimeType, const void *clientInfo); +typedef WKStringRef (*WKBundlePagePlugInCreateStartLabelSubtitleCallback)(WKStringRef mimeType, const void *clientInfo); +typedef WKStringRef (*WKBundlePagePlugInCreateExtraStyleSheetCallback)(const void *clientInfo); +typedef WKStringRef (*WKBundlePagePlugInCreateExtraScriptCallback)(const void *clientInfo); struct WKBundlePageUIClient { int version; @@ -266,7 +284,10 @@ struct WKBundlePageUIClient { // Version 2. WKBundlePageExceededDatabaseQuotaCallback didExceedDatabaseQuota; - + WKBundlePagePlugInCreateStartLabelTitleCallback createPlugInStartLabelTitle; + WKBundlePagePlugInCreateStartLabelSubtitleCallback createPlugInStartLabelSubtitle; + WKBundlePagePlugInCreateExtraStyleSheetCallback createPlugInExtraStyleSheet; + WKBundlePagePlugInCreateExtraScriptCallback createPlugInExtraScript; }; typedef struct WKBundlePageUIClient WKBundlePageUIClient; @@ -281,6 +302,9 @@ typedef bool (*WKBundlePageShouldDeleteRangeCallback)(WKBundlePageRef page, WKBu typedef bool (*WKBundlePageShouldChangeSelectedRange)(WKBundlePageRef page, WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType affinity, bool stillSelecting, const void* clientInfo); typedef bool (*WKBundlePageShouldApplyStyle)(WKBundlePageRef page, WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range, const void* clientInfo); typedef void (*WKBundlePageEditingNotification)(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo); +typedef void (*WKBundlePageWillWriteToPasteboard)(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo); +typedef void (*WKBundlePageGetPasteboardDataForRange)(WKBundlePageRef page, WKBundleRangeHandleRef range, WKArrayRef* pasteboardTypes, WKArrayRef* pasteboardData, const void* clientInfo); +typedef void (*WKBundlePageDidWriteToPasteboard)(WKBundlePageRef page, const void* clientInfo); struct WKBundlePageEditorClient { int version; @@ -296,10 +320,14 @@ struct WKBundlePageEditorClient { WKBundlePageEditingNotification didEndEditing; WKBundlePageEditingNotification didChange; WKBundlePageEditingNotification didChangeSelection; + // Version 1. + WKBundlePageWillWriteToPasteboard willWriteToPasteboard; + WKBundlePageGetPasteboardDataForRange getPasteboardDataForRange; + WKBundlePageDidWriteToPasteboard didWriteToPasteboard; }; typedef struct WKBundlePageEditorClient WKBundlePageEditorClient; -enum { kWKBundlePageEditorClientCurrentVersion = 0 }; +enum { kWKBundlePageEditorClientCurrentVersion = 1 }; // Form client typedef void (*WKBundlePageTextFieldDidBeginEditingCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKBundleFrameRef frame, const void* clientInfo); @@ -309,6 +337,9 @@ typedef void (*WKBundlePageTextDidChangeInTextAreaCallback)(WKBundlePageRef page typedef bool (*WKBundlePageShouldPerformActionInTextFieldCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKInputFieldActionType actionType, WKBundleFrameRef frame, const void* clientInfo); typedef void (*WKBundlePageWillSubmitFormCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlFormElementHandle, WKBundleFrameRef frame, WKBundleFrameRef sourceFrame, WKDictionaryRef values, WKTypeRef* userData, const void* clientInfo); typedef void (*WKBundlePageWillSendSubmitEventCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlFormElementHandle, WKBundleFrameRef frame, WKBundleFrameRef sourceFrame, WKDictionaryRef values, const void* clientInfo); +typedef void (*WKBundlePageDidFocusTextFieldCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKBundleFrameRef frame, const void* clientInfo); +typedef bool (*WKBundlePageShouldNotifyOnFormChangesCallback)(WKBundlePageRef page, const void* clientInfo); +typedef void (*WKBundlePageDidAssociateFormControlsCallback)(WKBundlePageRef page, WKArrayRef elementHandles, const void* clientInfo); struct WKBundlePageFormClient { int version; @@ -324,10 +355,15 @@ struct WKBundlePageFormClient { // Version 1. WKBundlePageWillSendSubmitEventCallback willSendSubmitEvent; + + // version 2. + WKBundlePageDidFocusTextFieldCallback didFocusTextField; + WKBundlePageShouldNotifyOnFormChangesCallback shouldNotifyOnFormChanges; + WKBundlePageDidAssociateFormControlsCallback didAssociateFormControls; }; typedef struct WKBundlePageFormClient WKBundlePageFormClient; -enum { kWKBundlePageFormClientCurrentVersion = 1 }; +enum { kWKBundlePageFormClientCurrentVersion = 2 }; // ContextMenu client typedef void (*WKBundlePageGetContextMenuFromDefaultContextMenuCallback)(WKBundlePageRef page, WKBundleHitTestResultRef hitTestResult, WKArrayRef defaultMenu, WKArrayRef* newMenu, WKTypeRef* userData, const void* clientInfo); @@ -406,6 +442,15 @@ WK_EXPORT void WKBundlePageSetUnderlayPage(WKBundlePageRef page, WKBundlePageRef WK_EXPORT void WKBundlePageInstallPageOverlay(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay); WK_EXPORT void WKBundlePageUninstallPageOverlay(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay); +WK_EXPORT void WKBundlePageInstallPageOverlayWithAnimation(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay); +WK_EXPORT void WKBundlePageUninstallPageOverlayWithAnimation(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay); + +WK_EXPORT void WKBundlePageSetTopOverhangImage(WKBundlePageRef page, WKImageRef image); +WK_EXPORT void WKBundlePageSetBottomOverhangImage(WKBundlePageRef page, WKImageRef image); + +WK_EXPORT void WKBundlePageSetHeaderBanner(WKBundlePageRef page, WKBundlePageBannerRef banner); +WK_EXPORT void WKBundlePageSetFooterBanner(WKBundlePageRef page, WKBundlePageBannerRef banner); + WK_EXPORT bool WKBundlePageHasLocalDataForURL(WKBundlePageRef page, WKURLRef url); WK_EXPORT bool WKBundlePageCanHandleRequest(WKURLRequestRef request); @@ -425,11 +470,7 @@ WK_EXPORT double WKBundlePageGetBackingScaleFactor(WKBundlePageRef page); WK_EXPORT void WKBundlePageListenForLayoutMilestones(WKBundlePageRef page, WKLayoutMilestones milestones); -WK_EXPORT void WKBundlePageDeliverIntentToFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleIntentRef intent); - -#if defined(ENABLE_INSPECTOR) && ENABLE_INSPECTOR WK_EXPORT WKBundleInspectorRef WKBundlePageGetInspector(WKBundlePageRef page); -#endif #ifdef __cplusplus } diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageBanner.cpp index 463a21155..be0955e1c 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageBanner.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Apple Inc. All rights reserved. + * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -24,20 +24,15 @@ */ #include "config.h" -#include "WKBundlePrivateWin.h" +#include "WKBundlePageBanner.h" -#include "InjectedBundle.h" +#include "PageBanner.h" #include "WKAPICast.h" #include "WKBundleAPICast.h" using namespace WebKit; -void WKBundleSetHostAllowsAnyHTTPSCertificate(WKBundleRef bundleRef, WKStringRef host) +WKTypeID WKBundlePageBannerGetTypeID() { - toImpl(bundleRef)->setHostAllowsAnyHTTPSCertificate(toWTFString(host)); -} - -void WKBundleSetClientCertificate(WKBundleRef bundleRef, WKStringRef host, WKStringRef certificateSystemStoreName, WKCertificateInfoRef certificateInfoRef) -{ - toImpl(bundleRef)->setClientCertificate(toWTFString(host), toWTFString(certificateSystemStoreName), toImpl(certificateInfoRef)); + return toAPI(PageBanner::APIType); } diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageBanner.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageBanner.h new file mode 100644 index 000000000..18c0d48f9 --- /dev/null +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageBanner.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2013 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 WKBundlePageBanner_h +#define WKBundlePageBanner_h + +#include <WebKit2/WKBase.h> +#include <WebKit2/WKEvent.h> +#include <WebKit2/WKGeometry.h> + +#ifndef __cplusplus +#include <stdbool.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// Page banner client. +typedef bool (*WKBundlePageBannerMouseDownCallback)(WKBundlePageBannerRef pageBanner, WKPoint position, WKEventMouseButton mouseButton, const void* clientInfo); +typedef bool (*WKBundlePageBannerMouseUpCallback)(WKBundlePageBannerRef pageBanner, WKPoint position, WKEventMouseButton mouseButton, const void* clientInfo); +typedef bool (*WKBundlePageBannerMouseMovedCallback)(WKBundlePageBannerRef pageBanner, WKPoint position, const void* clientInfo); +typedef bool (*WKBundlePageBannerMouseDraggedCallback)(WKBundlePageBannerRef pageBanner, WKPoint position, WKEventMouseButton mouseButton, const void* clientInfo); + +struct WKBundlePageBannerClient { + int version; + const void * clientInfo; + WKBundlePageBannerMouseDownCallback mouseDown; + WKBundlePageBannerMouseUpCallback mouseUp; + WKBundlePageBannerMouseMovedCallback mouseMoved; + WKBundlePageBannerMouseDraggedCallback mouseDragged; +}; +typedef struct WKBundlePageBannerClient WKBundlePageBannerClient; + +enum { kWKBundlePageBannerClientCurrentVersion = 0 }; + +WK_EXPORT WKTypeID WKBundlePageBannerGetTypeID(); + +#ifdef __cplusplus +} +#endif + +#endif // WKBundlePageBanner_h diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h index d769fb4c1..b52dc13cf 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2011, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,6 +38,7 @@ WK_EXPORT bool WKBundlePageIsEditingCommandEnabled(WKBundlePageRef page, WKStrin WK_EXPORT void WKBundlePageClearMainFrameName(WKBundlePageRef page); WK_EXPORT void WKBundlePageClose(WKBundlePageRef page); WK_EXPORT WKStringRef WKBundlePageCopyRenderTreeExternalRepresentation(WKBundlePageRef page); +WK_EXPORT WKStringRef WKBundlePageCopyRenderTreeExternalRepresentationForPrinting(WKBundlePageRef page); WK_EXPORT void WKBundlePageExecuteEditingCommand(WKBundlePageRef page, WKStringRef commandName, WKStringRef argument); WK_EXPORT double WKBundlePageGetTextZoomFactor(WKBundlePageRef page); @@ -78,6 +79,12 @@ WK_EXPORT void* WKAccessibilityRootObject(WKBundlePageRef); WK_EXPORT void* WKAccessibilityFocusedObject(WKBundlePageRef); WK_EXPORT WKArrayRef WKBundlePageCopyContextMenuItemTitles(WKBundlePageRef); +WK_EXPORT WKArrayRef WKBundlePageCopyContextMenuAtPointInWindow(WKBundlePageRef, WKPoint); + +// This only works if the SuppressesIncrementalRendering preference is set as well. +typedef unsigned WKRenderingSuppressionToken; +WK_EXPORT WKRenderingSuppressionToken WKBundlePageExtendIncrementalRenderingSuppression(WKBundlePageRef); +WK_EXPORT void WKBundlePageStopExtendingIncrementalRenderingSuppression(WKBundlePageRef, WKRenderingSuppressionToken); #ifdef __cplusplus } diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h index f46dcc866..af18e3c2d 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h @@ -66,7 +66,8 @@ WK_EXPORT void WKBundleSetUserStyleSheetLocation(WKBundleRef bundle, WKBundlePag WK_EXPORT void WKBundleSetWebNotificationPermission(WKBundleRef bundle, WKBundlePageRef page, WKStringRef originStringRef, bool allowed); WK_EXPORT void WKBundleRemoveAllWebNotificationPermissions(WKBundleRef bundle, WKBundlePageRef page); WK_EXPORT uint64_t WKBundleGetWebNotificationID(WKBundleRef bundle, JSContextRef context, JSValueRef notification); -WK_EXPORT void WKBundleSetMinimumTimerInterval(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, double interval); +WK_EXPORT WKDataRef WKBundleCreateWKDataFromUInt8Array(WKBundleRef bundle, JSContextRef context, JSValueRef data); +WK_EXPORT void WKBundleSetAsynchronousSpellCheckingEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled); // UserContent API WK_EXPORT void WKBundleAddUserScript(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKBundleScriptWorldRef scriptWorld, WKStringRef source, WKURLRef url, WKArrayRef whitelist, WKArrayRef blacklist, WKUserScriptInjectionTime injectionTime, WKUserContentInjectedFrames injectedFrames); @@ -97,11 +98,10 @@ WK_EXPORT size_t WKBundleGetJavaScriptObjectsCount(WKBundleRef bundle); WK_EXPORT bool WKBundleIsProcessingUserGesture(WKBundleRef bundle); -WK_EXPORT size_t WKBundleGetWorkerThreadCount(WKBundleRef bundle); - WK_EXPORT void WKBundleSetTabKeyCyclesThroughElements(WKBundleRef bundle, WKBundlePageRef page, bool enabled); WK_EXPORT void WKBundleSetSerialLoadingEnabled(WKBundleRef bundle, bool enabled); WK_EXPORT void WKBundleSetShadowDOMEnabled(WKBundleRef bundle, bool enabled); +WK_EXPORT void WKBundleSetSeamlessIFramesEnabled(WKBundleRef bundle, bool enabled); WK_EXPORT void WKBundleDispatchPendingLoadRequests(WKBundleRef bundle); #ifdef __cplusplus diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp index c868fab77..fb2f7d05f 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp @@ -25,6 +25,7 @@ #include "config.h" #include "WKBundleRangeHandle.h" +#include "WKBundleRangeHandlePrivate.h" #include "InjectedBundleRangeHandle.h" #include "WKAPICast.h" @@ -36,3 +37,9 @@ WKTypeID WKBundleRangeHandleGetTypeID() { return toAPI(InjectedBundleRangeHandle::APIType); } + +WKBundleRangeHandleRef WKBundleRangeHandleCreate(JSContextRef contextRef, JSObjectRef objectRef) +{ + RefPtr<InjectedBundleRangeHandle> rangeHandle = InjectedBundleRangeHandle::getOrCreate(contextRef, objectRef); + return toAPI(rangeHandle.release().leakRef()); +} diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandlePrivate.h index 03006dc11..54f845024 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandlePrivate.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Apple Inc. All rights reserved. + * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,20 +23,20 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WKBundlePrivateWin_h -#define WKBundlePrivateWin_h +#ifndef WKBundleRangeHandlePrivate_h +#define WKBundleRangeHandlePrivate_h +#include <JavaScriptCore/JavaScript.h> #include <WebKit2/WKBase.h> #ifdef __cplusplus extern "C" { #endif -WK_EXPORT void WKBundleSetHostAllowsAnyHTTPSCertificate(WKBundleRef bundle, WKStringRef host); -WK_EXPORT void WKBundleSetClientCertificate(WKBundleRef bundle, WKStringRef host, WKStringRef certificateSystemStoreName, WKCertificateInfoRef certificateInfo); +WK_EXPORT WKBundleRangeHandleRef WKBundleRangeHandleCreate(JSContextRef context, JSObjectRef object); #ifdef __cplusplus } #endif -#endif /* WKBundlePrivateWin_h */ +#endif // WKBundleRangeHandlePrivate_h diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.h index 105afa4f9..ed04b0c5f 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleIntentRequest.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Intel Corporation. All rights reserved. + * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,24 +23,25 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WKBundleIntentRequest_h -#define WKBundleIntentRequest_h +#ifndef WKBundlePageBannerMac_h +#define WKBundlePageBannerMac_h #include <WebKit2/WKBase.h> +#include <WebKit2/WKBundlePageBanner.h> + +@class CALayer; #ifdef __cplusplus extern "C" { #endif -WK_EXPORT WKTypeID WKBundleIntentRequestGetTypeID(); - -WK_EXPORT WKBundleIntentRef WKBundleIntentRequestCopyIntent(WKBundleIntentRequestRef request); +WK_EXPORT WKBundlePageBannerRef WKBundlePageBannerCreateBannerWithCALayer(CALayer *layer, int height, WKBundlePageBannerClient * client); -WK_EXPORT void WKBundleIntentRequestPostResult(WKBundleIntentRequestRef request, WKSerializedScriptValueRef serializedData); -WK_EXPORT void WKBundleIntentRequestPostFailure(WKBundleIntentRequestRef request, WKSerializedScriptValueRef serializedData); +WK_EXPORT CALayer * WKBundlePageBannerGetLayer(WKBundlePageBannerRef pageBanner); #ifdef __cplusplus } #endif -#endif /* WKBundleIntentRequest_h */ + +#endif /* WKBundlePageBannerMac_h */ diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm b/Source/WebKit2/WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm new file mode 100644 index 000000000..3b3169e78 --- /dev/null +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2013 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 "config.h" +#include "WKBundlePageBannerMac.h" + +#include "PageBanner.h" +#include "WKAPICast.h" +#include "WKBundleAPICast.h" +#include <wtf/PassOwnPtr.h> + +using namespace WebCore; +using namespace WebKit; + +class PageBannerClientImpl : public PageBanner::Client { +public: + static PassOwnPtr<PageBannerClientImpl> create(WKBundlePageBannerClient* client) + { + return adoptPtr(new PageBannerClientImpl(client)); + } + +private: + explicit PageBannerClientImpl(WKBundlePageBannerClient* client) + : m_client() + { + if (client) + m_client = *client; + } + + // PageBanner::Client. + virtual void pageBannerDestroyed(PageBanner*) + { + delete this; + } + + virtual bool mouseEvent(PageBanner* pageBanner, WebEvent::Type type, WebMouseEvent::Button button, const WebCore::IntPoint& position) + { + switch (type) { + case WebEvent::MouseDown: { + if (!m_client.mouseDown) + return false; + + return m_client.mouseDown(toAPI(pageBanner), toAPI(position), toAPI(button), m_client.clientInfo); + } + case WebEvent::MouseUp: { + if (!m_client.mouseUp) + return false; + + return m_client.mouseUp(toAPI(pageBanner), toAPI(position), toAPI(button), m_client.clientInfo); + } + case WebEvent::MouseMove: { + if (button == WebMouseEvent::NoButton) { + if (!m_client.mouseMoved) + return false; + + return m_client.mouseMoved(toAPI(pageBanner), toAPI(position), m_client.clientInfo); + } + + // This is a MouseMove event with a mouse button pressed. Call mouseDragged. + if (!m_client.mouseDragged) + return false; + + return m_client.mouseDragged(toAPI(pageBanner), toAPI(position), toAPI(button), m_client.clientInfo); + } + + default: + return false; + } + } + + WKBundlePageBannerClient m_client; +}; + +WKBundlePageBannerRef WKBundlePageBannerCreateBannerWithCALayer(CALayer *layer, int height, WKBundlePageBannerClient * wkClient) +{ + if (wkClient && wkClient->version) + return 0; + + OwnPtr<PageBannerClientImpl> clientImpl = PageBannerClientImpl::create(wkClient); + return toAPI(PageBanner::create(layer, height, clientImpl.leakPtr()).leakRef()); +} + +CALayer * WKBundlePageBannerGetLayer(WKBundlePageBannerRef pageBanner) +{ + return toImpl(pageBanner)->layer(); +} |