void QWebPreferencesPrivate::setAttribute(QWebPreferencesPrivate::WebAttribute attr, bool enable) { switch (attr) { case AutoLoadImages: WKPreferencesSetLoadsImagesAutomatically(preferencesRef(), enable); break; #if ENABLE(FULLSCREEN_API) case FullScreenEnabled: WKPreferencesSetFullScreenEnabled(preferencesRef(), enable); break; #endif case JavascriptEnabled: WKPreferencesSetJavaScriptEnabled(preferencesRef(), enable); break; case PluginsEnabled: WKPreferencesSetPluginsEnabled(preferencesRef(), enable); break; case OfflineWebApplicationCacheEnabled: WKPreferencesSetOfflineWebApplicationCacheEnabled(preferencesRef(), enable); break; case LocalStorageEnabled: WKPreferencesSetLocalStorageEnabled(preferencesRef(), enable); break; case XSSAuditingEnabled: WKPreferencesSetXSSAuditorEnabled(preferencesRef(), enable); break; case PrivateBrowsingEnabled: WKPreferencesSetPrivateBrowsingEnabled(preferencesRef(), enable); break; case DnsPrefetchEnabled: WKPreferencesSetDNSPrefetchingEnabled(preferencesRef(), enable); break; case FrameFlatteningEnabled: WKPreferencesSetFrameFlatteningEnabled(preferencesRef(), enable); case DeveloperExtrasEnabled: WKPreferencesSetDeveloperExtrasEnabled(preferencesRef(), enable); break; #if ENABLE(WEBGL) case WebGLEnabled: WKPreferencesSetWebGLEnabled(preferencesRef(), enable); break; #endif default: ASSERT_NOT_REACHED(); } }
void QWebPreferencesPrivate::setAttribute(QWebPreferencesPrivate::WebAttribute attr, bool enable) { WKPreferencesRef preferencesRef = WKPageGroupGetPreferences(webViewPrivate->pageGroup.get()); switch (attr) { case AutoLoadImages: WKPreferencesSetLoadsImagesAutomatically(preferencesRef, enable); break; #if ENABLE(FULLSCREEN_API) case FullScreenEnabled: WKPreferencesSetFullScreenEnabled(preferencesRef, enable); break; #endif case JavascriptEnabled: WKPreferencesSetJavaScriptEnabled(preferencesRef, enable); break; case PluginsEnabled: WKPreferencesSetPluginsEnabled(preferencesRef, enable); break; case OfflineWebApplicationCacheEnabled: WKPreferencesSetOfflineWebApplicationCacheEnabled(preferencesRef, enable); break; case LocalStorageEnabled: WKPreferencesSetLocalStorageEnabled(preferencesRef, enable); break; case XSSAuditingEnabled: WKPreferencesSetXSSAuditorEnabled(preferencesRef, enable); break; case PrivateBrowsingEnabled: WKPreferencesSetPrivateBrowsingEnabled(preferencesRef, enable); break; case DnsPrefetchEnabled: WKPreferencesSetDNSPrefetchingEnabled(preferencesRef, enable); break; case FrameFlatteningEnabled: WKPreferencesSetFrameFlatteningEnabled(preferencesRef, enable); case DeveloperExtrasEnabled: WKPreferencesSetDeveloperExtrasEnabled(preferencesRef, enable); break; #if ENABLE(WEBGL) case WebGLEnabled: WKPreferencesSetWebGLEnabled(preferencesRef, enable); break; #if ENABLE(CSS_SHADERS) case CSSCustomFilterEnabled: WKPreferencesSetCSSCustomFilterEnabled(preferencesRef, enable); break; #endif #endif #if ENABLE(WEB_AUDIO) case WebAudioEnabled: WKPreferencesSetWebAudioEnabled(preferencesRef, enable); break; #endif case CaretBrowsingEnabled: // FIXME: Caret browsing doesn't make much sense in touch mode. WKPreferencesSetCaretBrowsingEnabled(preferencesRef, enable); break; case NotificationsEnabled: WKPreferencesSetNotificationsEnabled(preferencesRef, enable); break; case UniversalAccessFromFileURLsAllowed: WKPreferencesSetUniversalAccessFromFileURLsAllowed(preferencesRef, enable); break; case FileAccessFromFileURLsAllowed: WKPreferencesSetFileAccessFromFileURLsAllowed(preferencesRef, enable); break; default: ASSERT_NOT_REACHED(); } }