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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/blimp/ChromeBlimpClientContextDelegate.java

Issue 2204223005: Blimp OAuth2 token retreival on application start up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add deps file. 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: 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

Powered by Google App Engine
This is Rietveld 408576698