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

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

Issue 2610143002: Add RecentTabsPageTest (Closed)
Patch Set: fix bad merge Created 3 years, 11 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
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentlyClosedTabManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentlyClosedTabManager.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentlyClosedTabManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..3ea0113e97c7cffbd64cbe25e470ed3c282682de
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentlyClosedTabManager.java
@@ -0,0 +1,56 @@
+// Copyright 2017 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.ntp;
+
+import android.support.annotation.Nullable;
+
+import org.chromium.chrome.browser.tab.Tab;
+
+import java.util.List;
+
+/**
+ * Manages a list of recently closed tabs.
+ */
+public interface RecentlyClosedTabManager {
+ /**
+ * Sets the {@link Runnable} to be called whenever the list of recently closed tabs changes.
+ * @param runnable The {@link Runnable} to be called, or null.
+ */
+ void setTabsUpdatedRunnable(@Nullable Runnable runnable);
+
+ /**
+ * @param maxTabCount The maximum number of recently closed tabs to return.
+ * @return A snapshot of the list of recently closed tabs, with up to maxTabCount elements.
+ */
+ List<RecentlyClosedTab> getRecentlyClosedTabs(int maxTabCount);
+
+ /**
+ * Opens a recently closed tab in the current tab or a new tab. If opened in the current tab,
+ * the current tab's entire history is replaced.
+ *
+ * @param tab The current Tab.
+ * @param recentTab The RecentlyClosedTab to open.
+ * @param windowOpenDisposition The WindowOpenDisposition value specifying whether to open in
+ * the current tab or a new tab.
+ * @return Whether the tab was successfully opened.
+ */
+ boolean openRecentlyClosedTab(Tab tab, RecentlyClosedTab recentTab, int windowOpenDisposition);
+
+ /**
+ * Opens the most recently closed tab in a new tab.
+ */
+ void openRecentlyClosedTab();
+
+ /**
+ * Clears all recently closed tabs.
+ */
+ void clearRecentlyClosedTabs();
+
+ /**
+ * To be called before this instance is abandoned to the garbage collector so it can do any
+ * necessary cleanups. This instance must not be used after this method is called.
+ */
+ void destroy();
+}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentlyClosedTab.java ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698