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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/NavigationHistory.java

Issue 10836155: Upstream ContentView.getNavigationHistory() (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address tedchoc's review comments. Created 8 years, 4 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
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/NavigationEntry.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/NavigationHistory.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/NavigationHistory.java b/content/public/android/java/src/org/chromium/content/browser/NavigationHistory.java
new file mode 100644
index 0000000000000000000000000000000000000000..ff1fcf9659e91fac0535fe53929e702e050ae3f3
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/NavigationHistory.java
@@ -0,0 +1,49 @@
+// Copyright (c) 2012 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.content.browser;
+
+import java.util.ArrayList;
+
+/**
+ * {@link NavigationHistory} captures a snapshot of the navigation history of a
+ * {@link ContentView}. It is a copy and will not be updated as navigation
+ * occurs on the source {@link ContentView}.
+ */
+public class NavigationHistory {
+
+ private ArrayList<NavigationEntry> entries = new ArrayList<NavigationEntry>();
+ private int mCurrentEntryIndex;
+
+ /* package */ void addEntry(NavigationEntry entry) {
+ entries.add(entry);
+ }
+
+ /* package */ void setCurrentEntryIndex(int currentEntryIndex) {
+ mCurrentEntryIndex = currentEntryIndex;
+ }
+
+ /**
+ * @return The number of entries in the history.
+ */
+ public int getEntryCount() {
+ return entries.size();
+ }
+
+ /**
+ * Returns the {@link NavigationEntry} for the given index.
+ */
+ public NavigationEntry getEntryAtIndex(int index) {
+ return entries.get(index);
+ }
+
+ /**
+ * Returns the index of the entry the {@link ContentView} was navigated to
+ * when the history was fetched.
+ */
+ public int getCurrentEntryIndex() {
+ return mCurrentEntryIndex;
+ }
+
+}
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/NavigationEntry.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698