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

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

Issue 904453002: Feed back to the ServiceTabLauncher when the tab has been created. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a-open-window
Patch Set: add findbugs line Created 5 years, 10 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/ServiceTabLauncher.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java
index ae2f56ec40098269de8939923ac81a1632256076..4eaf752fa0ca136f0ea6b771eaf9bf4a3949cd0c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java
@@ -11,6 +11,7 @@ import android.content.pm.PackageManager.NameNotFoundException;
import android.util.Log;
import org.chromium.base.CalledByNative;
+import org.chromium.content_public.browser.WebContents;
/**
* Tab Launcher to be used to launch new tabs from background Android Services, when it is not
@@ -23,6 +24,10 @@ public abstract class ServiceTabLauncher {
private static final String SERVICE_TAB_LAUNCHER_KEY =
"org.chromium.chrome.browser.SERVICE_TAB_LAUNCHER";
+ // Name of the extra containing the Id of a tab launch request id.
+ public static final String LAUNCH_REQUEST_ID_EXTRA =
+ "org.chromium.chrome.browser.ServiceTabLauncher.LAUNCH_REQUEST_ID";
+
private static ServiceTabLauncher sInstance;
/**
@@ -88,4 +93,19 @@ public abstract class ServiceTabLauncher {
return null;
}
+
+ /**
+ * To be called by the activity when the WebContents for |requestId| has been created, or has
+ * been recycled from previous use. The |webContents| must not yet have started provisional
+ * load for the main frame.
+ *
+ * @param requestId Id of the tab launching request which has been fulfilled.
+ * @param webContents The WebContents instance associated with this request.
+ */
+ public static void onWebContentsForRequestAvailable(int requestId, WebContents webContents) {
+ nativeOnWebContentsForRequestAvailable(requestId, webContents);
+ }
+
+ private static native void nativeOnWebContentsForRequestAvailable(
+ int requestId, WebContents webContents);
}

Powered by Google App Engine
This is Rietveld 408576698