Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2222)

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 992833002: Move minor WebViewChromium implementation to chromium layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 0fd53a0ee747f94c3b67de14798d46af14e96792..a598453b494dca36413ad655d8eee8c9cd0f3b29 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -36,6 +36,7 @@ import android.view.accessibility.AccessibilityNodeProvider;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.webkit.GeolocationPermissions;
+import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback;
import android.widget.OverScroller;
@@ -2128,9 +2129,12 @@ public class AwContents implements SmartClipProvider,
/**
* @see ContentViewCore#addPossiblyUnsafeJavascriptInterface(Object, String, Class)
*/
- public void addPossiblyUnsafeJavascriptInterface(Object object, String name,
- Class<? extends Annotation> requiredAnnotation) {
+ public void addJavascriptInterface(Object object, String name) {
if (isDestroyed()) return;
+ Class<? extends Annotation> requiredAnnotation = null;
+ if (mAppTargetSdkVersion >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
+ requiredAnnotation = JavascriptInterface.class;
+ }
mContentViewCore.addPossiblyUnsafeJavascriptInterface(object, name, requiredAnnotation);
}

Powered by Google App Engine
This is Rietveld 408576698