Example #1
0
void ViewClientEfl::didChangeTooltip(WKViewRef, WKStringRef tooltip, const void* clientInfo)
{
    if (WKStringIsEmpty(tooltip))
        toEwkView(clientInfo)->smartCallback<TooltipTextUnset>().call();
    else
        toEwkView(clientInfo)->smartCallback<TooltipTextSet>().call(WKEinaSharedString(tooltip));
}
Example #2
0
void ViewClientEfl::didRenderFrame(WKViewRef, WKSize contentsSize, WKRect coveredRect, const void* clientInfo)
{
    EwkView* ewkView = toEwkView(clientInfo);
    if (WKPageUseFixedLayout(ewkView->wkPage()))
        ewkView->pageViewportController().didRenderFrame(toIntSize(contentsSize), toIntRect(coveredRect));
    else
        ewkView->scheduleUpdateDisplay();
}
Example #3
0
void ViewClientEfl::didChangeViewportAttributes(WKViewRef, WKViewportAttributesRef attributes, const void* clientInfo)
{
    EwkView* ewkView = toEwkView(clientInfo);
    ASSERT(WKPageUseFixedLayout(ewkView->wkPage()));

    // FIXME: pageViewportController should accept WKViewportAttributesRef.
    ewkView->pageViewportController().didChangeViewportAttributes(toImpl(attributes)->originalAttributes());
}
Example #4
0
void ViewClientEfl::webProcessDidRelaunch(WKViewRef viewRef, const void* clientInfo)
{
    // WebProcess just relaunched and the underlying scene from the view is not set to active by default, which
    // means from that point on we would only get a blank screen, hence we set it to active here to avoid that.
    WKViewSetIsActive(viewRef, true);

    if (const char* themePath = toEwkView(clientInfo)->themePath())
        WKViewSetThemePath(viewRef, adoptWK(WKStringCreateWithUTF8CString(themePath)).get());
}
Example #5
0
void ViewClientEfl::didChangeContentsSize(WKViewRef, WKSize size, const void* clientInfo)
{
    EwkView* ewkView = toEwkView(clientInfo);
    if (WKPageUseFixedLayout(ewkView->wkPage()))
        ewkView->pageViewportController().didChangeContentsSize(toIntSize(size));
    else
        ewkView->scheduleUpdateDisplay();

    ewkView->smartCallback<ContentsSizeChanged>().call(size);
}
Example #6
0
void ViewClientEfl::didChangeContentsPosition(WKViewRef, WKPoint position, const void* clientInfo)
{
    EwkView* ewkView = toEwkView(clientInfo);
    if (WKPageUseFixedLayout(ewkView->wkPage())) {
        ewkView->pageViewportController().pageDidRequestScroll(toIntPoint(position));
        return;
    }

    ewkView->scheduleUpdateDisplay();
}
Example #7
0
void ViewClientEfl::didCompletePageTransition(WKViewRef, const void* clientInfo)
{
    EwkView* ewkView = toEwkView(clientInfo);
    if (WKPageUseFixedLayout(ewkView->wkPage())) {
        ewkView->pageViewportController().pageTransitionViewportReady();
        return;
    }

    ewkView->scheduleUpdateDisplay();
}
Example #8
0
void ViewClientEfl::didChangeViewportAttributes(WKViewRef, WKViewportAttributesRef attributes, const void* clientInfo)
{
    EwkView* ewkView = toEwkView(clientInfo);
    if (WKPageUseFixedLayout(ewkView->wkPage())) {
        // FIXME: pageViewportController should accept WKViewportAttributesRef.
        ewkView->pageViewportController().didChangeViewportAttributes(toImpl(attributes)->originalAttributes());
        return;
    }
    ewkView->scheduleUpdateDisplay();
}
void WebFullScreenManagerProxy::exitFullScreen()
{
    if (!m_webView || !m_hasRequestedFullScreen)
        return;

    m_hasRequestedFullScreen = false;

    willExitFullScreen();
    toEwkView(m_webView)->exitFullScreen();
    didExitFullScreen();
}
void WebFullScreenManagerProxy::enterFullScreen()
{
    if (!m_webView || m_hasRequestedFullScreen)
        return;

    m_hasRequestedFullScreen = true;

    willEnterFullScreen();
    toEwkView(m_webView)->enterFullScreen();
    didEnterFullScreen();
}
Example #11
0
void ViewClientEfl::webProcessCrashed(WKViewRef, WKURLRef url, const void* clientInfo)
{
    EwkView* ewkView = toEwkView(clientInfo);

    // Check if loading was ongoing, when web process crashed.
    double loadProgress = WKPageGetEstimatedProgress(ewkView->wkPage());
    if (loadProgress >= 0 && loadProgress < 1) {
        loadProgress = 1;
        ewkView->smartCallback<LoadProgress>().call(&loadProgress);
    }

    ewkView->smartCallback<TooltipTextUnset>().call();

    bool handled = false;
    ewkView->smartCallback<WebProcessCrashed>().call(&handled);

    if (!handled) {
        WKEinaSharedString urlString(url);
        WARN("WARNING: The web process experienced a crash on '%s'.\n", static_cast<const char*>(urlString));

        // Display an error page
        ewk_view_html_string_load(ewkView->evasObject(), "The web process has crashed.", 0, urlString);
    }
}
Example #12
0
static void closePage(WKPageRef, const void* clientInfo)
{
    ewk_view_page_close(toEwkView(clientInfo));
}
Example #13
0
static WKPageRef createNewPage(WKPageRef, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void* clientInfo)
{
     return ewk_view_page_create(toEwkView(clientInfo));
}
Example #14
0
static void runJavaScriptAlert(WKPageRef, WKStringRef alertText, WKFrameRef, const void* clientInfo)
{
    ewk_view_run_javascript_alert(toEwkView(clientInfo), WKEinaSharedString(alertText));
}
Example #15
0
void ViewClientEfl::viewNeedsDisplay(WKViewRef, WKRect, const void* clientInfo)
{
    toEwkView(clientInfo)->scheduleUpdateDisplay();
}
Example #16
0
void ViewClientEfl::endColorPicker(WKViewRef, const void* clientInfo)
{
    toEwkView(clientInfo)->dismissColorPicker();
}
Example #17
0
static unsigned long long exceededDatabaseQuota(WKPageRef, WKFrameRef, WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage, const void* clientInfo)
{
    return ewk_view_database_quota_exceeded(toEwkView(clientInfo), WKEinaSharedString(databaseName), WKEinaSharedString(displayName), currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage);
}
Example #18
0
void ViewClientEfl::doneWithTouchEvent(WKViewRef, WKTouchEventRef event, bool wasEventHandled, const void* clientInfo)
{
    toEwkView(clientInfo)->doneWithTouchEvent(event, wasEventHandled);
}
Example #19
0
void ViewClientEfl::didFindZoomableArea(WKViewRef, WKPoint point, WKRect area, const void* clientInfo)
{
    toEwkView(clientInfo)->didFindZoomableArea(point, area);
}
Example #20
0
static bool runJavaScriptConfirm(WKPageRef, WKStringRef message, WKFrameRef, const void* clientInfo)
{
    return ewk_view_run_javascript_confirm(toEwkView(clientInfo), WKEinaSharedString(message));
}
Example #21
0
static WKStringRef runJavaScriptPrompt(WKPageRef, WKStringRef message, WKStringRef defaultValue, WKFrameRef, const void* clientInfo)
{
    WKEinaSharedString value = ewk_view_run_javascript_prompt(toEwkView(clientInfo), WKEinaSharedString(message), WKEinaSharedString(defaultValue));
    return value ? WKStringCreateWithUTF8CString(value) : 0;
}
Example #22
0
static void showColorPicker(WKPageRef, WKStringRef initialColor, WKColorPickerResultListenerRef listener, const void* clientInfo)
{
    WebCore::Color color = WebCore::Color(WebKit::toWTFString(initialColor));
    ewk_view_color_picker_request(toEwkView(clientInfo), color.red(), color.green(), color.blue(), color.alpha(), listener);
}
Example #23
0
static void didFindString(WKPageRef page, WKStringRef string, unsigned matchCount, const void* clientInfo)
{
    ewk_view_text_found(toEwkView(clientInfo), static_cast<unsigned int>(matchCount));
}
Example #24
0
void ViewClientEfl::showColorPicker(WKViewRef, WKStringRef colorString, WKColorPickerResultListenerRef listener, const void* clientInfo)
{
    WebCore::Color color = WebCore::Color(WebKit::toWTFString(colorString));
    toEwkView(clientInfo)->requestColorPicker(listener, color);
}
Example #25
0
void ViewClientEfl::webProcessDidRelaunch(WKViewRef viewRef, const void* clientInfo)
{
    if (const char* themePath = toEwkView(clientInfo)->themePath())
        WKViewSetThemePath(viewRef, adoptWK(WKStringCreateWithUTF8CString(themePath)).get());
}
Example #26
0
static void hideColorPicker(WKPageRef, const void* clientInfo)
{
    ewk_view_color_picker_dismiss(toEwkView(clientInfo));
}