summaryrefslogtreecommitdiffstats
path: root/chrome/browser/navigation_controller.h
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-17 16:28:49 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-17 16:28:49 +0000
commitc12bf1a1aa1a24d7f516b7e76428518c594d7da5 (patch)
treea8417e738ef3f6017f93972cba7eea0ca8a2f8e3 /chrome/browser/navigation_controller.h
parent5753fae33db5da0f5ca75490ea0eff8c91084392 (diff)
downloadchromium_src-c12bf1a1aa1a24d7f516b7e76428518c594d7da5.zip
chromium_src-c12bf1a1aa1a24d7f516b7e76428518c594d7da5.tar.gz
chromium_src-c12bf1a1aa1a24d7f516b7e76428518c594d7da5.tar.bz2
Wires up session restore so that it correctly deals with the
navigation controller removing entries from the front of its list. BUG=1324021 TEST=covered by unit tests, but make sure you don't see problems with session restore. Review URL: http://codereview.chromium.org/2906 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2310 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/navigation_controller.h')
-rw-r--r--chrome/browser/navigation_controller.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/chrome/browser/navigation_controller.h b/chrome/browser/navigation_controller.h
index 3380732f..f0e6096 100644
--- a/chrome/browser/navigation_controller.h
+++ b/chrome/browser/navigation_controller.h
@@ -81,6 +81,16 @@ class NavigationController {
}
};
+ // Details sent for NOTIFY_NAV_LIST_PRUNED.
+ struct PrunedDetails {
+ // If true, count items were removed from the front of the list, otherwise
+ // count items were removed from the back of the list.
+ bool from_front;
+
+ // Number of items removed.
+ int count;
+ };
+
// ---------------------------------------------------------------------------
NavigationController(TabContents* initial_contents, Profile* profile);
@@ -331,8 +341,13 @@ class NavigationController {
// testing.
static void DisablePromptOnRepost();
+ // Maximum number of entries before we start removing entries from the front.
+ static void set_max_entry_count(size_t max_entry_count) {
+ max_entry_count_ = max_entry_count;
+ }
+ static size_t max_entry_count() { return max_entry_count_; }
+
private:
- FRIEND_TEST(NavigationControllerTest, EnforceMaxNavigationCount);
class RestoreHelper;
friend class RestoreHelper;
friend class TabContents; // For invoking OnReservedPageIDRange.
@@ -535,7 +550,7 @@ class NavigationController {
static bool check_for_repost_;
// The maximum number of entries that a navigation controller can store.
- size_t max_entry_count_;
+ static size_t max_entry_count_;
DISALLOW_COPY_AND_ASSIGN(NavigationController);
};