OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import org.chromium.base.CalledByNative; | 7 import org.chromium.base.CalledByNative; |
8 import org.chromium.chrome.browser.profiles.Profile; | 8 import org.chromium.chrome.browser.profiles.Profile; |
9 | 9 |
10 import java.util.ArrayList; | 10 import java.util.ArrayList; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 public List<RecentlyClosedTab> getRecentlyClosedTabs(int maxTabCount) { | 90 public List<RecentlyClosedTab> getRecentlyClosedTabs(int maxTabCount) { |
91 List<RecentlyClosedTab> tabs = new ArrayList<RecentlyClosedTab>(); | 91 List<RecentlyClosedTab> tabs = new ArrayList<RecentlyClosedTab>(); |
92 boolean received = nativeGetRecentlyClosedTabs(mNativeRecentlyClosedTabs
Bridge, tabs, | 92 boolean received = nativeGetRecentlyClosedTabs(mNativeRecentlyClosedTabs
Bridge, tabs, |
93 maxTabCount); | 93 maxTabCount); |
94 return received ? tabs : null; | 94 return received ? tabs : null; |
95 } | 95 } |
96 | 96 |
97 /** | 97 /** |
98 * Opens a recently closed tab in the current tab. | 98 * Opens a recently closed tab in the current tab. |
99 * | 99 * |
100 * @param tab The current TabBase. | 100 * @param tab The current Tab. |
101 * @param recentTab The RecentlyClosedTab to open. | 101 * @param recentTab The RecentlyClosedTab to open. |
102 * @return Whether the tab was successfully opened. | 102 * @return Whether the tab was successfully opened. |
103 */ | 103 */ |
104 public boolean openRecentlyClosedTab(TabBase tab, RecentlyClosedTab recentTa
b) { | 104 public boolean openRecentlyClosedTab(Tab tab, RecentlyClosedTab recentTab) { |
105 return nativeOpenRecentlyClosedTab(mNativeRecentlyClosedTabsBridge, tab,
recentTab.id); | 105 return nativeOpenRecentlyClosedTab(mNativeRecentlyClosedTabsBridge, tab,
recentTab.id); |
106 } | 106 } |
107 | 107 |
108 /** | 108 /** |
109 * Clears all recently closed tabs. | 109 * Clears all recently closed tabs. |
110 */ | 110 */ |
111 public void clearRecentlyClosedTabs() { | 111 public void clearRecentlyClosedTabs() { |
112 nativeClearRecentlyClosedTabs(mNativeRecentlyClosedTabsBridge); | 112 nativeClearRecentlyClosedTabs(mNativeRecentlyClosedTabsBridge); |
113 } | 113 } |
114 | 114 |
115 private native long nativeInit(Profile profile); | 115 private native long nativeInit(Profile profile); |
116 private native void nativeDestroy(long nativeRecentlyClosedTabsBridge); | 116 private native void nativeDestroy(long nativeRecentlyClosedTabsBridge); |
117 private native void nativeSetRecentlyClosedCallback( | 117 private native void nativeSetRecentlyClosedCallback( |
118 long nativeRecentlyClosedTabsBridge, RecentlyClosedCallback callback
); | 118 long nativeRecentlyClosedTabsBridge, RecentlyClosedCallback callback
); |
119 private native boolean nativeGetRecentlyClosedTabs( | 119 private native boolean nativeGetRecentlyClosedTabs( |
120 long nativeRecentlyClosedTabsBridge, List<RecentlyClosedTab> tabs, i
nt maxTabCount); | 120 long nativeRecentlyClosedTabsBridge, List<RecentlyClosedTab> tabs, i
nt maxTabCount); |
121 private native boolean nativeOpenRecentlyClosedTab( | 121 private native boolean nativeOpenRecentlyClosedTab( |
122 long nativeRecentlyClosedTabsBridge, TabBase tab, int recentTabId); | 122 long nativeRecentlyClosedTabsBridge, Tab tab, int recentTabId); |
123 private native void nativeClearRecentlyClosedTabs(long nativeRecentlyClosedT
absBridge); | 123 private native void nativeClearRecentlyClosedTabs(long nativeRecentlyClosedT
absBridge); |
124 } | 124 } |
OLD | NEW |