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

Side by Side Diff: content/public/android/java/src/org/chromium/content_public/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
1 // Copyright 2012 The Chromium Authors. All rights reserved. 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 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.content.browser; 5 package org.chromium.content_public.browser;
6
7 //import org.chromium.content_public.browser.NavigationEntry;
6 8
7 import java.util.ArrayList; 9 import java.util.ArrayList;
8 10
9 /** 11 /**
10 * {@link NavigationHistory} captures a snapshot of the navigation history of a 12 * {@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 13 * {@link ContentViewCore}. It is a copy and will not be updated as navigation
12 * occurs on the source {@link ContentViewCore}. 14 * occurs on the source {@link ContentViewCore}.
13 */ 15 */
14 public class NavigationHistory { 16 public class NavigationHistory {
15 17
16 private final ArrayList<NavigationEntry> mEntries = new ArrayList<Navigation Entry>(); 18 private final ArrayList<NavigationEntry> mEntries = new ArrayList<Navigation Entry>();
17 private int mCurrentEntryIndex; 19 private int mCurrentEntryIndex;
18 20
19 protected void addEntry(NavigationEntry entry) { 21 public void addEntry(NavigationEntry entry) {
20 mEntries.add(entry); 22 mEntries.add(entry);
21 } 23 }
22 24
23 /* package */ void setCurrentEntryIndex(int currentEntryIndex) { 25 public void setCurrentEntryIndex(int currentEntryIndex) {
24 mCurrentEntryIndex = currentEntryIndex; 26 mCurrentEntryIndex = currentEntryIndex;
25 } 27 }
26 28
27 /** 29 /**
28 * @return The number of entries in the history. 30 * @return The number of entries in the history.
29 */ 31 */
30 public int getEntryCount() { 32 public int getEntryCount() {
31 return mEntries.size(); 33 return mEntries.size();
32 } 34 }
33 35
34 /** 36 /**
35 * Returns the {@link NavigationEntry} for the given index. 37 * Returns the {@link NavigationEntry} for the given index.
36 */ 38 */
37 public NavigationEntry getEntryAtIndex(int index) { 39 public NavigationEntry getEntryAtIndex(int index) {
38 return mEntries.get(index); 40 return mEntries.get(index);
39 } 41 }
40 42
41 /** 43 /**
42 * Returns the index of the entry the {@link ContentViewCore} was navigated to 44 * Returns the index of the entry the {@link ContentViewCore} was navigated to
43 * when the history was fetched. 45 * when the history was fetched.
44 */ 46 */
45 public int getCurrentEntryIndex() { 47 public int getCurrentEntryIndex() {
46 return mCurrentEntryIndex; 48 return mCurrentEntryIndex;
47 } 49 }
48 50
49 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698