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

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

Issue 2684233003: Switch tabs from VR shell. (Closed)
Patch Set: Rebased on ToT Created 3 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
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_shell.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/vr_shell/VrShellDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
index 51c48a4d820c67f250d8727f0a238473accb06ce..8fd4516c6a8bc32109d3ae817eeb7ab05c36031d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
@@ -35,6 +35,8 @@ import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.multiwindow.MultiWindowUtils;
import org.chromium.chrome.browser.tab.Tab;
+import org.chromium.chrome.browser.tabmodel.TabModel;
+import org.chromium.chrome.browser.tabmodel.TabModelUtils;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -627,6 +629,19 @@ public class VrShellDelegate {
return mNativeVrShellDelegate;
}
+ @CalledByNative
+ private void showTab(int id) {
+ Tab tab = mActivity.getTabModelSelector().getTabById(id);
+ if (tab == null) {
+ return;
+ }
+ int index = mActivity.getTabModelSelector().getModel(tab.isIncognito()).indexOf(tab);
+ if (index == TabModel.INVALID_TAB_INDEX) {
+ return;
+ }
+ TabModelUtils.setIndex(mActivity.getTabModelSelector().getModel(tab.isIncognito()), index);
+ }
+
private native long nativeInit();
private native void nativeSetPresentResult(long nativeVrShellDelegate, boolean result);
private native void nativeDisplayActivate(long nativeVrShellDelegate);
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698