diff options
-rw-r--r-- | WebCore/Android.derived.mk | 2 | ||||
-rw-r--r-- | WebCore/Android.mk | 6 | ||||
-rw-r--r-- | WebCore/config.h | 4 | ||||
-rw-r--r-- | WebKit/android/jni/WebSettings.cpp | 30 |
4 files changed, 36 insertions, 6 deletions
diff --git a/WebCore/Android.derived.mk b/WebCore/Android.derived.mk index 30ca589..6989a95 100644 --- a/WebCore/Android.derived.mk +++ b/WebCore/Android.derived.mk @@ -217,7 +217,7 @@ js_binding_scripts := $(addprefix $(LOCAL_PATH)/,\ bindings/scripts/generate-bindings.pl \ ) -FEATURE_DEFINES := ANDROID_ORIENTATION_SUPPORT ENABLE_TOUCH_EVENTS=1 +FEATURE_DEFINES := ANDROID_ORIENTATION_SUPPORT ENABLE_TOUCH_EVENTS=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 GEN := \ $(intermediates)/css/JSCSSCharsetRule.h \ diff --git a/WebCore/Android.mk b/WebCore/Android.mk index 50b9a91..b5362bc 100644 --- a/WebCore/Android.mk +++ b/WebCore/Android.mk @@ -553,6 +553,12 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ loader/TextDocument.cpp \ loader/TextResourceDecoder.cpp \ loader/ThreadableLoader.cpp \ + loader/appcache/ApplicationCache.cpp \ + loader/appcache/ApplicationCacheGroup.cpp \ + loader/appcache/ApplicationCacheResource.cpp \ + loader/appcache/ApplicationCacheStorage.cpp \ + loader/appcache/DOMApplicationCache.cpp \ + loader/appcache/ManifestParser.cpp \ \ loader/icon/IconDatabase.cpp \ loader/icon/IconFetcher.cpp \ diff --git a/WebCore/config.h b/WebCore/config.h index 4a882bf..66c1d9f 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2004, 2005, 2006 Apple Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either @@ -94,7 +94,7 @@ #define ENABLE_VIDEO 0 #undef ENABLE_ARCHIVE #define ENABLE_ARCHIVE 0 // ANDROID addition: allow web archive to be disabled -#define ENABLE_OFFLINE_WEB_APPLICATIONS 0 +#define ENABLE_OFFLINE_WEB_APPLICATIONS 1 #define ENABLE_TOUCH_EVENTS 1 #endif 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); |