Esempio n. 1
0
static void updateTextInputState(WKViewRef, const NIXTextInputState* state, const void*)
{
    didUpdateTextInputState = true;

    memcpy(&stateReceived, state, sizeof(NIXTextInputState));
    WKRetain(stateReceived.surroundingText);
    WKRetain(stateReceived.submitLabel);
}
Esempio n. 2
0
WKPageRef Tab::createNewPageCallback(WKPageRef, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void* clientInfo)
{
    Tab* self = ((Tab*)clientInfo);
    Tab* newTab = self->m_browser->requestTab(self);
    WKRetain(newTab->m_page);
    return newTab->m_page;
}
/* WKContextConnectionClient */
static void didCreateConnection(WKContextRef context, WKConnectionRef connection, const void* clientInfo)
{
    connectionEstablished = true;

    // Store off the conneciton to use.
    connectionToBundle = (WKConnectionRef)WKRetain(connection);
}
Esempio n. 4
0
Tab::Tab(Tab* parent)
    : m_id(nextTabId++)
    , m_browser(parent->m_browser)
    , m_context(parent->m_context)
{
    WKRetain(m_context);
    init();
}
WKPageRef TestController::createOtherPage(WKPageRef oldPage, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*)
{
    PlatformWebView* view = new PlatformWebView(WKPageGetContext(oldPage), WKPageGetPageGroup(oldPage));
    WKPageRef newPage = view->page();

    view->resizeTo(800, 600);

    WKPageUIClient otherPageUIClient = {
        kWKPageUIClientCurrentVersion,
        view,
        0, // createNewPage_deprecatedForUseWithV0
        0, // showPage
        closeOtherPage,
        0, // takeFocus
        focus,
        unfocus,
        0, // runJavaScriptAlert        
        0, // runJavaScriptConfirm
        0, // runJavaScriptPrompt
        0, // setStatusText
        0, // mouseDidMoveOverElement_deprecatedForUseWithV0
        0, // missingPluginButtonClicked
        0, // didNotHandleKeyEvent
        0, // didNotHandleWheelEvent
        0, // toolbarsAreVisible
        0, // setToolbarsAreVisible
        0, // menuBarIsVisible
        0, // setMenuBarIsVisible
        0, // statusBarIsVisible
        0, // setStatusBarIsVisible
        0, // isResizable
        0, // setIsResizable
        getWindowFrameOtherPage,
        setWindowFrameOtherPage,
        runBeforeUnloadConfirmPanel,
        0, // didDraw
        0, // pageDidScroll
        exceededDatabaseQuota,
        0, // runOpenPanel
        0, // decidePolicyForGeolocationPermissionRequest
        0, // headerHeight
        0, // footerHeight
        0, // drawHeader
        0, // drawFooter
        0, // printFrame
        runModal,
        0, // didCompleteRubberBandForMainFrame
        0, // saveDataToFileInDownloadsFolder
        0, // shouldInterruptJavaScript
        createOtherPage,
        0, // mouseDidMoveOverElement
        0, // decidePolicyForNotificationPermissionRequest
    };
    WKPageSetPageUIClient(newPage, &otherPageUIClient);

    WKRetain(newPage);
    return newPage;
}
Esempio n. 6
0
const void *WKCreateObjectWithSize (size_t size, WKClassInfo *info)
{
    WKObjectRef object = (WKObjectRef)calloc (size, 1);
    if (!object)
        return 0;

    object->classInfo = info;
    
    WKRetain(object);
    
    return object;
}
static WKPageRef createNewPage(WKPageRef page, WKURLRequestRef urlRequest, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo)
{
    EXPECT_TRUE(openedWebView == nullptr);

    openedWebView = std::make_unique<PlatformWebView>(page);

    WKPageUIClientV5 uiClient;
    memset(&uiClient, 0, sizeof(uiClient));

    uiClient.base.version = 5;
    uiClient.runJavaScriptAlert = runJavaScriptAlert;
    WKPageSetPageUIClient(openedWebView->page(), &uiClient.base);

    WKPageClose(page);

    WKRetain(openedWebView->page());
    return openedWebView->page();
}
Esempio n. 8
0
const void *WKCollectionRetain (CFAllocatorRef allocator, const void *value)
{
    UNUSED_PARAM(allocator);
    return WKRetain (value);
}