Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
| diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
| index d97b6d13cd24cd7c7657277d7785e88a1596f4c2..3856c65fd9611a194008a70b1ee95e2509d35911 100644 |
| --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
| +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
| @@ -563,6 +563,21 @@ public class ContentViewCore implements MotionEventDelegate { |
| } |
| /** |
| + * Injects the passed JavaScript code in the current page and evaluates it. |
| + * Once evaluated, an asynchronous call to |
| + * ContentViewClient.onJavaScriptEvaluationResult is made. Used in automation |
| + * tests. |
| + * |
| + * @return an id that is passed along in the asynchronous onJavaScriptEvaluationResult callback |
| + * @throws IllegalStateException If the ContentView has been destroyed. |
| + * @hide |
| + */ |
| + public int evaluateJavaScript(String script) throws IllegalStateException { |
| + checkIsAlive(); |
| + return nativeEvaluateJavaScript(script); |
| + } |
| + |
| + /** |
| * This method should be called when the containing activity is paused |
| */ |
| public void onActivityPause() { |
| @@ -738,6 +753,12 @@ public class ContentViewCore implements MotionEventDelegate { |
| SelectPopupDialog.show(this, items, enabled, multiple, selectedIndices); |
| } |
| + @SuppressWarnings("unused") |
|
Ted C
2012/07/31 18:15:48
if this is non-private, I don't think you need the
David Trainor- moved to gerrit
2012/07/31 20:38:47
Made it private.
|
| + @CalledByNative |
| + void onEvaluateJavaScriptResult(int id, String jsonResult) { |
| + getContentViewClient().onEvaluateJavaScriptResult(id, jsonResult); |
| + } |
| + |
| /** |
| * Called (from native) when page loading begins. |
| */ |
| @@ -997,6 +1018,8 @@ public class ContentViewCore implements MotionEventDelegate { |
| private native void nativeClearHistory(int nativeContentViewCoreImpl); |
| + private native int nativeEvaluateJavaScript(String script); |
| + |
| private native void nativeAddJavascriptInterface(int nativeContentViewCoreImpl, Object object, |
| String name, boolean allowInheritedMethods); |