Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
=================================================================== |
--- content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (revision 219349) |
+++ content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (working copy) |
@@ -1373,10 +1373,23 @@ |
public void evaluateJavaScript( |
String script, JavaScriptCallback callback) throws IllegalStateException { |
checkIsAlive(); |
- nativeEvaluateJavaScript(mNativeContentViewCore, script, callback); |
+ nativeEvaluateJavaScript(mNativeContentViewCore, script, callback, false); |
} |
/** |
+ * Injects the passed Javascript code in the current page and evaluates it. |
+ * If there is no page existing, a new one will be created. |
+ * |
+ * @param script The Javascript to execute. |
+ * @throws IllegalStateException If the ContentView has been destroyed. |
+ */ |
+ public void evaluateJavaScriptEvenIfNotYetNavigated(String script) |
+ throws IllegalStateException { |
+ checkIsAlive(); |
+ nativeEvaluateJavaScript(mNativeContentViewCore, script, null, true); |
+ } |
+ |
+ /** |
* This method should be called when the containing activity is paused. |
*/ |
public void onActivityPause() { |
@@ -3126,7 +3139,7 @@ |
private native void nativeClearHistory(int nativeContentViewCoreImpl); |
private native void nativeEvaluateJavaScript(int nativeContentViewCoreImpl, |
- String script, JavaScriptCallback callback); |
+ String script, JavaScriptCallback callback, boolean startRenderer); |
private native int nativeGetNativeImeAdapter(int nativeContentViewCoreImpl); |