diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-04 21:32:40 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-04 21:32:40 +0000 |
commit | 965524b257d99bbc4c10e82a1294ed1f91516e2c (patch) | |
tree | e23e34f5a12b995a10b94b726f36a59dc32393f8 /chrome/browser/tab_contents/navigation_controller.h | |
parent | 2b4355c4590724ae676f0ec5a8230e5c8c4cddf9 (diff) | |
download | chromium_src-965524b257d99bbc4c10e82a1294ed1f91516e2c.zip chromium_src-965524b257d99bbc4c10e82a1294ed1f91516e2c.tar.gz chromium_src-965524b257d99bbc4c10e82a1294ed1f91516e2c.tar.bz2 |
Remove some uses of custom tab contents types from some tests.
This required redoing the tests that used it to use the new RenderViewHost
test harness. This is mostly straightforward, but required more work for the
NavigationController tests.
I removed a few random places that were testing for the tab types. I also
made different versions of a few functions that don't take tab contents types
next to the existing ones that do, so my touched code won't have to be changed
again when I remove the tab contents types.
Review URL: http://codereview.chromium.org/62039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13132 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/navigation_controller.h')
-rw-r--r-- | chrome/browser/tab_contents/navigation_controller.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/chrome/browser/tab_contents/navigation_controller.h b/chrome/browser/tab_contents/navigation_controller.h index 41502d6..2d1364f 100644 --- a/chrome/browser/tab_contents/navigation_controller.h +++ b/chrome/browser/tab_contents/navigation_controller.h @@ -21,6 +21,7 @@ class NavigationEntry; class GURL; class Profile; +class RenderViewHostFactory; class TabContents; class SiteInstance; class SkBitmap; @@ -128,11 +129,13 @@ class NavigationController { // Creates a NavigationController from the specified history. Processing // for this is asynchronous and handled via the RestoreHelper (in - // navigation_controller.cc). + // navigation_controller.cc). The RenderViewHostFactory will be passed to + // new TabContentses, it is non-NULL only for testing. NavigationController( Profile* profile, const std::vector<TabNavigation>& navigations, - int selected_navigation); + int selected_navigation, + RenderViewHostFactory* rvh_factory); ~NavigationController(); // Begin the destruction sequence for this NavigationController and all its @@ -310,10 +313,20 @@ class NavigationController { // Returns the currently-active TabContents associated with this controller. // You should use GetActiveEntry instead of this in most cases. + // + // TODO(brettw) this should be removed in preference to tab_contents(). TabContents* active_contents() const { return active_contents_; } + // Returns the tab contents associated with this controller. Non-NULL except + // during set-up of the tab. + TabContents* tab_contents() const { + // This currently returns the active tab contents which should be renamed to + // tab_contents. + return active_contents_; + } + // For use by TabContents ---------------------------------------------------- // Handles updating the navigation state after the renderer has navigated. @@ -481,6 +494,10 @@ class NavigationController { // The user profile associated with this controller Profile* profile_; + // Non-owning pointer to the factory to pass to new TabContentes. This will be + // NULL except in testing, where it is used to create mock RVH's. + RenderViewHostFactory* rvh_factory_; + // List of NavigationEntry for this tab typedef std::vector<linked_ptr<NavigationEntry> > NavigationEntries; NavigationEntries entries_; @@ -520,6 +537,8 @@ class NavigationController { TabContentsCollectorMap tab_contents_collector_map_; // The tab contents that is currently active. + // TODO(brettw) this should be renamed to tab_contents_ and comments clarified + // that it never changes. TabContents* active_contents_; // The max restored page ID in this controller, if it was restored. We must |