summaryrefslogtreecommitdiffstats
path: root/chrome/browser/navigation_controller.h
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-24 21:21:48 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-24 21:21:48 +0000
commit0e8db94aef1b57355c3d154cb4682ce2f94c51eb (patch)
treea6290715d64cf7da39ce82005d3f6121a40ee85e /chrome/browser/navigation_controller.h
parent14e81bfe528c0d79ba82a9326a7071a1daa101ed (diff)
downloadchromium_src-0e8db94aef1b57355c3d154cb4682ce2f94c51eb.zip
chromium_src-0e8db94aef1b57355c3d154cb4682ce2f94c51eb.tar.gz
chromium_src-0e8db94aef1b57355c3d154cb4682ce2f94c51eb.tar.bz2
Remove DidNavigate from the tab contents delegate and all the related plumbing.
I added additional information to the regular load commit notification so all interested parties can listen for that instead. I removed the old navigation type enum, and replaced it with the enum from the NavigationController, so it's now public. Review URL: http://codereview.chromium.org/3112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2573 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/navigation_controller.h')
-rw-r--r--chrome/browser/navigation_controller.h61
1 files changed, 11 insertions, 50 deletions
diff --git a/chrome/browser/navigation_controller.h b/chrome/browser/navigation_controller.h
index 7d99876..1cb39aa 100644
--- a/chrome/browser/navigation_controller.h
+++ b/chrome/browser/navigation_controller.h
@@ -13,6 +13,7 @@
#include "chrome/browser/site_instance.h"
#include "chrome/browser/ssl_manager.h"
#include "chrome/browser/tab_contents_type.h"
+#include "chrome/common/navigation_types.h"
class GURL;
class Profile;
@@ -57,6 +58,15 @@ class NavigationController {
// The committed entry. This will be the active entry in the controller.
NavigationEntry* entry;
+ // The type of navigation that just occurred. Note that not all types of
+ // navigations in the enum are valid here, since some of them don't actually
+ // cause a "commit" and won't generate this notification.
+ NavigationType::Type type;
+
+ // The index of the previously committed navigation entry. This will be -1
+ // if there are no previous entries.
+ int previous_entry_index;
+
// The previous URL that the user was on. This may be empty if none.
GURL previous_url;
@@ -369,52 +379,8 @@ class NavigationController {
friend class RestoreHelper;
friend class TabContents; // For invoking OnReservedPageIDRange.
- // Indicates different types of navigations that can occur that we will handle
- // separately. This is computed by ClassifyNavigation.
- enum NavClass {
- // A new page was navigated in the main frame.
- NAV_NEW_PAGE,
-
- // Renavigating to an existing navigation entry. The entry is guaranteed to
- // exist in the list, or else it would be a new page or IGNORE navigation.
- NAV_EXISTING_PAGE,
-
- // The same page has been reloaded as a result of the user requesting
- // navigation to that same page (like pressing Enter in the URL bar). This
- // is not the same as an in-page navigation because we'll actually have a
- // pending entry for the load, which is then meaningless.
- NAV_SAME_PAGE,
-
- // In page navigations are when the reference fragment changes. This will
- // be in the main frame only (we won't even get notified of in-page
- // subframe navigations). It may be for any page, not necessarily the last
- // committed one (for example, whey going back to a page with a ref).
- NAV_IN_PAGE,
-
- // A new subframe was manually navigated by the user. We will create a new
- // NavigationEntry so they can go back to the previous subframe content
- // using the back button.
- NAV_NEW_SUBFRAME,
-
- // A subframe in the page was automatically loaded or navigated to such that
- // a new navigation entry should not be created. There are two cases:
- // 1. Stuff like iframes containing ads that the page loads automatically.
- // The user doesn't want to see these, so we just update the existing
- // navigation entry.
- // 2. Going back/forward to previous subframe navigations. We don't create
- // a new entry here either, just update the last committed entry.
- // These two cases are actually pretty different, they just happen to
- // require almost the same code to handle.
- NAV_AUTO_SUBFRAME,
-
- // Nothing happened. This happens when we get information about a page we
- // don't know anything about. It can also happen when an iframe in a popup
- // navigated to about:blank is navigated. Nothing needs to be done.
- NAV_IGNORE,
- };
-
// Classifies the given renderer navigation (see the NavigationType enum).
- NavClass ClassifyNavigation(
+ NavigationType::Type ClassifyNavigation(
const ViewHostMsg_FrameNavigate_Params& params) const;
// Causes the controller to load the specified entry. The function assumes
@@ -450,11 +416,6 @@ class NavigationController {
// committed. This will fill in the active entry to the details structure.
void NotifyNavigationEntryCommitted(LoadCommittedDetails* details);
- // Invoked when the index of the active entry may have changed.
- // The prev_commited_index parameter specifies the previous value
- // of the last commited index before this navigation event happened
- void IndexOfActiveEntryChanged(int prev_commited_index);
-
// Returns the TabContents for the |entry|'s type. If the TabContents
// doesn't yet exist, it is created. If a new TabContents is created, its
// parent is |parent|. Becomes part of |entry|'s SiteInstance.