当前位置: 首页>>代码示例>>C++>>正文


C++ Settings::setHyperlinkAuditingEnabled方法代码示例

本文整理汇总了C++中webcore::Settings::setHyperlinkAuditingEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ Settings::setHyperlinkAuditingEnabled方法的具体用法?C++ Settings::setHyperlinkAuditingEnabled怎么用?C++ Settings::setHyperlinkAuditingEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在webcore::Settings的用法示例。


在下文中一共展示了Settings::setHyperlinkAuditingEnabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: apply

void QWebSettingsPrivate::apply()
{
    if (settings) {
        settings->setTextAreasAreResizable(true);

        QWebSettingsPrivate* global = QWebSettings::globalSettings()->d;

        QString family = fontFamilies.value(QWebSettings::StandardFont,
                                            global->fontFamilies.value(QWebSettings::StandardFont));
        settings->setStandardFontFamily(family);

        family = fontFamilies.value(QWebSettings::FixedFont,
                                    global->fontFamilies.value(QWebSettings::FixedFont));
        settings->setFixedFontFamily(family);

        family = fontFamilies.value(QWebSettings::SerifFont,
                                    global->fontFamilies.value(QWebSettings::SerifFont));
        settings->setSerifFontFamily(family);

        family = fontFamilies.value(QWebSettings::SansSerifFont,
                                    global->fontFamilies.value(QWebSettings::SansSerifFont));
        settings->setSansSerifFontFamily(family);

        family = fontFamilies.value(QWebSettings::CursiveFont,
                                    global->fontFamilies.value(QWebSettings::CursiveFont));
        settings->setCursiveFontFamily(family);

        family = fontFamilies.value(QWebSettings::FantasyFont,
                                    global->fontFamilies.value(QWebSettings::FantasyFont));
        settings->setFantasyFontFamily(family);

        int size = fontSizes.value(QWebSettings::MinimumFontSize,
                                   global->fontSizes.value(QWebSettings::MinimumFontSize));
        settings->setMinimumFontSize(size);

        size = fontSizes.value(QWebSettings::MinimumLogicalFontSize,
                                   global->fontSizes.value(QWebSettings::MinimumLogicalFontSize));
        settings->setMinimumLogicalFontSize(size);

        size = fontSizes.value(QWebSettings::DefaultFontSize,
                                   global->fontSizes.value(QWebSettings::DefaultFontSize));
        settings->setDefaultFontSize(size);

        size = fontSizes.value(QWebSettings::DefaultFixedFontSize,
                                   global->fontSizes.value(QWebSettings::DefaultFixedFontSize));
        settings->setDefaultFixedFontSize(size);

        bool value = attributes.value(QWebSettings::AutoLoadImages,
                                      global->attributes.value(QWebSettings::AutoLoadImages));
        settings->setLoadsImagesAutomatically(value);

        value = attributes.value(QWebSettings::DnsPrefetchEnabled,
                                 global->attributes.value(QWebSettings::DnsPrefetchEnabled));
        settings->setDNSPrefetchingEnabled(value);

        value = attributes.value(QWebSettings::JavascriptEnabled,
                                      global->attributes.value(QWebSettings::JavascriptEnabled));
        settings->setScriptEnabled(value);
#if USE(ACCELERATED_COMPOSITING)
        value = attributes.value(QWebSettings::AcceleratedCompositingEnabled,
                                      global->attributes.value(QWebSettings::AcceleratedCompositingEnabled));

        settings->setAcceleratedCompositingEnabled(value);
        settings->setAcceleratedCompositingFor3DTransformsEnabled(value);
        settings->setAcceleratedCompositingForAnimationEnabled(value);
#if USE(TEXTURE_MAPPER)
        settings->setAcceleratedCompositingForVideoEnabled(false);
        settings->setAcceleratedCompositingForPluginsEnabled(false);
#endif
#endif
#if ENABLE(WEBGL)
        value = attributes.value(QWebSettings::WebGLEnabled,
                                 global->attributes.value(QWebSettings::WebGLEnabled));

        settings->setWebGLEnabled(value);
#if USE(ACCELERATED_COMPOSITING)
        settings->setAcceleratedCompositingForCanvasEnabled(value);
#endif
#endif

        value = attributes.value(QWebSettings::HyperlinkAuditingEnabled,
                                 global->attributes.value(QWebSettings::HyperlinkAuditingEnabled));

        settings->setHyperlinkAuditingEnabled(value);
 
        value = attributes.value(QWebSettings::JavascriptCanOpenWindows,
                                      global->attributes.value(QWebSettings::JavascriptCanOpenWindows));
        settings->setJavaScriptCanOpenWindowsAutomatically(value);

        value = attributes.value(QWebSettings::JavascriptCanCloseWindows,
                                      global->attributes.value(QWebSettings::JavascriptCanCloseWindows));
        settings->setAllowScriptsToCloseWindows(value);

        value = attributes.value(QWebSettings::JavaEnabled,
                                      global->attributes.value(QWebSettings::JavaEnabled));
        settings->setJavaEnabled(value);

        value = attributes.value(QWebSettings::PluginsEnabled,
                                      global->attributes.value(QWebSettings::PluginsEnabled));
        settings->setPluginsEnabled(value);
//.........这里部分代码省略.........
开发者ID:ruizhang331,项目名称:WebKit,代码行数:101,代码来源:qwebsettings.cpp

示例2: Sync


//.........这里部分代码省略.........
        size = env->GetIntField(obj, gFieldIds->mDefaultFixedFontSize);
        s->setDefaultFixedFontSize(size);

        jboolean flag = env->GetBooleanField(obj, gFieldIds->mLoadsImagesAutomatically);
        s->setLoadsImagesAutomatically(flag);
        if (flag)
            cachedResourceLoader->setAutoLoadImages(true);

        flag = env->GetBooleanField(obj, gFieldIds->mMediaPreloadEnabled);
        s->setMediaPreloadEnabled(flag);

#ifdef ANDROID_BLOCK_NETWORK_IMAGE
        flag = env->GetBooleanField(obj, gFieldIds->mBlockNetworkImage);
        s->setBlockNetworkImage(flag);
        if(!flag)
            cachedResourceLoader->setBlockNetworkImage(false);
#endif
        flag = env->GetBooleanField(obj, gFieldIds->mBlockNetworkLoads);
        WebFrame* webFrame = WebFrame::getWebFrame(pFrame);
        webFrame->setBlockNetworkLoads(flag);

        flag = env->GetBooleanField(obj, gFieldIds->mJavaScriptEnabled);
        s->setJavaScriptEnabled(flag);

        flag = env->GetBooleanField(obj, gFieldIds->mAllowUniversalAccessFromFileURLs);
        s->setAllowUniversalAccessFromFileURLs(flag);

        flag = env->GetBooleanField(obj, gFieldIds->mAllowFileAccessFromFileURLs);
        s->setAllowFileAccessFromFileURLs(flag);

        // Hyperlink auditing (the ping attribute) has similar privacy
        // considerations as does the running of JavaScript, so to keep the UI
        // simpler, we leverage the same setting.
        s->setHyperlinkAuditingEnabled(flag);

        // ON = 0
        // ON_DEMAND = 1
        // OFF = 2
        jobject pluginState = env->GetObjectField(obj, gFieldIds->mPluginState);
        int state = env->CallIntMethod(pluginState, gFieldIds->mOrdinal);
        s->setPluginsEnabled(state < 2);
#ifdef ANDROID_PLUGINS
        s->setPluginsOnDemand(state == 1);
#endif

#if ENABLE(OFFLINE_WEB_APPLICATIONS)
        // We only enable AppCache if it's been enabled with a call to
        // setAppCacheEnabled() and if a valid path has been supplied to
        // setAppCachePath(). Note that the path is applied to all WebViews
        // whereas enabling is applied per WebView.

        // WebCore asserts that the path is only set once. Since the path is
        // shared between WebViews, we can't do the required checks to guard
        // against this in the Java WebSettings.
        bool isPathValid = false;
        if (cacheStorage().cacheDirectory().isNull()) {
            str = static_cast<jstring>(env->GetObjectField(obj, gFieldIds->mAppCachePath));
            // Check for non-null string as an optimization, as this is the common case.
            if (str) {
                String path = jstringToWtfString(env, str);
                ALOG_ASSERT(!path.empty(), "Java side should never send empty string for AppCache path");
                // This database is created on the first load. If the file
                // doesn't exist, we create it and set its permissions. The
                // filename must match that in ApplicationCacheStorage.cpp.
                String filename = pathByAppendingComponent(path, "ApplicationCache.db");
                int fd = open(filename.utf8().data(), O_CREAT, permissionFlags660);
开发者ID:,项目名称:,代码行数:67,代码来源:

示例3: apply


//.........这里部分代码省略.........
        settings->setShowRepaintCounter(showDebugVisuals);
#endif
#if ENABLE(WEBGL)
        value = attributes.value(QWebSettings::WebGLEnabled,
                                 global->attributes.value(QWebSettings::WebGLEnabled));

        settings->setWebGLEnabled(value);
#if ENABLE(CSS_SHADERS)
        // For now, enable CSS shaders when WebGL is enabled.
        settings->setCSSCustomFilterEnabled(value);
#endif
#if USE(ACCELERATED_COMPOSITING)
        settings->setAcceleratedCompositingForCanvasEnabled(value);
#endif
#endif
#if ENABLE(WEB_AUDIO)
        value = attributes.value(QWebSettings::WebAudioEnabled, global->attributes.value(QWebSettings::WebAudioEnabled));
        WebCore::RuntimeEnabledFeatures::setWebAudioEnabled(value);
#endif

        value = attributes.value(QWebSettings::CSSRegionsEnabled,
                                 global->attributes.value(QWebSettings::CSSRegionsEnabled));
        WebCore::RuntimeEnabledFeatures::setCSSRegionsEnabled(value);
        value = attributes.value(QWebSettings::CSSCompositingEnabled,
                                 global->attributes.value(QWebSettings::CSSCompositingEnabled));
        WebCore::RuntimeEnabledFeatures::setCSSCompositingEnabled(value);
        value = attributes.value(QWebSettings::CSSGridLayoutEnabled,
                                 global->attributes.value(QWebSettings::CSSGridLayoutEnabled));
        settings->setCSSGridLayoutEnabled(value);

        value = attributes.value(QWebSettings::HyperlinkAuditingEnabled,
                                 global->attributes.value(QWebSettings::HyperlinkAuditingEnabled));

        settings->setHyperlinkAuditingEnabled(value);
 
        value = attributes.value(QWebSettings::JavascriptCanOpenWindows,
                                      global->attributes.value(QWebSettings::JavascriptCanOpenWindows));
        settings->setJavaScriptCanOpenWindowsAutomatically(value);

        value = attributes.value(QWebSettings::JavascriptCanCloseWindows,
                                      global->attributes.value(QWebSettings::JavascriptCanCloseWindows));
        settings->setAllowScriptsToCloseWindows(value);

        value = attributes.value(QWebSettings::JavaEnabled,
                                      global->attributes.value(QWebSettings::JavaEnabled));
        settings->setJavaEnabled(value);

        value = attributes.value(QWebSettings::PluginsEnabled,
                                      global->attributes.value(QWebSettings::PluginsEnabled));
        settings->setPluginsEnabled(value);

        value = attributes.value(QWebSettings::PrivateBrowsingEnabled,
                                      global->attributes.value(QWebSettings::PrivateBrowsingEnabled));
        settings->setPrivateBrowsingEnabled(value);

        value = attributes.value(QWebSettings::SpatialNavigationEnabled,
                                      global->attributes.value(QWebSettings::SpatialNavigationEnabled));
        settings->setSpatialNavigationEnabled(value);

        value = attributes.value(QWebSettings::JavascriptCanAccessClipboard,
                                      global->attributes.value(QWebSettings::JavascriptCanAccessClipboard));
        settings->setDOMPasteAllowed(value);
        settings->setJavaScriptCanAccessClipboard(value);

        value = attributes.value(QWebSettings::DeveloperExtrasEnabled,
                                      global->attributes.value(QWebSettings::DeveloperExtrasEnabled));
开发者ID:massa84,项目名称:phantomjs-webkit,代码行数:67,代码来源:qwebsettings.cpp

示例4: Sync


//.........这里部分代码省略.........
        s->setLoadsImagesAutomatically(flag);
        if (flag)
            cachedResourceLoader->setAutoLoadImages(true);

#ifdef ANDROID_BLOCK_NETWORK_IMAGE
        flag = env->GetBooleanField(obj, gFieldIds->mBlockNetworkImage);
        s->setBlockNetworkImage(flag);
        if(!flag)
            cachedResourceLoader->setBlockNetworkImage(false);
#endif
        flag = env->GetBooleanField(obj, gFieldIds->mBlockNetworkLoads);
        WebFrame* webFrame = WebFrame::getWebFrame(pFrame);
        webFrame->setBlockNetworkLoads(flag);

        flag = env->GetBooleanField(obj, gFieldIds->mJavaScriptEnabled);
        s->setJavaScriptEnabled(flag);

// SERI - WebGL >>
#if ENABLE(WEBGL)
        flag = env->GetBooleanField(obj, gFieldIds->mWebGLEnabled);
        s->setWebGLEnabled(flag);
#endif
// SERI - WebGL <<

        flag = env->GetBooleanField(obj, gFieldIds->mAllowUniversalAccessFromFileURLs);
        s->setAllowUniversalAccessFromFileURLs(flag);

        flag = env->GetBooleanField(obj, gFieldIds->mAllowFileAccessFromFileURLs);
        s->setAllowFileAccessFromFileURLs(flag);

        // Hyperlink auditing (the ping attribute) has similar privacy
        // considerations as does the running of JavaScript, so to keep the UI
        // simpler, we leverage the same setting.
        s->setHyperlinkAuditingEnabled(flag);

        // ON = 0
        // ON_DEMAND = 1
        // OFF = 2
        jobject pluginState = env->GetObjectField(obj, gFieldIds->mPluginState);
        int state = env->CallIntMethod(pluginState, gFieldIds->mOrdinal);
        s->setPluginsEnabled(state < 2);
#ifdef ANDROID_PLUGINS
        s->setPluginsOnDemand(state == 1);
#endif

#if ENABLE(OFFLINE_WEB_APPLICATIONS)
        // We only enable AppCache if it's been enabled with a call to
        // setAppCacheEnabled() and if a valid path has been supplied to
        // setAppCachePath(). Note that the path is applied to all WebViews
        // whereas enabling is applied per WebView.

        // WebCore asserts that the path is only set once. Since the path is
        // shared between WebViews, we can't do the required checks to guard
        // against this in the Java WebSettings.
        bool isPathValid = false;
        if (cacheStorage().cacheDirectory().isNull()) {
            str = static_cast<jstring>(env->GetObjectField(obj, gFieldIds->mAppCachePath));
            // Check for non-null string as an optimization, as this is the common case.
            if (str) {
                String path = jstringToWtfString(env, str);
                ALOG_ASSERT(!path.empty(), "Java side should never send empty string for AppCache path");
                // This database is created on the first load. If the file
                // doesn't exist, we create it and set its permissions. The
                // filename must match that in ApplicationCacheStorage.cpp.
                String filename = pathByAppendingComponent(path, "ApplicationCache.db");
                int fd = open(filename.utf8().data(), O_CREAT, permissionFlags660);
开发者ID:a33g-dev,项目名称:platform_samsung,代码行数:67,代码来源:WebSettings.cpp


注:本文中的webcore::Settings::setHyperlinkAuditingEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。