| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser; | 5 package org.chromium.chrome.browser; |
| 6 | 6 |
| 7 import org.chromium.base.CalledByNative; | 7 import org.chromium.base.CalledByNative; |
| 8 import org.chromium.chrome.browser.profiles.Profile; | 8 import org.chromium.chrome.browser.profiles.Profile; |
| 9 | 9 |
| 10 import java.util.ArrayList; | 10 import java.util.ArrayList; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 } | 179 } |
| 180 | 180 |
| 181 /** | 181 /** |
| 182 * Opens the given foreign tab in a new tab. | 182 * Opens the given foreign tab in a new tab. |
| 183 * @param tab Tab to load the session into. | 183 * @param tab Tab to load the session into. |
| 184 * @param session Session that the target tab belongs to. | 184 * @param session Session that the target tab belongs to. |
| 185 * @param foreignTab Target tab to open. | 185 * @param foreignTab Target tab to open. |
| 186 * @param windowOpenDisposition The WindowOpenDisposition flag. | 186 * @param windowOpenDisposition The WindowOpenDisposition flag. |
| 187 * @return {@code True} iff the tab is successfully opened. | 187 * @return {@code True} iff the tab is successfully opened. |
| 188 */ | 188 */ |
| 189 public boolean openForeignSessionTab(TabBase tab, ForeignSession session, | 189 public boolean openForeignSessionTab(Tab tab, ForeignSession session, |
| 190 ForeignSessionTab foreignTab, int windowOpenDisposition) { | 190 ForeignSessionTab foreignTab, int windowOpenDisposition) { |
| 191 return nativeOpenForeignSessionTab(mNativeForeignSessionHelper, tab, ses
sion.tag, | 191 return nativeOpenForeignSessionTab(mNativeForeignSessionHelper, tab, ses
sion.tag, |
| 192 foreignTab.id, windowOpenDisposition); | 192 foreignTab.id, windowOpenDisposition); |
| 193 } | 193 } |
| 194 | 194 |
| 195 /** | 195 /** |
| 196 * Remove Foreign session to display. Note that it will be reappear on the n
ext sync. | 196 * Remove Foreign session to display. Note that it will be reappear on the n
ext sync. |
| 197 * | 197 * |
| 198 * This is mainly for when user wants to delete very old session that won't
be used or syned in | 198 * This is mainly for when user wants to delete very old session that won't
be used or syned in |
| 199 * the future. | 199 * the future. |
| 200 * @param session Session to be deleted. | 200 * @param session Session to be deleted. |
| 201 */ | 201 */ |
| 202 public void deleteForeignSession(ForeignSession session) { | 202 public void deleteForeignSession(ForeignSession session) { |
| 203 nativeDeleteForeignSession(mNativeForeignSessionHelper, session.tag); | 203 nativeDeleteForeignSession(mNativeForeignSessionHelper, session.tag); |
| 204 } | 204 } |
| 205 | 205 |
| 206 private static native long nativeInit(Profile profile); | 206 private static native long nativeInit(Profile profile); |
| 207 private static native void nativeDestroy(long nativeForeignSessionHelper); | 207 private static native void nativeDestroy(long nativeForeignSessionHelper); |
| 208 private static native boolean nativeIsTabSyncEnabled(long nativeForeignSessi
onHelper); | 208 private static native boolean nativeIsTabSyncEnabled(long nativeForeignSessi
onHelper); |
| 209 private static native void nativeSetOnForeignSessionCallback( | 209 private static native void nativeSetOnForeignSessionCallback( |
| 210 long nativeForeignSessionHelper, ForeignSessionCallback callback); | 210 long nativeForeignSessionHelper, ForeignSessionCallback callback); |
| 211 private static native boolean nativeGetForeignSessions(long nativeForeignSes
sionHelper, | 211 private static native boolean nativeGetForeignSessions(long nativeForeignSes
sionHelper, |
| 212 List<ForeignSession> resultSessions); | 212 List<ForeignSession> resultSessions); |
| 213 private static native boolean nativeOpenForeignSessionTab( | 213 private static native boolean nativeOpenForeignSessionTab( |
| 214 long nativeForeignSessionHelper, TabBase tab, String sessionTag, int
tabId, | 214 long nativeForeignSessionHelper, Tab tab, String sessionTag, int tab
Id, |
| 215 int disposition); | 215 int disposition); |
| 216 private static native void nativeDeleteForeignSession( | 216 private static native void nativeDeleteForeignSession( |
| 217 long nativeForeignSessionHelper, String sessionTag); | 217 long nativeForeignSessionHelper, String sessionTag); |
| 218 } | 218 } |
| OLD | NEW |