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

Unified Diff: blimp/client/core/android/java/src/org/chromium/blimp/core/BlimpClientContextImpl.java

Issue 2191743002: Setup the delegate in Chrome, so we may put chrome java functions we need in blimp to the delegate … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 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
Index: blimp/client/core/android/java/src/org/chromium/blimp/core/BlimpClientContextImpl.java
diff --git a/blimp/client/core/android/java/src/org/chromium/blimp/core/BlimpClientContextImpl.java b/blimp/client/core/android/java/src/org/chromium/blimp/core/BlimpClientContextImpl.java
index 080da76bfc69a2e9d2ff771d9642a81a009264dd..8fa79f87a17d75cb7d1929d746b5a5c1d0212a9f 100644
--- a/blimp/client/core/android/java/src/org/chromium/blimp/core/BlimpClientContextImpl.java
+++ b/blimp/client/core/android/java/src/org/chromium/blimp/core/BlimpClientContextImpl.java
@@ -10,6 +10,7 @@ import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.blimp.core.settings.AboutBlimpPreferences;
import org.chromium.blimp_public.BlimpClientContext;
+import org.chromium.blimp_public.BlimpClientContextDelegate;
import org.chromium.blimp_public.BlimpSettingsCallbacks;
import org.chromium.blimp_public.contents.BlimpContents;
@@ -19,6 +20,19 @@ import org.chromium.blimp_public.contents.BlimpContents;
*/
@JNINamespace("blimp::client")
public class BlimpClientContextImpl implements BlimpClientContext {
+
+ /**
+ * Get embedder delegate which provides necessary functionality and callbacks.
+ *
+ * The delegate is created through JNI in early startup.
+ *
+ * @return BlimpClientContextDelegate, which contains functions we need in embedder, and can
+ * return null if called before the implementation object is created.
+ */
+ public BlimpClientContextDelegate getDelegate() {
+ return nativeGetDelegateJavaObject(mNativeBlimpClientContextImplAndroid);
David Trainor- moved to gerrit 2016/08/03 19:39:54 assert mNativeBlimpClientContextImplAndroid != 0?
+ }
+
@CalledByNative
private static BlimpClientContextImpl create(long nativeBlimpClientContextImplAndroid) {
return new BlimpClientContextImpl(nativeBlimpClientContextImplAndroid);
@@ -64,4 +78,7 @@ public class BlimpClientContextImpl implements BlimpClientContext {
private native BlimpContents nativeCreateBlimpContentsJava(
long nativeBlimpClientContextImplAndroid);
+
+ private native BlimpClientContextDelegate nativeGetDelegateJavaObject(
+ long nativeBlimpClientContextImplAndroid);
}

Powered by Google App Engine
This is Rietveld 408576698