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

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

Issue 2088443003: Shortcut ctrl+shift+T added on android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unused includes in recently_closed_tab_bridge.cc Created 4 years, 5 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/RecentlyClosedBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentlyClosedBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentlyClosedBridge.java
index ed7b53de4c081a1bf474fbfe8f9383d6b641cec9..05d11a90aada531930f7a033543a8c3602df0206 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentlyClosedBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentlyClosedBridge.java
@@ -14,7 +14,7 @@ import java.util.List;
/**
* This class allows Java code to get and clear the list of recently closed tabs.
*/
-class RecentlyClosedBridge {
+public class RecentlyClosedBridge {
private long mNativeRecentlyClosedTabsBridge;
/**
@@ -57,14 +57,14 @@ class RecentlyClosedBridge {
* Initializes this class with the given profile.
* @param profile The Profile whose recently closed tabs will be queried.
*/
- RecentlyClosedBridge(Profile profile) {
+ public RecentlyClosedBridge(Profile profile) {
mNativeRecentlyClosedTabsBridge = nativeInit(profile);
}
/**
* Cleans up the C++ side of this class. This instance must not be used after calling destroy().
*/
- void destroy() {
+ public void destroy() {
assert mNativeRecentlyClosedTabsBridge != 0;
nativeDestroy(mNativeRecentlyClosedTabsBridge);
mNativeRecentlyClosedTabsBridge = 0;
@@ -106,6 +106,14 @@ class RecentlyClosedBridge {
}
/**
+ * Opens the most recently closed tab. Read data from tab restore service in native code, and
Theresa 2016/07/07 19:00:12 nit: "Opens the most recently closed tab in a new
xingliu 2016/07/08 21:26:47 Done.
+ * open a new tab.
+ */
+ public void openRecentlyClosedTab() {
+ nativeOpenMostRecentlyClosedTab(mNativeRecentlyClosedTabsBridge);
+ }
+
+ /**
* Clears all recently closed tabs.
*/
void clearRecentlyClosedTabs() {
@@ -120,5 +128,6 @@ class RecentlyClosedBridge {
long nativeRecentlyClosedTabsBridge, List<RecentlyClosedTab> tabs, int maxTabCount);
private native boolean nativeOpenRecentlyClosedTab(long nativeRecentlyClosedTabsBridge,
Tab tab, int recentTabId, int windowOpenDisposition);
+ private native boolean nativeOpenMostRecentlyClosedTab(long nativeRecentlyClosedTabsBridge);
private native void nativeClearRecentlyClosedTabs(long nativeRecentlyClosedTabsBridge);
}

Powered by Google App Engine
This is Rietveld 408576698