diff options
Diffstat (limited to 'Source/WebKit2/WebProcess/InjectedBundle/API/c')
4 files changed, 30 insertions, 0 deletions
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp index 95273a704..e7d5611f0 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp @@ -77,6 +77,11 @@ void WKBundleActivateMacFontAscentHack(WKBundleRef bundleRef) toImpl(bundleRef)->activateMacFontAscentHack(); } +void WKBundleSetCacheModel(WKBundleRef bundleRef, uint32_t cacheModel) +{ + toImpl(bundleRef)->setCacheModel(cacheModel); +} + void WKBundleGarbageCollectJavaScriptObjects(WKBundleRef bundleRef) { toImpl(bundleRef)->garbageCollectJavaScriptObjects(); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp index 53ddf6107..005811ac0 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp @@ -30,13 +30,19 @@ #include "InjectedBundleBackForwardList.h" #include "InjectedBundleNodeHandle.h" #include "WKAPICast.h" +#include "WKArray.h" #include "WKBundleAPICast.h" +#include "WKRetainPtr.h" +#include "WKString.h" +#include "WebContextMenu.h" +#include "WebContextMenuItem.h" #include "WebFrame.h" #include "WebFullScreenManager.h" #include "WebImage.h" #include "WebPage.h" #include "WebRenderLayer.h" #include "WebRenderObject.h" +#include "WebString.h" #include "WebURL.h" #include "WebURLRequest.h" @@ -145,6 +151,22 @@ WKBundleFrameRef WKBundlePageGetMainFrame(WKBundlePageRef pageRef) return toAPI(toImpl(pageRef)->mainWebFrame()); } +WKArrayRef WKBundlePageCopyContextMenuItemTitles(WKBundlePageRef pageRef) +{ +#if ENABLE(CONTEXT_MENUS) + WebContextMenu* contextMenu = toImpl(pageRef)->contextMenu(); + const Vector<WebContextMenuItemData> &items = contextMenu->items(); + size_t arrayLength = items.size(); + OwnArrayPtr<WKTypeRef> itemNames = adoptArrayPtr(new WKTypeRef[arrayLength]); + for (size_t i = 0; i < arrayLength; ++i) + itemNames[i] = WKStringCreateWithUTF8CString(items[i].title().utf8().data()); + + return WKArrayCreateAdoptingValues(itemNames.get(), arrayLength); +#else + return 0; +#endif +} + void* WKAccessibilityRootObject(WKBundlePageRef pageRef) { #if HAVE(ACCESSIBILITY) diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h index 11b20dc93..d769fb4c1 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h @@ -77,6 +77,8 @@ WK_EXPORT bool WKBundlePageCanShowMIMEType(WKBundlePageRef, WKStringRef mimeType WK_EXPORT void* WKAccessibilityRootObject(WKBundlePageRef); WK_EXPORT void* WKAccessibilityFocusedObject(WKBundlePageRef); +WK_EXPORT WKArrayRef WKBundlePageCopyContextMenuItemTitles(WKBundlePageRef); + #ifdef __cplusplus } #endif diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h index 15b2e7c85..2cacb5976 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h @@ -41,6 +41,7 @@ WK_EXPORT void WKBundleSetShouldTrackVisitedLinks(WKBundleRef bundle, bool shoul WK_EXPORT void WKBundleSetAlwaysAcceptCookies(WKBundleRef bundle, bool); WK_EXPORT void WKBundleRemoveAllVisitedLinks(WKBundleRef bundle); WK_EXPORT void WKBundleActivateMacFontAscentHack(WKBundleRef bundle); +WK_EXPORT void WKBundleSetCacheModel(WKBundleRef bundle, uint32_t cacheModel); // Will make WebProcess ignore this preference until a preferences change notification, only for WebKitTestRunner use. WK_EXPORT void WKBundleOverrideBoolPreferenceForTestRunner(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKStringRef preference, bool enabled); WK_EXPORT void WKBundleSetAllowUniversalAccessFromFileURLs(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); |