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

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

Issue 207743004: Upstream TabModel and related classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 7 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/android/java/src/org/chromium/chrome/browser/tabmodel/TabModel.java » ('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/tabmodel/TabList.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabList.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabList.java
new file mode 100644
index 0000000000000000000000000000000000000000..b4f32e09bf2888a604f3124080a60e2cbbe57939
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabList.java
@@ -0,0 +1,51 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.tabmodel;
+
+import org.chromium.chrome.browser.Tab;
+
+/**
+ * A read only list of {@link Tab}s. This list understands the concept of an incognito list as
+ * well as a currently selected tab (see {@link #index}).
+ */
+public interface TabList {
+ public static final int INVALID_TAB_INDEX = -1;
+
+ /**
+ * @return Whether this tab model contains only incognito tabs or only normal tabs.
+ */
+ boolean isIncognito();
+
+ /**
+ * @return The index of the current tab, or {@link #INVALID_TAB_INDEX} if there are no tabs.
+ */
+ int index();
+
+ /**
+ * @return the number of open tabs in this model
+ */
+ int getCount();
+
+ /**
+ * Get the tab at the specified position
+ *
+ * @param index The index of the {@link Tab} to return.
+ * @return The {@code Tab} at position {@code index}, or {@code null} if {@code index} < 0
+ * or {@code index} >= {@link #getCount()}.
+ */
+ Tab getTabAt(int index);
+
+ /**
+ * @return index of the given tab in the order of the tab stack.
+ */
+ int indexOf(Tab tab);
+
+ /**
+ * @param tabId The id of the {@link Tab} that might have a pending closure.
+ * @return Whether or not the {@link Tab} specified by {@code tabId} has a pending
+ * closure.
+ */
+ boolean isClosurePending(int tabId);
+}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModel.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698