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); |
} |