Index: chrome/android/java/src/org/chromium/chrome/browser/blimp/ChromeBlimpClientContextDelegate.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/blimp/ChromeBlimpClientContextDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/blimp/ChromeBlimpClientContextDelegate.java |
index 21a005710765507f2012be9d9786a235f3c293d2..48585142ac67f3662a16bfc68c3045eecf67c3cd 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/blimp/ChromeBlimpClientContextDelegate.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/blimp/ChromeBlimpClientContextDelegate.java |
@@ -5,6 +5,7 @@ |
package org.chromium.chrome.browser.blimp; |
import org.chromium.base.annotations.CalledByNative; |
+import org.chromium.blimp_public.BlimpClientContext; |
import org.chromium.blimp_public.BlimpClientContextDelegate; |
import org.chromium.chrome.browser.profiles.Profile; |
@@ -18,6 +19,9 @@ import org.chromium.chrome.browser.profiles.Profile; |
* When the delegate should be deleted, a call to {@link #destroy} is required. |
*/ |
public class ChromeBlimpClientContextDelegate implements BlimpClientContextDelegate { |
+ // Blimp client context reference associated with this delegate. |
+ private BlimpClientContext mBlimpClientContext; |
+ |
/** |
* Creates a new ChromeBlimpClientContextDelegate that is owned by the caller. It automatically |
* attaches itself as the sole delegate for the BlimpClientContext attached to the given |
@@ -34,6 +38,13 @@ public class ChromeBlimpClientContextDelegate implements BlimpClientContextDeleg |
} |
/** |
+ * @return {@link BlimpClientContext} object this delegate belongs to. |
+ */ |
+ public BlimpClientContext getBlimpClientContext() { |
+ return mBlimpClientContext; |
+ } |
+ |
+ /** |
* The pointer to the ChromeBlimpClientContextDelegateAndroid JNI bridge. |
*/ |
private long mNativeChromeBlimpClientContextDelegateAndroid; |
@@ -42,8 +53,12 @@ public class ChromeBlimpClientContextDelegate implements BlimpClientContextDeleg |
// Create native delegate object. |
mNativeChromeBlimpClientContextDelegateAndroid = nativeInit(profile); |
+ BlimpClientContext context = BlimpClientContextFactory |
+ .getBlimpClientContextForProfile(profile); |
+ mBlimpClientContext = context; |
+ |
// Set ourselves as the Java delegate object. |
- BlimpClientContextFactory.getBlimpClientContextForProfile(profile).setDelegate(this); |
+ mBlimpClientContext.setDelegate(this); |
} |
@CalledByNative |