diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2016-08-25 19:20:41 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-02-02 12:30:55 +0000 |
commit | 6882a04fb36642862b11efe514251d32070c3d65 (patch) | |
tree | b7959826000b061fd5ccc7512035c7478742f7b0 /Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp | |
parent | ab6df191029eeeb0b0f16f127d553265659f739e (diff) | |
download | qtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz |
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp index 61b380803..0b6dc7f7a 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp @@ -27,16 +27,24 @@ #include "WKBundleFrame.h" #include "WKBundleFramePrivate.h" +#include "APIArray.h" +#include "APISecurityOrigin.h" +#include "InjectedBundleFileHandle.h" #include "InjectedBundleHitTestResult.h" +#include "InjectedBundleNodeHandle.h" +#include "InjectedBundleRangeHandle.h" +#include "InjectedBundleScriptWorld.h" #include "WKAPICast.h" #include "WKBundleAPICast.h" #include "WKData.h" #include "WebFrame.h" -#include "WebSecurityOrigin.h" +#include "WebPage.h" #include <WebCore/Document.h> +#include <WebCore/FocusController.h> #include <WebCore/Frame.h> #include <WebCore/FrameLoader.h> #include <WebCore/FrameView.h> +#include <WebCore/Page.h> using namespace WebCore; using namespace WebKit; @@ -72,11 +80,7 @@ WKFrameLoadState WKBundleFrameGetFrameLoadState(WKBundleFrameRef frameRef) if (!coreFrame) return kWKFrameLoadStateFinished; - FrameLoader* loader = coreFrame->loader(); - if (!loader) - return kWKFrameLoadStateFinished; - - switch (loader->state()) { + switch (coreFrame->loader().state()) { case FrameStateProvisional: return kWKFrameLoadStateProvisional; case FrameStateCommittedPage: @@ -91,7 +95,7 @@ WKFrameLoadState WKBundleFrameGetFrameLoadState(WKBundleFrameRef frameRef) WKArrayRef WKBundleFrameCopyChildFrames(WKBundleFrameRef frameRef) { - return toAPI(toImpl(frameRef)->childFrames().leakRef()); + return toAPI(&toImpl(frameRef)->childFrames().leakRef()); } JSGlobalContextRef WKBundleFrameGetJavaScriptContext(WKBundleFrameRef frameRef) @@ -119,6 +123,11 @@ JSValueRef WKBundleFrameGetJavaScriptWrapperForRangeForWorld(WKBundleFrameRef fr return toImpl(frameRef)->jsWrapperForWorld(toImpl(rangeHandleRef), toImpl(worldRef)); } +JSValueRef WKBundleFrameGetJavaScriptWrapperForFileForWorld(WKBundleFrameRef frameRef, WKBundleFileHandleRef fileHandleRef, WKBundleScriptWorldRef worldRef) +{ + return toImpl(frameRef)->jsWrapperForWorld(toImpl(fileHandleRef), toImpl(worldRef)); +} + WKStringRef WKBundleFrameCopyName(WKBundleFrameRef frameRef) { return toCopiedAPI(toImpl(frameRef)->name()); @@ -148,7 +157,7 @@ void WKBundleFrameClearOpener(WKBundleFrameRef frameRef) { Frame* coreFrame = toImpl(frameRef)->coreFrame(); if (coreFrame) - coreFrame->loader()->setOpener(0); + coreFrame->loader().setOpener(0); } void WKBundleFrameStopLoading(WKBundleFrameRef frameRef) @@ -163,7 +172,7 @@ WKStringRef WKBundleFrameCopyLayerTreeAsText(WKBundleFrameRef frameRef) bool WKBundleFrameAllowsFollowingLink(WKBundleFrameRef frameRef, WKURLRef urlRef) { - return toImpl(frameRef)->allowsFollowingLink(WebCore::KURL(WebCore::KURL(), toWTFString(urlRef))); + return toImpl(frameRef)->allowsFollowingLink(WebCore::URL(WebCore::URL(), toWTFString(urlRef))); } bool WKBundleFrameHandlesPageScaleGesture(WKBundleFrameRef frameRef) @@ -208,12 +217,12 @@ bool WKBundleFrameGetDocumentBackgroundColor(WKBundleFrameRef frameRef, double* WKStringRef WKBundleFrameCopySuggestedFilenameForResourceWithURL(WKBundleFrameRef frameRef, WKURLRef urlRef) { - return toCopiedAPI(toImpl(frameRef)->suggestedFilenameForResourceWithURL(WebCore::KURL(WebCore::KURL(), toWTFString(urlRef)))); + return toCopiedAPI(toImpl(frameRef)->suggestedFilenameForResourceWithURL(WebCore::URL(WebCore::URL(), toWTFString(urlRef)))); } WKStringRef WKBundleFrameCopyMIMETypeForResourceWithURL(WKBundleFrameRef frameRef, WKURLRef urlRef) { - return toCopiedAPI(toImpl(frameRef)->mimeTypeForResourceWithURL(WebCore::KURL(WebCore::KURL(), toWTFString(urlRef)))); + return toCopiedAPI(toImpl(frameRef)->mimeTypeForResourceWithURL(WebCore::URL(WebCore::URL(), toWTFString(urlRef)))); } bool WKBundleFrameContainsAnyFormElements(WKBundleFrameRef frameRef) @@ -231,6 +240,11 @@ void WKBundleFrameSetTextDirection(WKBundleFrameRef frameRef, WKStringRef direct toImpl(frameRef)->setTextDirection(toWTFString(directionRef)); } +void WKBundleFrameSetAccessibleName(WKBundleFrameRef frameRef, WKStringRef accessibleNameRef) +{ + toImpl(frameRef)->setAccessibleName(toWTFString(accessibleNameRef)); +} + WKDataRef WKBundleFrameCopyWebArchive(WKBundleFrameRef frameRef) { return WKBundleFrameCopyWebArchiveFilteringSubframes(frameRef, 0, 0); @@ -238,7 +252,7 @@ WKDataRef WKBundleFrameCopyWebArchive(WKBundleFrameRef frameRef) WKDataRef WKBundleFrameCopyWebArchiveFilteringSubframes(WKBundleFrameRef frameRef, WKBundleFrameFrameFilterCallback frameFilterCallback, void* context) { -#if PLATFORM(MAC) +#if PLATFORM(COCOA) RetainPtr<CFDataRef> data = toImpl(frameRef)->webArchiveData(frameFilterCallback, context); if (data) return WKDataCreate(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get())); @@ -257,7 +271,7 @@ bool WKBundleFrameCallShouldCloseOnWebView(WKBundleFrameRef frameRef) if (!coreFrame) return true; - return coreFrame->loader()->shouldClose(); + return coreFrame->loader().shouldClose(); } WKBundleHitTestResultRef WKBundleFrameCreateHitTestResult(WKBundleFrameRef frameRef, WKPoint point) @@ -273,3 +287,12 @@ WKSecurityOriginRef WKBundleFrameCopySecurityOrigin(WKBundleFrameRef frameRef) return toCopiedAPI(coreFrame->document()->securityOrigin()); } + +void WKBundleFrameFocus(WKBundleFrameRef frameRef) +{ + Frame* coreFrame = toImpl(frameRef)->coreFrame(); + if (!coreFrame) + return; + + coreFrame->page()->focusController().setFocusedFrame(coreFrame); +} |