⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frameloaderclientgtk.cpp

📁 linux下开源浏览器WebKit的源码,市面上的很多商用浏览器都是移植自WebKit
💻 CPP
📖 第 1 页 / 共 2 页
字号:
{    notImplemented();    return String();}void FrameLoaderClient::windowObjectCleared(){    // Is this obsolete now?    g_signal_emit_by_name(m_frame, "cleared");    Frame* coreFrame = core(webFrame());    ASSERT(coreFrame);    Settings* settings = coreFrame->settings();    if (!settings || !settings->isJavaScriptEnabled())        return;    // TODO: Consider using g_signal_has_handler_pending() to avoid the overhead    // when there are no handlers.    JSGlobalContextRef context = toGlobalRef(coreFrame->script()->globalObject()->globalExec());    JSObjectRef windowObject = toRef(coreFrame->script()->globalObject());    ASSERT(windowObject);    WebKitWebView* webView = getViewFromFrame(m_frame);    g_signal_emit_by_name(webView, "window-object-cleared", m_frame, context, windowObject);    // TODO: Re-attach debug clients if present.    // The Win port has an example of how we might do this.}void FrameLoaderClient::documentElementAvailable(){}void FrameLoaderClient::didPerformFirstNavigation() const{}void FrameLoaderClient::registerForIconNotification(bool){    notImplemented();}void FrameLoaderClient::setMainFrameDocumentReady(bool){    // this is only interesting once we provide an external API for the DOM}bool FrameLoaderClient::hasWebView() const{    notImplemented();    return true;}void FrameLoaderClient::dispatchDidFinishLoad(){    g_signal_emit_by_name(m_frame, "load-done", true);}void FrameLoaderClient::frameLoadCompleted(){    notImplemented();}void FrameLoaderClient::saveViewStateToItem(HistoryItem*){    notImplemented();}void FrameLoaderClient::restoreViewState(){    notImplemented();}bool FrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const{    // FIXME: This is a very simple implementation. More sophisticated    // implementation would delegate the decision to a PolicyDelegate.    // See mac implementation for example.    return item != 0;}void FrameLoaderClient::makeRepresentation(DocumentLoader*){    notImplemented();}void FrameLoaderClient::forceLayout(){    FrameView* view = core(m_frame)->view();    if (view)        view->forceLayout(true);}void FrameLoaderClient::forceLayoutForNonHTML(){    notImplemented();}void FrameLoaderClient::setCopiesOnScroll(){    notImplemented();}void FrameLoaderClient::detachedFromParent2(){    notImplemented();}void FrameLoaderClient::detachedFromParent3(){    notImplemented();}void FrameLoaderClient::dispatchDidHandleOnloadEvents(){    notImplemented();}void FrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad(){    notImplemented();}void FrameLoaderClient::dispatchDidCancelClientRedirect(){    notImplemented();}void FrameLoaderClient::dispatchWillPerformClientRedirect(const KURL&, double, double){    notImplemented();}void FrameLoaderClient::dispatchDidChangeLocationWithinPage(){    notImplemented();}void FrameLoaderClient::dispatchWillClose(){    notImplemented();}void FrameLoaderClient::dispatchDidReceiveIcon(){    WebKitWebView* webView = getViewFromFrame(m_frame);    g_signal_emit_by_name(webView, "icon-loaded", m_frame);}void FrameLoaderClient::dispatchDidStartProvisionalLoad(){}void FrameLoaderClient::dispatchDidReceiveTitle(const String& title){    g_signal_emit_by_name(m_frame, "title-changed", title.utf8().data());    WebKitWebView* webView = getViewFromFrame(m_frame);    if (m_frame == webkit_web_view_get_main_frame(webView))        g_signal_emit_by_name(webView, "title-changed", m_frame, title.utf8().data());}void FrameLoaderClient::dispatchDidCommitLoad(){    /* Update the URI once first data has been received.     * This means the URI is valid and successfully identify the page that's going to be loaded.     */    WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(m_frame);    g_free(frameData->uri);    frameData->uri = g_strdup(core(m_frame)->loader()->url().prettyURL().utf8().data());    g_signal_emit_by_name(m_frame, "load-committed");    WebKitWebView* webView = getViewFromFrame(m_frame);    if (m_frame == webkit_web_view_get_main_frame(webView))        g_signal_emit_by_name(webView, "load-committed", m_frame);}void FrameLoaderClient::dispatchDidFinishDocumentLoad(){    notImplemented();}void FrameLoaderClient::dispatchDidFirstLayout(){    notImplemented();}void FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout(){    notImplemented();}void FrameLoaderClient::dispatchShow(){    WebKitWebView* webView = getViewFromFrame(m_frame);    webkit_web_view_notify_ready(webView);}void FrameLoaderClient::cancelPolicyCheck(){    //FIXME Add support for more than one policy decision at once    if (m_policyDecision)        webkit_web_policy_decision_cancel(m_policyDecision);}void FrameLoaderClient::dispatchDidLoadMainResource(DocumentLoader*){    notImplemented();}void FrameLoaderClient::revertToProvisionalState(DocumentLoader*){    notImplemented();}void FrameLoaderClient::willChangeTitle(DocumentLoader*){    notImplemented();}void FrameLoaderClient::didChangeTitle(DocumentLoader *l){    setTitle(l->title(), l->url());}bool FrameLoaderClient::canHandleRequest(const ResourceRequest&) const{    notImplemented();    return true;}bool FrameLoaderClient::canShowMIMEType(const String& type) const{    return MIMETypeRegistry::isSupportedImageMIMEType(type) || MIMETypeRegistry::isSupportedNonImageMIMEType(type) ||        PluginDatabase::installedPlugins()->isMIMETypeRegistered(type);}bool FrameLoaderClient::representationExistsForURLScheme(const String&) const{    notImplemented();    return false;}String FrameLoaderClient::generatedMIMETypeForURLScheme(const String&) const{    notImplemented();    return String();}void FrameLoaderClient::finishedLoading(DocumentLoader* documentLoader){    if (!m_pluginView)        committedLoad(documentLoader, 0, 0);    else {        m_pluginView->didFinishLoading();        m_pluginView = 0;        m_hasSentResponseToPlugin = false;    }}void FrameLoaderClient::provisionalLoadStarted(){    notImplemented();}void FrameLoaderClient::didFinishLoad() {    notImplemented();}void FrameLoaderClient::prepareForDataSourceReplacement() { notImplemented(); }void FrameLoaderClient::setTitle(const String& title, const KURL& url){    WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(m_frame);    g_free(frameData->title);    frameData->title = g_strdup(title.utf8().data());}void FrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int lengthReceived){    notImplemented();}void FrameLoaderClient::dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier){    notImplemented();}void FrameLoaderClient::dispatchDidFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError&){    notImplemented();}bool FrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length){    notImplemented();    return false;}void FrameLoaderClient::dispatchDidFailProvisionalLoad(const ResourceError&){    g_signal_emit_by_name(m_frame, "load-done", false);}void FrameLoaderClient::dispatchDidFailLoad(const ResourceError&){    g_signal_emit_by_name(m_frame, "load-done", false);}void FrameLoaderClient::download(ResourceHandle* handle, const ResourceRequest& request, const ResourceRequest&, const ResourceResponse&){    // FIXME: We could reuse the same handle here, but when I tried    // implementing that the main load would fail and stop, so I have    // simplified this case for now.    handle->cancel();    startDownload(request);}ResourceError FrameLoaderClient::cancelledError(const ResourceRequest&){    notImplemented();    ResourceError error("", 0, "", "");    error.setIsCancellation(true);    return error;}ResourceError FrameLoaderClient::blockedError(const ResourceRequest&){    notImplemented();    return ResourceError("", 0, "", "");}ResourceError FrameLoaderClient::cannotShowURLError(const ResourceRequest&){    notImplemented();    return ResourceError("", 0, "", "");}ResourceError FrameLoaderClient::interruptForPolicyChangeError(const ResourceRequest&){    notImplemented();    return ResourceError("", 0, "", "");}ResourceError FrameLoaderClient::cannotShowMIMETypeError(const ResourceResponse&){    notImplemented();    return ResourceError("", 0, "", "");}ResourceError FrameLoaderClient::fileDoesNotExistError(const ResourceResponse&){    notImplemented();    return ResourceError("", 0, "", "");}ResourceError FrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse&){    notImplemented();    return ResourceError("", 0, "", "");}bool FrameLoaderClient::shouldFallBack(const ResourceError&){    notImplemented();    return false;}bool FrameLoaderClient::canCachePage() const{    return true;}Frame* FrameLoaderClient::dispatchCreatePage(){    WebKitWebView* webView = getViewFromFrame(m_frame);    WebKitWebView* newWebView = 0;    g_signal_emit_by_name(webView, "create-web-view", m_frame, &newWebView);    if (!newWebView)        return 0;    WebKitWebViewPrivate* privateData = WEBKIT_WEB_VIEW_GET_PRIVATE(newWebView);    return core(privateData->mainFrame);}void FrameLoaderClient::dispatchUnableToImplementPolicy(const ResourceError&){    notImplemented();}void FrameLoaderClient::setMainDocumentError(DocumentLoader*, const ResourceError& error){    if (m_pluginView) {        m_pluginView->didFail(error);        m_pluginView = 0;        m_hasSentResponseToPlugin = false;    }}void FrameLoaderClient::startDownload(const ResourceRequest& request){    WebKitNetworkRequest* networkRequest = webkit_network_request_new(request.url().string().utf8().data());    WebKitDownload* download = webkit_download_new(networkRequest);    g_object_unref(networkRequest);    WebKitWebView* view = getViewFromFrame(m_frame);    gboolean handled;    g_signal_emit_by_name(view, "download-requested", download, &handled);    if (!handled) {        webkit_download_cancel(download);        g_object_unref(download);        return;    }    webkit_download_start(download);}void FrameLoaderClient::updateGlobalHistory(){    notImplemented();}void FrameLoaderClient::updateGlobalHistoryRedirectLinks(){    notImplemented();}void FrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame*){}void FrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame*){}void FrameLoaderClient::transitionToCommittedForNewPage(){    WebKitWebView* containingWindow = getViewFromFrame(m_frame);    IntSize size = IntSize(GTK_WIDGET(containingWindow)->allocation.width,                           GTK_WIDGET(containingWindow)->allocation.height);    bool transparent = webkit_web_view_get_transparent(containingWindow);    Color backgroundColor = transparent ? WebCore::Color::transparent : WebCore::Color::white;    Frame* frame = core(m_frame);    ASSERT(frame);    frame->createView(size, backgroundColor, transparent, IntSize(), false);    // We need to do further manipulation on the FrameView if it was the mainFrame    if (frame != frame->page()->mainFrame())        return;    WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(containingWindow);    frame->view()->setGtkAdjustments(priv->horizontalAdjustment, priv->verticalAdjustment);}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -