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

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: fixes based on review feedback. Created 4 years, 6 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..a75668e2c4c9c007bdc062f890b550df79a2a68d 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;
/**
@@ -45,6 +45,13 @@ class RecentlyClosedBridge {
this.url = url;
}
}
+ /**
+ * Opens the most recently closed tab. Read data from tab restore service in native code, and
Theresa 2016/06/30 20:50:24 nit: move this down by the other openRecentlyClose
xingliu 2016/07/01 00:30:38 Done.
+ * open a new tab.
+ */
+ public void openRecentlyClosedTab() {
+ nativeOpenMostRecentlyClosedTab(mNativeRecentlyClosedTabsBridge);
+ }
@CalledByNative
private static void pushTab(
@@ -57,14 +64,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;
@@ -120,5 +127,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