diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-04-20 10:04:32 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-04-20 10:04:32 -0700 |
commit | 38eb0cdb2b416fb660584adf6f277a27ce519568 (patch) | |
tree | bf7ef646b7dbcf1eea1dd2d79dce6e7a85feec2c /WebKit/android/jni/WebSettings.cpp | |
parent | a7281fa549b2afc28ba6e4b5d72d4e04cfe5c53e (diff) | |
parent | 1ebdb525f3be2c4c1c2be57536624d4ae665e40b (diff) | |
download | external_webkit-38eb0cdb2b416fb660584adf6f277a27ce519568.zip external_webkit-38eb0cdb2b416fb660584adf6f277a27ce519568.tar.gz external_webkit-38eb0cdb2b416fb660584adf6f277a27ce519568.tar.bz2 |
Merge change 260
* changes:
Enable Application Caches.
Diffstat (limited to 'WebKit/android/jni/WebSettings.cpp')
-rw-r--r-- | WebKit/android/jni/WebSettings.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp index a3701af..15b1ef1 100644 --- a/WebKit/android/jni/WebSettings.cpp +++ b/WebKit/android/jni/WebSettings.cpp @@ -28,6 +28,9 @@ #include <config.h> #include <wtf/Platform.h> +#if ENABLE(OFFLINE_WEB_APPLICATIONS) +#include "ApplicationCacheStorage.h" +#endif #include "Document.h" #include "Frame.h" #include "FrameLoader.h" @@ -88,6 +91,10 @@ struct FieldIds { #ifdef ANDROID_PLUGINS mPluginsPath = env->GetFieldID(clazz, "mPluginsPath", "Ljava/lang/String;"); #endif +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + mAppCacheEnabled = env->GetFieldID(clazz, "mAppCacheEnabled", "Z"); + mAppCachePath = env->GetFieldID(clazz, "mAppCachePath", "Ljava/lang/String;"); +#endif mJavaScriptCanOpenWindowsAutomatically = env->GetFieldID(clazz, "mJavaScriptCanOpenWindowsAutomatically", "Z"); mUseWideViewport = env->GetFieldID(clazz, "mUseWideViewport", "Z"); @@ -112,12 +119,16 @@ struct FieldIds { LOG_ASSERT(mLoadsImagesAutomatically, "Could not find field mLoadsImagesAutomatically"); #ifdef ANDROID_BLOCK_NETWORK_IMAGE LOG_ASSERT(mBlockNetworkImage, "Could not find field mBlockNetworkImage"); -#endif +#endif LOG_ASSERT(mJavaScriptEnabled, "Could not find field mJavaScriptEnabled"); LOG_ASSERT(mPluginsEnabled, "Could not find field mPluginsEnabled"); #ifdef ANDROID_PLUGINS LOG_ASSERT(mPluginsPath, "Could not find field mPluginsPath"); #endif +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + LOG_ASSERT(mAppCacheEnabled, "Could not find field mAppCacheEnabled"); + LOG_ASSERT(mAppCachePath, "Could not find field mAppCachePath"); +#endif LOG_ASSERT(mJavaScriptCanOpenWindowsAutomatically, "Could not find field mJavaScriptCanOpenWindowsAutomatically"); LOG_ASSERT(mUseWideViewport, "Could not find field mUseWideViewport"); @@ -158,12 +169,15 @@ struct FieldIds { #ifdef ANDROID_PLUGINS jfieldID mPluginsPath; #endif +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + jfieldID mAppCacheEnabled; + jfieldID mAppCachePath; +#endif jfieldID mJavaScriptCanOpenWindowsAutomatically; jfieldID mUseWideViewport; jfieldID mSupportMultipleWindows; jfieldID mShrinksStandaloneImagesToFit; jfieldID mUseDoubleTree; - // Ordinal() method and value field for enums jmethodID mOrdinal; jfieldID mTextSizeValue; @@ -313,7 +327,17 @@ public: } } #endif - +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + flag = env->GetBooleanField(obj, gFieldIds->mAppCacheEnabled); + s->setOfflineWebApplicationCacheEnabled(flag); + str = (jstring)env->GetObjectField(obj, gFieldIds->mAppCachePath); + if (str) { + WebCore::String path = to_string(env, str); + if (path.length()) { + WebCore::cacheStorage().setCacheDirectory(path); + } + } +#endif flag = env->GetBooleanField(obj, gFieldIds->mJavaScriptCanOpenWindowsAutomatically); s->setJavaScriptCanOpenWindowsAutomatically(flag); |