Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
| diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
| index 7a4c05e963061f7c0e5e18756dbdf72d558d39f8..c7b8fd0d12771bd73828459267f39592aabc4bf9 100644 |
| --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
| +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
| @@ -889,6 +889,10 @@ public class ContentViewCore implements MotionEventDelegate { |
| if (mNativeContentViewCore != 0) nativeGoToOffset(mNativeContentViewCore, offset); |
| } |
| + public void goToNavigationIndex(int index) { |
|
David Trainor- moved to gerrit
2013/01/03 18:57:31
javadoc!? What happens if index is out of bounds?
Ted C
2013/01/03 19:56:41
It's behavior for out of bounds is determined by t
David Trainor- moved to gerrit
2013/01/04 18:11:11
Fair enough!
On 2013/01/03 19:56:41, Ted C wrote:
|
| + if (mNativeContentViewCore != 0) nativeGoToNavigationIndex(mNativeContentViewCore, index); |
| + } |
| + |
| /** |
| * Goes to the navigation entry before the current one. |
| */ |
| @@ -2354,9 +2358,10 @@ public class ContentViewCore implements MotionEventDelegate { |
| * Callback factory method for nativeGetNavigationHistory(). |
| */ |
| @CalledByNative |
| - private void addToNavigationHistory(Object history, String url, String virtualUrl, |
| + private void addToNavigationHistory(Object history, int index, String url, String virtualUrl, |
| String originalUrl, String title, Bitmap favicon) { |
| - NavigationEntry entry = new NavigationEntry(url, virtualUrl, originalUrl, title, favicon); |
| + NavigationEntry entry = new NavigationEntry( |
| + index, url, virtualUrl, originalUrl, title, favicon); |
| ((NavigationHistory) history).addEntry(entry); |
| } |
| @@ -2371,6 +2376,18 @@ public class ContentViewCore implements MotionEventDelegate { |
| } |
| /** |
| + * Get a directed copy of the navigation history of the view. |
| + * @param isForward Whether the returned history should be entries after the current entry. |
| + * @param itemLimit The limit on the number of items included in the history. |
| + * @return A directed navigation for the page. |
| + */ |
| + public NavigationHistory getDirectedNavigationHistory(boolean isForward, int itemLimit) { |
| + NavigationHistory history = new NavigationHistory(); |
| + nativeGetDirectedNavigationHistory(mNativeContentViewCore, history, isForward, itemLimit); |
| + return history; |
| + } |
| + |
| + /** |
| * Update of the latest vsync parameters. |
| * @param tickTimeMicros The latest vsync tick time in microseconds. |
| * @param intervalMicros The vsync interval in microseconds. |
| @@ -2467,16 +2484,12 @@ public class ContentViewCore implements MotionEventDelegate { |
| int nativeContentViewCoreImpl, int x1, int y1, int x2, int y2); |
| private native boolean nativeCanGoBack(int nativeContentViewCoreImpl); |
| - |
| private native boolean nativeCanGoForward(int nativeContentViewCoreImpl); |
| - |
| private native boolean nativeCanGoToOffset(int nativeContentViewCoreImpl, int offset); |
| - |
| - private native void nativeGoToOffset(int nativeContentViewCoreImpl, int offset); |
| - |
| private native void nativeGoBack(int nativeContentViewCoreImpl); |
| - |
| private native void nativeGoForward(int nativeContentViewCoreImpl); |
| + private native void nativeGoToOffset(int nativeContentViewCoreImpl, int offset); |
| + private native void nativeGoToNavigationIndex(int nativeContentViewCoreImpl, int index); |
| private native void nativeStopLoading(int nativeContentViewCoreImpl); |
| @@ -2519,6 +2532,8 @@ public class ContentViewCore implements MotionEventDelegate { |
| private native void nativeRemoveJavascriptInterface(int nativeContentViewCoreImpl, String name); |
| private native int nativeGetNavigationHistory(int nativeContentViewCoreImpl, Object context); |
| + private native void nativeGetDirectedNavigationHistory(int nativeContentViewCoreImpl, |
| + Object context, boolean isForward, int maxEntries); |
| private native void nativeUpdateVSyncParameters(int nativeContentViewCoreImpl, |
| long timebaseMicros, long intervalMicros); |