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

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

Issue 406023002: Restructuring NavigationController functionalities from ContentViewCore to NavigationController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased the patch with findbugs_known_bugs.txt changes. Created 6 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.content.browser;
6
7 import java.util.ArrayList;
8
9 /**
10 * {@link NavigationHistory} captures a snapshot of the navigation history of a
11 * {@link ContentViewCore}. It is a copy and will not be updated as navigation
12 * occurs on the source {@link ContentViewCore}.
13 */
14 public class NavigationHistory {
15
16 private final ArrayList<NavigationEntry> mEntries = new ArrayList<Navigation Entry>();
17 private int mCurrentEntryIndex;
18
19 protected void addEntry(NavigationEntry entry) {
20 mEntries.add(entry);
21 }
22
23 /* package */ void setCurrentEntryIndex(int currentEntryIndex) {
24 mCurrentEntryIndex = currentEntryIndex;
25 }
26
27 /**
28 * @return The number of entries in the history.
29 */
30 public int getEntryCount() {
31 return mEntries.size();
32 }
33
34 /**
35 * Returns the {@link NavigationEntry} for the given index.
36 */
37 public NavigationEntry getEntryAtIndex(int index) {
38 return mEntries.get(index);
39 }
40
41 /**
42 * Returns the index of the entry the {@link ContentViewCore} was navigated to
43 * when the history was fetched.
44 */
45 public int getCurrentEntryIndex() {
46 return mCurrentEntryIndex;
47 }
48
49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698