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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 23018005: Start renderer in ContentViewCoreImpl::EvaluateJavaScript. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 7 years, 4 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 68d1e73fd46ae19590523186f2a9b6e295321b06..eac56057ccaa196d25bb04cd96c651af0ff2bcd9 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
@@ -1373,7 +1373,20 @@ import java.util.Map;
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);
}
/**
@@ -3127,7 +3140,7 @@ import java.util.Map;
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);
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698