diff options
-rw-r--r-- | WebCore/WebCorePrefixAndroid.h | 6 | ||||
-rw-r--r-- | WebCore/loader/FrameLoader.cpp | 46 | ||||
-rw-r--r-- | WebCore/loader/FrameLoader.h | 7 | ||||
-rw-r--r-- | WebCore/page/FrameLoadRequest.h | 17 | ||||
-rw-r--r-- | WebCore/platform/network/android/ResourceRequest.h | 19 | ||||
-rw-r--r-- | WebKit/android/jni/WebCoreFrameBridge.cpp | 8 |
6 files changed, 1 insertions, 102 deletions
diff --git a/WebCore/WebCorePrefixAndroid.h b/WebCore/WebCorePrefixAndroid.h index a024ccd..acb0967 100644 --- a/WebCore/WebCorePrefixAndroid.h +++ b/WebCore/WebCorePrefixAndroid.h @@ -114,12 +114,6 @@ typedef unsigned char flex_uint8_t; // PLUGIN_SCHEDULE_TIMER) #define ANDROID_PLUGINS -// This should possibly be patched back to WebKit since they seem to lose the -// user gesture hint. If we do decide to patch this back, the user gesture flag -// should probably be passed in the NavigationAction rather than the -// ResourceRequest. -#define ANDROID_USER_GESTURE - // Add support for the orientation window property #define ANDROID_ORIENTATION_SUPPORT diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp index 88beb24..af0fdad 100644 --- a/WebCore/loader/FrameLoader.cpp +++ b/WebCore/loader/FrameLoader.cpp @@ -425,9 +425,6 @@ void FrameLoader::changeLocation(const KURL& url, const String& referrer, bool l RefPtr<Frame> protect(m_frame); ResourceRequest request(url, referrer, refresh ? ReloadIgnoringCacheData : UseProtocolCachePolicy); -#ifdef ANDROID_USER_GESTURE - request.setUserGesture(userGesture); -#endif if (executeIfJavaScriptURL(request.url(), userGesture)) return; @@ -445,9 +442,6 @@ void FrameLoader::urlSelected(const ResourceRequest& request, const String& pass target = m_frame->document()->baseTarget(); FrameLoadRequest frameRequest(request, target); -#ifdef ANDROID_USER_GESTURE - frameRequest.setWasUserGesture(userGesture); -#endif if (frameRequest.resourceRequest().httpReferrer().isEmpty()) frameRequest.resourceRequest().setHTTPReferrer(m_outgoingReferrer); @@ -585,10 +579,6 @@ void FrameLoader::submitForm(const char* action, const String& url, PassRefPtr<F formData->generateFiles(m_frame->page()->chrome()->client()); -#ifdef ANDROID_USER_GESTURE - frameRequest.setWasUserGesture(userGestureHint()); -#endif - if (!m_outgoingReferrer.isEmpty()) frameRequest.resourceRequest().setHTTPReferrer(m_outgoingReferrer); @@ -1385,17 +1375,7 @@ void FrameLoader::scheduleHTTPRedirection(double delay, const String& url) // We want a new history item if the refresh timeout is > 1 second. if (!m_scheduledRedirection || delay <= m_scheduledRedirection->delay) -#ifdef ANDROID_USER_GESTURE - { - bool wasUserGesture = false; - DocumentLoader* docLoader = activeDocumentLoader(); - if (docLoader) - wasUserGesture = docLoader->request().userGesture(); - scheduleRedirection(new ScheduledRedirection(delay, url, true, delay <= 1, wasUserGesture, false)); - } -#else scheduleRedirection(new ScheduledRedirection(delay, url, true, delay <= 1, false, false)); -#endif } void FrameLoader::scheduleLocationChange(const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture) @@ -2277,32 +2257,13 @@ void FrameLoader::loadFrameRequest(const FrameLoadRequest& request, bool lockHis } } -#ifdef ANDROID_USER_GESTURE -void FrameLoader::loadPostRequest(const ResourceRequest& request, const String& referrer, const String& frameName, bool lockHistory, FrameLoadType type, PassRefPtr<Event> event, PassRefPtr<FormState> state) -{ - loadPostRequest(request, referrer, frameName, lockHistory, type, event, state, false); -} - -void FrameLoader::loadURL(const KURL& url, const String& referrer, const String& frameName, bool lockHistory, FrameLoadType type, PassRefPtr<Event> event, PassRefPtr<FormState> state) -{ - loadURL(url, referrer, frameName, lockHistory, type, event, state, false); -} - -void FrameLoader::loadURL(const KURL& newURL, const String& referrer, const String& frameName, bool lockHistory, FrameLoadType newLoadType, - PassRefPtr<Event> event, PassRefPtr<FormState> prpFormState, - bool userGesture) -#else void FrameLoader::loadURL(const KURL& newURL, const String& referrer, const String& frameName, bool lockHistory, FrameLoadType newLoadType, PassRefPtr<Event> event, PassRefPtr<FormState> prpFormState) -#endif { RefPtr<FormState> formState = prpFormState; bool isFormSubmission = formState; ResourceRequest request(newURL); -#ifdef ANDROID_USER_GESTURE - request.setUserGesture(userGesture); -#endif if (!referrer.isEmpty()) { request.setHTTPReferrer(referrer); RefPtr<SecurityOrigin> referrerOrigin = SecurityOrigin::createFromString(referrer); @@ -3721,11 +3682,7 @@ void FrameLoader::committedLoad(DocumentLoader* loader, const char* data, int le m_client->committedLoad(loader, data, length); } -#ifdef ANDROID_USER_GESTURE -void FrameLoader::loadPostRequest(const ResourceRequest& inRequest, const String& referrer, const String& frameName, bool lockHistory, FrameLoadType loadType, PassRefPtr<Event> event, PassRefPtr<FormState> prpFormState, bool userGesture) -#else void FrameLoader::loadPostRequest(const ResourceRequest& inRequest, const String& referrer, const String& frameName, bool lockHistory, FrameLoadType loadType, PassRefPtr<Event> event, PassRefPtr<FormState> prpFormState) -#endif { RefPtr<FormState> formState = prpFormState; @@ -3745,9 +3702,6 @@ void FrameLoader::loadPostRequest(const ResourceRequest& inRequest, const String String origin = inRequest.httpOrigin(); ResourceRequest workingResourceRequest(url); -#ifdef ANDROID_USER_GESTURE - workingResourceRequest.setUserGesture(userGesture); -#endif if (!referrer.isEmpty()) workingResourceRequest.setHTTPReferrer(referrer); diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h index 24e7d96..6a63382 100644 --- a/WebCore/loader/FrameLoader.h +++ b/WebCore/loader/FrameLoader.h @@ -512,13 +512,6 @@ namespace WebCore { void loadWithNavigationAction(const ResourceRequest&, const NavigationAction&, // Calls loadWithDocumentLoader bool lockHistory, FrameLoadType, PassRefPtr<FormState>); -#ifdef ANDROID_USER_GESTURE - void loadPostRequest(const ResourceRequest&, const String& referrer, // Called by loadFrameRequest, calls loadWithNavigationAction - const String& frameName, bool lockHistory, FrameLoadType, PassRefPtr<Event>, PassRefPtr<FormState>, bool userGesture); - void loadURL(const KURL&, const String& referrer, const String& frameName, // Called by loadFrameRequest, calls loadWithNavigationAction or dispatches to navigation policy delegate - bool lockHistory, FrameLoadType, PassRefPtr<Event>, PassRefPtr<FormState>, bool userGesture); -#endif // ANDROID_USER_GESTURE - void loadPostRequest(const ResourceRequest&, const String& referrer, // Called by loadFrameRequest, calls loadWithNavigationAction const String& frameName, bool lockHistory, FrameLoadType, PassRefPtr<Event>, PassRefPtr<FormState>); void loadURL(const KURL&, const String& referrer, const String& frameName, // Called by loadFrameRequest, calls loadWithNavigationAction or dispatches to navigation policy delegate diff --git a/WebCore/page/FrameLoadRequest.h b/WebCore/page/FrameLoadRequest.h index 0f92c45..b84a1ec 100644 --- a/WebCore/page/FrameLoadRequest.h +++ b/WebCore/page/FrameLoadRequest.h @@ -33,26 +33,17 @@ namespace WebCore { struct FrameLoadRequest { public: FrameLoadRequest() -#ifdef ANDROID_USER_GESTURE - : m_wasUserGesture(true) -#endif { } FrameLoadRequest(const ResourceRequest& resourceRequest) : m_resourceRequest(resourceRequest) -#ifdef ANDROID_USER_GESTURE - , m_wasUserGesture(true) -#endif { } FrameLoadRequest(const ResourceRequest& resourceRequest, const String& frameName) : m_resourceRequest(resourceRequest) , m_frameName(frameName) -#ifdef ANDROID_USER_GESTURE - , m_wasUserGesture(true) -#endif { } @@ -64,17 +55,9 @@ namespace WebCore { const String& frameName() const { return m_frameName; } void setFrameName(const String& frameName) { m_frameName = frameName; } -#ifdef ANDROID_USER_GESTURE - void setWasUserGesture(bool wasUserGesture) { m_wasUserGesture = wasUserGesture; } - bool wasUserGesture() const { return m_wasUserGesture; } -#endif - private: ResourceRequest m_resourceRequest; String m_frameName; -#ifdef ANDROID_USER_GESTURE - bool m_wasUserGesture; -#endif }; } diff --git a/WebCore/platform/network/android/ResourceRequest.h b/WebCore/platform/network/android/ResourceRequest.h index bc12600..937707f 100644 --- a/WebCore/platform/network/android/ResourceRequest.h +++ b/WebCore/platform/network/android/ResourceRequest.h @@ -38,27 +38,18 @@ namespace WebCore { ResourceRequest(const String& url) : ResourceRequestBase(KURL(url), UseProtocolCachePolicy) , m_cachedResource(0) -#ifdef ANDROID_USER_GESTURE - , m_wasUserGesture(true) -#endif { } ResourceRequest(const KURL& url) : ResourceRequestBase(url, UseProtocolCachePolicy) , m_cachedResource(0) -#ifdef ANDROID_USER_GESTURE - , m_wasUserGesture(true) -#endif { } ResourceRequest(const KURL& url, const String& referrer, ResourceRequestCachePolicy policy = UseProtocolCachePolicy) : ResourceRequestBase(url, policy) , m_cachedResource(0) -#ifdef ANDROID_USER_GESTURE - , m_wasUserGesture(true) -#endif { setHTTPReferrer(referrer); } @@ -66,9 +57,6 @@ namespace WebCore { ResourceRequest() : ResourceRequestBase(KURL(), UseProtocolCachePolicy) , m_cachedResource(0) -#ifdef ANDROID_USER_GESTURE - , m_wasUserGesture(true) -#endif { } @@ -76,16 +64,9 @@ namespace WebCore { void doUpdateResourceRequest() {} void setCachedResource(CachedResource* r) { m_cachedResource = r; } CachedResource* getCachedResource() const { return m_cachedResource; } -#ifdef ANDROID_USER_GESTURE - void setUserGesture(bool userGesture) { m_wasUserGesture = userGesture; } - bool userGesture() const { return m_wasUserGesture; } -#endif private: friend class ResourceRequestBase; CachedResource* m_cachedResource; -#ifdef ANDROID_USER_GESTURE - bool m_wasUserGesture; -#endif }; } // namespace WebCore diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp index 091417b..3e55693 100644 --- a/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -584,17 +584,11 @@ WebFrame::canHandleRequest(const WebCore::ResourceRequest& request) #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); #endif - // Internal loads are ok but any request that is due to a user hitting a key - // should be checked. - bool userGesture = false; -#ifdef ANDROID_USER_GESTURE - userGesture = request.userGesture(); -#endif // always handle "POST" in place if (equalIgnoringCase(request.httpMethod(), "POST")) return true; WebCore::KURL requestUrl = request.url(); - if (!mUserInitiatedClick && !userGesture && + if (!mUserInitiatedClick && (requestUrl.protocolIs("http") || requestUrl.protocolIs("https") || requestUrl.protocolIs("file") || requestUrl.protocolIs("about") || requestUrl.protocolIs("javascript"))) |