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

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

Issue 36473002: Foreign session pages now load into current tab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Yaron Created 7 years, 1 month 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/ForeignSessionHelper.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ForeignSessionHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/ForeignSessionHelper.java
index 33a6e5764f5f45c584d63de0ce268b437746f12d..cfabcb80c434dad63ac5227786b9c9318c89ac30 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ForeignSessionHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ForeignSessionHelper.java
@@ -5,6 +5,7 @@
package org.chromium.chrome.browser;
import org.chromium.base.CalledByNative;
+import org.chromium.chrome.browser.TabBase;
import org.chromium.chrome.browser.profiles.Profile;
import java.util.ArrayList;
@@ -177,13 +178,29 @@ public class ForeignSessionHelper {
}
/**
+ * TODO(apiccion): Remvoe this method once downstream CL Lands.
+ * See: http://crbug.com/257102
* Opens the given foreign tab in a new tab.
* @param session Session that the target tab belongs to.
- * @param tab Target tab to open.
- * @return {@code True} iff the tab is successfully opened.
+ * @param tab Target tab to open.
+ * @return {@code True} iff the tab is successfully opened.
*/
public boolean openForeignSessionTab(ForeignSession session, ForeignSessionTab tab) {
- return nativeOpenForeignSessionTab(mNativeForeignSessionHelper, session.tag, tab.id);
+ return nativeOpenForeignSessionTabOld(mNativeForeignSessionHelper, session.tag, tab.id);
+ }
+
+ /**
+ * Opens the given foreign tab in a new tab.
+ * @param tab Tab to load the session into.
+ * @param session Session that the target tab belongs to.
+ * @param foreignTab Target tab to open.
+ * @param windowDisposition The WindowOpenDisposition flag.
+ * @return {@code True} iff the tab is successfully opened.
+ */
+ public boolean openForeignSessionTab(TabBase tab, ForeignSession session,
+ ForeignSessionTab foreignTab, int windowOpenDisposition) {
+ return nativeOpenForeignSessionTab(mNativeForeignSessionHelper, tab, session.tag,
+ foreignTab.id, windowOpenDisposition);
Ted C 2013/11/04 19:46:28 +4 indent
apiccion 2013/11/04 19:52:30 Done.
}
/**
@@ -222,8 +239,13 @@ public class ForeignSessionHelper {
int nativeForeignSessionHelper, ForeignSessionCallback callback);
private static native boolean nativeGetForeignSessions(int nativeForeignSessionHelper,
List<ForeignSession> resultSessions);
- private static native boolean nativeOpenForeignSessionTab(
+ // TODO(apiccion): Remvoe this method once downstream CL Lands.
+ // See: http://crbug.com/257102
+ private static native boolean nativeOpenForeignSessionTabOld(
int nativeForeignSessionHelper, String sessionTag, int tabId);
+ private static native boolean nativeOpenForeignSessionTab(
+ int nativeForeignSessionHelper, TabBase tab, String sessionTag, int tabId,
+ int disposition);
private static native void nativeSetForeignSessionCollapsed(
int nativeForeignSessionHelper, String sessionTag, boolean isCollapsed);
private static native boolean nativeGetForeignSessionCollapsed(
« no previous file with comments | « no previous file | chrome/browser/android/foreign_session_helper.h » ('j') | chrome/browser/android/foreign_session_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698