From 231d4e3152a9c27a73b6ac7badbe6be673aa3ddf Mon Sep 17 00:00:00 2001 From: Steve Block Date: Thu, 8 Oct 2009 17:19:54 +0100 Subject: Merge webkit.org at R49305 : Automatic merge by git. Change-Id: I8968561bc1bfd72b8923b7118d3728579c6dbcc7 --- WebKit/win/WebPreferences.cpp | 85 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) (limited to 'WebKit/win/WebPreferences.cpp') diff --git a/WebKit/win/WebPreferences.cpp b/WebKit/win/WebPreferences.cpp index 8ea0319..e37177e 100644 --- a/WebKit/win/WebPreferences.cpp +++ b/WebKit/win/WebPreferences.cpp @@ -42,6 +42,7 @@ #pragma warning( pop ) #include +#include #include #include #include @@ -54,6 +55,7 @@ #endif using namespace WebCore; +using std::numeric_limits; static const String& oldPreferencesPath() { @@ -204,12 +206,14 @@ void WebPreferences::initializeDefaultSettings() CFDictionaryAddValue(defaults, CFSTR(WebKitJavaEnabledPreferenceKey), kCFBooleanTrue); CFDictionaryAddValue(defaults, CFSTR(WebKitJavaScriptEnabledPreferenceKey), kCFBooleanTrue); CFDictionaryAddValue(defaults, CFSTR(WebKitWebSecurityEnabledPreferenceKey), kCFBooleanTrue); - CFDictionaryAddValue(defaults, CFSTR(WebKitAllowUniversalAccessFromFileURLsPreferenceKey), kCFBooleanTrue); + CFDictionaryAddValue(defaults, CFSTR(WebKitAllowUniversalAccessFromFileURLsPreferenceKey), kCFBooleanFalse); CFDictionaryAddValue(defaults, CFSTR(WebKitXSSAuditorEnabledPreferenceKey), kCFBooleanTrue); CFDictionaryAddValue(defaults, CFSTR(WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey), kCFBooleanTrue); CFDictionaryAddValue(defaults, CFSTR(WebKitPluginsEnabledPreferenceKey), kCFBooleanTrue); CFDictionaryAddValue(defaults, CFSTR(WebKitDatabasesEnabledPreferenceKey), kCFBooleanTrue); CFDictionaryAddValue(defaults, CFSTR(WebKitLocalStorageEnabledPreferenceKey), kCFBooleanTrue); + CFDictionaryAddValue(defaults, CFSTR(WebKitExperimentalNotificationsEnabledPreferenceKey), kCFBooleanFalse); + CFDictionaryAddValue(defaults, CFSTR(WebKitExperimentalWebSocketsEnabledPreferenceKey), kCFBooleanFalse); CFDictionaryAddValue(defaults, CFSTR(WebKitAllowAnimatedImagesPreferenceKey), kCFBooleanTrue); CFDictionaryAddValue(defaults, CFSTR(WebKitAllowAnimatedImageLoopingPreferenceKey), kCFBooleanTrue); CFDictionaryAddValue(defaults, CFSTR(WebKitDisplayImagesKey), kCFBooleanTrue); @@ -247,6 +251,13 @@ void WebPreferences::initializeDefaultSettings() CFDictionaryAddValue(defaults, CFSTR(WebKitPaintNativeControlsPreferenceKey), kCFBooleanTrue); + CFDictionaryAddValue(defaults, CFSTR(WebKitUseHighResolutionTimersPreferenceKey), kCFBooleanTrue); + + CFDictionaryAddValue(defaults, CFSTR(WebKitPluginHalterEnabledPreferenceKey), kCFBooleanFalse); + + RetainPtr pluginAllowedRunTime(AdoptCF, CFStringCreateWithFormat(0, 0, CFSTR("%u"), numeric_limits::max())); + CFDictionaryAddValue(defaults, CFSTR(WebKitPluginAllowedRunTimePreferenceKey), pluginAllowedRunTime.get()); + defaultSettings = defaults; } @@ -1289,6 +1300,30 @@ HRESULT STDMETHODCALLTYPE WebPreferences::setLocalStorageDatabasePath(BSTR locat return S_OK; } +HRESULT STDMETHODCALLTYPE WebPreferences::setExperimentalNotificationsEnabled(BOOL enabled) +{ + setBoolValue(CFSTR(WebKitExperimentalNotificationsEnabledPreferenceKey), enabled); + return S_OK; +} + +HRESULT STDMETHODCALLTYPE WebPreferences::experimentalNotificationsEnabled(BOOL* enabled) +{ + *enabled = boolValueForKey(CFSTR(WebKitExperimentalNotificationsEnabledPreferenceKey)); + return S_OK; +} + +HRESULT STDMETHODCALLTYPE WebPreferences::setExperimentalWebSocketsEnabled(BOOL enabled) +{ + setBoolValue(CFSTR(WebKitExperimentalWebSocketsEnabledPreferenceKey), enabled); + return S_OK; +} + +HRESULT STDMETHODCALLTYPE WebPreferences::experimentalWebSocketsEnabled(BOOL* enabled) +{ + *enabled = boolValueForKey(CFSTR(WebKitExperimentalWebSocketsEnabledPreferenceKey)); + return S_OK; +} + HRESULT WebPreferences::setZoomsTextOnly(BOOL zoomsTextOnly) { setBoolValue(CFSTR(WebKitZoomsTextOnlyPreferenceKey), zoomsTextOnly); @@ -1301,6 +1336,54 @@ HRESULT WebPreferences::zoomsTextOnly(BOOL* zoomsTextOnly) return S_OK; } +HRESULT STDMETHODCALLTYPE WebPreferences::setShouldUseHighResolutionTimers(BOOL useHighResolutionTimers) +{ + setBoolValue(CFSTR(WebKitUseHighResolutionTimersPreferenceKey), useHighResolutionTimers); + return S_OK; +} + +HRESULT STDMETHODCALLTYPE WebPreferences::shouldUseHighResolutionTimers(BOOL* useHighResolutionTimers) +{ + *useHighResolutionTimers = boolValueForKey(CFSTR(WebKitUseHighResolutionTimersPreferenceKey)); + return S_OK; +} + + +HRESULT STDMETHODCALLTYPE WebPreferences::setPluginHalterEnabled(BOOL enabled) +{ + setBoolValue(CFSTR(WebKitPluginHalterEnabledPreferenceKey), enabled); + return S_OK; +} + +HRESULT STDMETHODCALLTYPE WebPreferences::pluginHalterEnabled(BOOL* enabled) +{ + *enabled = boolValueForKey(CFSTR(WebKitPluginHalterEnabledPreferenceKey)); + return S_OK; +} + +HRESULT WebPreferences::setPluginAllowedRunTime(UINT allowedRunTime) +{ + setIntegerValue(CFSTR(WebKitPluginAllowedRunTimePreferenceKey), allowedRunTime); + return S_OK; +} + +HRESULT WebPreferences::pluginAllowedRunTime(UINT* allowedRunTime) +{ + *allowedRunTime = integerValueForKey(CFSTR(WebKitPluginAllowedRunTimePreferenceKey)); + return S_OK; +} + +HRESULT WebPreferences::setPreferenceForTest(BSTR key, BSTR value) +{ + if (!SysStringLen(key) || !SysStringLen(value)) + return E_FAIL; + RetainPtr keyString(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast(key), SysStringLen(key))); + RetainPtr valueString(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast(value), SysStringLen(value))); + setValueForKey(keyString.get(), valueString.get()); + postPreferencesChangesNotification(); + return S_OK; +} + void WebPreferences::willAddToWebView() { ++m_numWebViews; -- cgit v1.1