summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav/WebView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/android/nav/WebView.cpp')
-rw-r--r--WebKit/android/nav/WebView.cpp38
1 files changed, 25 insertions, 13 deletions
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp
index 03052ca..6370021 100644
--- a/WebKit/android/nav/WebView.cpp
+++ b/WebKit/android/nav/WebView.cpp
@@ -1793,6 +1793,25 @@ static void nativeSelectBestAt(JNIEnv *env, jobject obj, jobject jrect)
view->selectBestAt(rect);
}
+static jobject nativeLayerBounds(JNIEnv* env, jobject obj, jint jlayer)
+{
+ SkRect r;
+#if USE(ACCELERATED_COMPOSITING)
+ LayerAndroid* layer = (LayerAndroid*) jlayer;
+ r = layer->bounds();
+#else
+ r.setEmpty();
+#endif
+ SkIRect irect;
+ r.round(&irect);
+ jclass rectClass = env->FindClass("android/graphics/Rect");
+ jmethodID init = env->GetMethodID(rectClass, "<init>", "(IIII)V");
+ jobject rect = env->NewObject(rectClass, init, irect.fLeft, irect.fTop,
+ irect.fRight, irect.fBottom);
+ env->DeleteLocalRef(rectClass);
+ return rect;
+}
+
static jobject nativeSubtractLayers(JNIEnv* env, jobject obj, jobject jrect)
{
SkIRect irect = jrect_to_webrect(env, jrect);
@@ -2048,19 +2067,10 @@ static void nativeMoveSelection(JNIEnv *env, jobject obj, int x, int y)
GET_NATIVE_VIEW(env, obj)->moveSelection(x, y);
}
-static jboolean nativeCleanupPrivateBrowsingFiles(
- JNIEnv *env, jobject obj, jstring databaseDirectoryJString, jstring cacheDirectoryJString) {
+static jboolean nativeCleanupPrivateBrowsingFiles(JNIEnv*, jobject)
+{
#if USE(CHROME_NETWORK_STACK)
- jboolean isCopy;
- const char* cString = env->GetStringUTFChars(databaseDirectoryJString, &isCopy);
- std::string databaseDirectory(cString);
- if (isCopy == JNI_TRUE)
- env->ReleaseStringUTFChars(databaseDirectoryJString, cString);
- cString = env->GetStringUTFChars(cacheDirectoryJString, &isCopy);
- std::string cacheDirectory(cString);
- if (isCopy == JNI_TRUE)
- env->ReleaseStringUTFChars(cacheDirectoryJString, cString);
- return WebRequestContext::cleanupPrivateBrowsingFiles(databaseDirectory, cacheDirectory);
+ return WebRequestContext::cleanupPrivateBrowsingFiles();
#else
return JNI_FALSE;
#endif
@@ -2312,6 +2322,8 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeImageURI },
{ "nativeInstrumentReport", "()V",
(void*) nativeInstrumentReport },
+ { "nativeLayerBounds", "(I)Landroid/graphics/Rect;",
+ (void*) nativeLayerBounds },
{ "nativeMotionUp", "(III)Z",
(void*) nativeMotionUp },
{ "nativeMoveCursor", "(IIZ)Z",
@@ -2322,7 +2334,7 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeMoveGeneration },
{ "nativeMoveSelection", "(II)V",
(void*) nativeMoveSelection },
- { "nativeCleanupPrivateBrowsingFiles", "(Ljava/lang/String;Ljava/lang/String;)Z",
+ { "nativeCleanupPrivateBrowsingFiles", "()Z",
(void*) nativeCleanupPrivateBrowsingFiles },
{ "nativePointInNavCache", "(III)Z",
(void*) nativePointInNavCache },