summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/Android.mk4
-rw-r--r--WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp4
-rw-r--r--WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h1
-rw-r--r--WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp7
-rw-r--r--WebKit/android/jni/CookieManager.cpp13
-rw-r--r--WebKit/android/jni/WebViewCore.cpp16
-rw-r--r--WebKit/android/jni/WebViewCore.h2
7 files changed, 30 insertions, 17 deletions
diff --git a/WebKit/Android.mk b/WebKit/Android.mk
index e640e02..7906da3 100644
--- a/WebKit/Android.mk
+++ b/WebKit/Android.mk
@@ -38,8 +38,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
android/WebCoreSupport/WebRequest.cpp \
android/WebCoreSupport/WebRequestContext.cpp \
android/WebCoreSupport/WebResourceRequest.cpp \
- android/WebCoreSupport/WebResponse.cpp \
- android/jni/CookieManager.cpp
+ android/WebCoreSupport/WebResponse.cpp
else
LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
android/WebCoreSupport/ResourceLoaderAndroid.cpp
@@ -58,6 +57,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
\
android/icu/unicode/ucnv.cpp \
\
+ android/jni/CookieManager.cpp \
android/jni/DeviceMotionAndOrientationManager.cpp \
android/jni/DeviceMotionClientImpl.cpp \
android/jni/DeviceOrientationClientImpl.cpp \
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
index 3268677..a796084 100644
--- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
@@ -201,10 +201,6 @@ bool FrameLoaderClientAndroid::dispatchDidLoadResourceFromMemoryCache(DocumentLo
return false;
}
-void FrameLoaderClientAndroid::dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const ScriptString&) {
- return;
-}
-
void FrameLoaderClientAndroid::dispatchDidHandleOnloadEvents() {
}
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
index eb0c26e..b40f645 100644
--- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
+++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
@@ -76,7 +76,6 @@ namespace android {
virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier);
virtual void dispatchDidFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError&);
virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length);
- virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const ScriptString&);
virtual void dispatchDidHandleOnloadEvents();
virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
diff --git a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
index 96ee9f6..26c377e 100644
--- a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
+++ b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
@@ -49,13 +49,18 @@
namespace android
{
+static URLRequestContext* WebAutoFillContextGetter()
+{
+ return WebRequestContext::GetContext(false /* isPrivateBrowsing */);
+}
+
WebAutoFill::WebAutoFill()
: mWebViewCore(0)
{
mFormManager = new FormManager();
mQueryId = 1;
- AndroidURLRequestContextGetter::Get()->SetURLRequestContextGetterFunction(&WebRequestContext::GetContext);
+ AndroidURLRequestContextGetter::Get()->SetURLRequestContextGetterFunction(&WebAutoFillContextGetter);
AndroidURLRequestContextGetter::Get()->SetIOThread(WebUrlLoaderClient::ioThread());
mTabContents = new TabContents();
mAutoFillManager = new AutoFillManager(mTabContents.get());
diff --git a/WebKit/android/jni/CookieManager.cpp b/WebKit/android/jni/CookieManager.cpp
index 9672160..89f9a4f 100644
--- a/WebKit/android/jni/CookieManager.cpp
+++ b/WebKit/android/jni/CookieManager.cpp
@@ -36,7 +36,16 @@ namespace android {
// JNI for android.webkit.CookieManager
static const char* javaCookieManagerClass = "android/webkit/CookieManager";
-static void removeAllCookie(JNIEnv* env, jobject) {
+static bool useChromiumHttpStack(JNIEnv*, jobject) {
+#if USE(CHROME_NETWORK_STACK)
+ return true;
+#else
+ return false;
+#endif
+}
+
+static void removeAllCookie(JNIEnv*, jobject) {
+#if USE(CHROME_NETWORK_STACK)
WebRequestContext::GetContext(false)->cookie_store()->GetCookieMonster()->DeleteAllCreatedAfter(Time(), true);
// This will lazily create a new private browsing context. However, if the
// context doesn't already exist, there's no need to create it, as cookies
@@ -44,9 +53,11 @@ static void removeAllCookie(JNIEnv* env, jobject) {
// TODO: Consider adding an optimisation to not create the context if it
// doesn't already exist.
WebRequestContext::GetContext(true)->cookie_store()->GetCookieMonster()->DeleteAllCreatedAfter(Time(), true);
+#endif
}
static JNINativeMethod gCookieManagerMethods[] = {
+ { "nativeUseChromiumHttpStack", "()Z", (void*) useChromiumHttpStack },
{ "nativeRemoveAllCookie", "()V", (void*) removeAllCookie },
};
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index fe0563a..f56b916 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1094,10 +1094,10 @@ void WebViewCore::doMaxScroll(CacheBuilder::Direction dir)
this->scrollBy(dx, dy, true);
}
-void WebViewCore::setScrollOffset(int moveGeneration, int dx, int dy)
+void WebViewCore::setScrollOffset(int moveGeneration, int userScrolled, int dx, int dy)
{
- DBG_NAV_LOGD("{%d,%d} m_scrollOffset=(%d,%d)", dx, dy,
- m_scrollOffsetX, m_scrollOffsetY);
+ DBG_NAV_LOGD("{%d,%d} m_scrollOffset=(%d,%d), userScrolled=%d", dx, dy,
+ m_scrollOffsetX, m_scrollOffsetY, userScrolled);
if (m_scrollOffsetX != dx || m_scrollOffsetY != dy) {
m_scrollOffsetX = dx;
m_scrollOffsetY = dy;
@@ -1106,7 +1106,9 @@ void WebViewCore::setScrollOffset(int moveGeneration, int dx, int dy)
// testing work correctly.
m_mainFrame->view()->platformWidget()->setLocation(m_scrollOffsetX,
m_scrollOffsetY);
- m_mainFrame->eventHandler()->sendScrollEvent();
+ if (userScrolled) {
+ m_mainFrame->eventHandler()->sendScrollEvent();
+ }
// update the currently visible screen
sendPluginVisibleScreen();
@@ -3338,7 +3340,7 @@ static void SetSize(JNIEnv *env, jobject obj, jint width, jint height,
screenWidth, screenHeight, anchorX, anchorY, ignoreHeight);
}
-static void SetScrollOffset(JNIEnv *env, jobject obj, jint gen, jint x, jint y)
+static void SetScrollOffset(JNIEnv *env, jobject obj, jint gen, jint userScrolled, jint x, jint y)
{
#ifdef ANDROID_INSTRUMENT
TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
@@ -3346,7 +3348,7 @@ static void SetScrollOffset(JNIEnv *env, jobject obj, jint gen, jint x, jint y)
WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
LOG_ASSERT(viewImpl, "need viewImpl");
- viewImpl->setScrollOffset(gen, x, y);
+ viewImpl->setScrollOffset(gen, userScrolled, x, y);
}
static void SetGlobalBounds(JNIEnv *env, jobject obj, jint x, jint y, jint h,
@@ -3977,7 +3979,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = {
(void*) SendListBoxChoice },
{ "nativeSetSize", "(IIIFIIIIZ)V",
(void*) SetSize },
- { "nativeSetScrollOffset", "(III)V",
+ { "nativeSetScrollOffset", "(IIII)V",
(void*) SetScrollOffset },
{ "nativeSetGlobalBounds", "(IIII)V",
(void*) SetGlobalBounds },
diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h
index 2ff517f..eac7e6e 100644
--- a/WebKit/android/jni/WebViewCore.h
+++ b/WebKit/android/jni/WebViewCore.h
@@ -300,7 +300,7 @@ namespace android {
WebCore::Frame* frame, int x, int y);
// set the scroll amount that webview.java is currently showing
- void setScrollOffset(int moveGeneration, int dx, int dy);
+ void setScrollOffset(int moveGeneration, int userScrolled, int dx, int dy);
void setGlobalBounds(int x, int y, int h, int v);