diff options
Diffstat (limited to 'WebKit/android/jni')
| -rw-r--r-- | WebKit/android/jni/JavaBridge.cpp | 16 | ||||
| -rw-r--r-- | WebKit/android/jni/WebCoreFrameBridge.cpp | 19 | ||||
| -rw-r--r-- | WebKit/android/jni/WebCoreFrameBridge.h | 2 | ||||
| -rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 6 |
4 files changed, 43 insertions, 0 deletions
diff --git a/WebKit/android/jni/JavaBridge.cpp b/WebKit/android/jni/JavaBridge.cpp index 7c4636f..3f9a056 100644 --- a/WebKit/android/jni/JavaBridge.cpp +++ b/WebKit/android/jni/JavaBridge.cpp @@ -76,6 +76,7 @@ public: virtual bool cookiesEnabled(); virtual WTF::Vector<WebCore::String> getPluginDirectories(); + virtual WebCore::String getPluginSharedDataDirectory(); virtual WTF::Vector<String> getSupportedKeyStrengthList(); virtual WebCore::String getSignedPublicKeyAndChallengeString(unsigned index, @@ -107,6 +108,7 @@ private: jmethodID mCookies; jmethodID mCookiesEnabled; jmethodID mGetPluginDirectories; + jmethodID mGetPluginSharedDataDirectory; jmethodID mSignalFuncPtrQueue; jmethodID mGetKeyStrengthList; jmethodID mGetSignedPublicKey; @@ -125,6 +127,7 @@ JavaBridge::JavaBridge(JNIEnv* env, jobject obj) mCookies = env->GetMethodID(clazz, "cookies", "(Ljava/lang/String;)Ljava/lang/String;"); mCookiesEnabled = env->GetMethodID(clazz, "cookiesEnabled", "()Z"); mGetPluginDirectories = env->GetMethodID(clazz, "getPluginDirectories", "()[Ljava/lang/String;"); + mGetPluginSharedDataDirectory = env->GetMethodID(clazz, "getPluginSharedDataDirectory", "()Ljava/lang/String;"); mSignalFuncPtrQueue = env->GetMethodID(clazz, "signalServiceFuncPtrQueue", "()V"); mGetKeyStrengthList = env->GetMethodID(clazz, "getKeyStrengthList", "()[Ljava/lang/String;"); mGetSignedPublicKey = env->GetMethodID(clazz, "getSignedPublicKey", "(ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;"); @@ -134,6 +137,8 @@ JavaBridge::JavaBridge(JNIEnv* env, jobject obj) LOG_ASSERT(mSetCookies, "Could not find method setCookies"); LOG_ASSERT(mCookies, "Could not find method cookies"); LOG_ASSERT(mCookiesEnabled, "Could not find method cookiesEnabled"); + LOG_ASSERT(mGetPluginDirectories, "Could not find method getPluginDirectories"); + LOG_ASSERT(mGetPluginSharedDataDirectory, "Could not find method getPluginSharedDataDirectory"); LOG_ASSERT(mGetKeyStrengthList, "Could not find method getKeyStrengthList"); LOG_ASSERT(mGetSignedPublicKey, "Could not find method getSignedPublicKey"); @@ -231,6 +236,17 @@ JavaBridge::getPluginDirectories() return directories; } +WebCore::String +JavaBridge::getPluginSharedDataDirectory() +{ + JNIEnv* env = JSC::Bindings::getJNIEnv(); + AutoJObject obj = getRealObject(env, mJavaObject); + jstring ret = (jstring)env->CallObjectMethod(obj.get(), mGetPluginSharedDataDirectory); + WebCore::String path = to_string(env, ret); + checkException(env); + return path; +} + void JavaBridge::setSharedTimerCallback(void (*f)()) { diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp index b856e10..f47603b 100644 --- a/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -136,6 +136,7 @@ struct WebFrame::JavaBrowserFrame jmethodID mWindowObjectCleared; jmethodID mSetProgress; jmethodID mDidReceiveIcon; + jmethodID mDidReceiveTouchIconUrl; jmethodID mUpdateVisitedHistory; jmethodID mHandleUrl; jmethodID mCreateWindow; @@ -182,6 +183,8 @@ WebFrame::WebFrame(JNIEnv* env, jobject obj, jobject historyList, WebCore::Page* "(I)V"); mJavaFrame->mDidReceiveIcon = env->GetMethodID(clazz, "didReceiveIcon", "(Landroid/graphics/Bitmap;)V"); + mJavaFrame->mDidReceiveTouchIconUrl = env->GetMethodID(clazz, "didReceiveTouchIconUrl", + "(Ljava/lang/String;)V"); mJavaFrame->mUpdateVisitedHistory = env->GetMethodID(clazz, "updateVisitedHistory", "(Ljava/lang/String;Z)V"); mJavaFrame->mHandleUrl = env->GetMethodID(clazz, "handleUrl", @@ -206,6 +209,7 @@ WebFrame::WebFrame(JNIEnv* env, jobject obj, jobject historyList, WebCore::Page* LOG_ASSERT(mJavaFrame->mWindowObjectCleared, "Could not find method windowObjectCleared"); LOG_ASSERT(mJavaFrame->mSetProgress, "Could not find method setProgress"); LOG_ASSERT(mJavaFrame->mDidReceiveIcon, "Could not find method didReceiveIcon"); + LOG_ASSERT(mJavaFrame->mDidReceiveTouchIconUrl, "Could not find method didReceiveTouchIconUrl"); LOG_ASSERT(mJavaFrame->mUpdateVisitedHistory, "Could not find method updateVisitedHistory"); LOG_ASSERT(mJavaFrame->mHandleUrl, "Could not find method handleUrl"); LOG_ASSERT(mJavaFrame->mCreateWindow, "Could not find method createWindow"); @@ -575,6 +579,21 @@ WebFrame::didReceiveIcon(WebCore::Image* icon) } void +WebFrame::didReceiveTouchIconURL(const WebCore::String& url) +{ +#ifdef ANDROID_INSTRUMENT + TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); +#endif + JNIEnv* env = JSC::Bindings::getJNIEnv(); + jstring jUrlStr = env->NewString((unsigned short*)url.characters(), + url.length()); + + env->CallVoidMethod(mJavaFrame->frame(env).get(), + mJavaFrame->mDidReceiveTouchIconUrl, jUrlStr); + checkException(env); +} + +void WebFrame::updateVisitedHistory(const WebCore::KURL& url, bool reload) { #ifdef ANDROID_INSTRUMENT diff --git a/WebKit/android/jni/WebCoreFrameBridge.h b/WebKit/android/jni/WebCoreFrameBridge.h index 5bfd1fb..6b5c90c 100644 --- a/WebKit/android/jni/WebCoreFrameBridge.h +++ b/WebKit/android/jni/WebCoreFrameBridge.h @@ -89,6 +89,8 @@ class WebFrame : public WebCoreRefObject { const WebCore::String userAgentForURL(const WebCore::KURL* url); void didReceiveIcon(WebCore::Image* icon); + + void didReceiveTouchIconURL(const WebCore::String& url); void updateVisitedHistory(const WebCore::KURL& url, bool reload); diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 43a077f..35aeedb 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -885,6 +885,12 @@ void WebViewCore::notifyProgressFinished() m_check_domtree_version = true; updateFrameCache(); sendNotifyProgressFinished(); + + // trigger an event notifying the plugins that the page has loaded + ANPEvent event; + SkANP::InitEvent(&event, kLifecycle_ANPEventType); + event.data.lifecycle.action = kOnLoad_ANPLifecycleAction; + sendPluginEvent(event); } void WebViewCore::doMaxScroll(CacheBuilder::Direction dir) |
