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

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: sky 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
« no previous file with comments | « no previous file | chrome/browser/android/foreign_session_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 192ef4087174c506e63d58ad24f2382c8707a2b1..b910f8002d2ebeb304479016b9c04fde04de9366 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ForeignSessionHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ForeignSessionHelper.java
@@ -148,6 +148,7 @@ public class ForeignSessionHelper {
/**
* Sets callback instance that will be called on every foreign session sync update.
+ * @param callback The callback to be invoked.
*/
public void setOnForeignSessionCallback(ForeignSessionCallback callback) {
nativeSetOnForeignSessionCallback(mNativeForeignSessionHelper, callback);
@@ -166,7 +167,7 @@ public class ForeignSessionHelper {
@Override
public int compare(ForeignSession lhs, ForeignSession rhs) {
return lhs.modifiedTime < rhs.modifiedTime ? 1 :
- (lhs.modifiedTime == rhs.modifiedTime ? 0: -1);
+ (lhs.modifiedTime == rhs.modifiedTime ? 0 : -1);
}
});
} else {
@@ -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 windowOpenDisposition 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);
}
/**
@@ -204,8 +221,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 nativeDeleteForeignSession(
int nativeForeignSessionHelper, String sessionTag);
}
« no previous file with comments | « no previous file | chrome/browser/android/foreign_session_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698