diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-14 15:42:43 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-14 15:42:43 +0000 |
commit | e9ba44740c88677d8b566583f7041d1dd33b6a9d (patch) | |
tree | 0d85125a089ba6c36136a22651d196a9ba86ec8f /chrome/browser/dom_ui | |
parent | b5ef2ca48635ddf96698a11676a4625aff6ef734 (diff) | |
download | chromium_src-e9ba44740c88677d8b566583f7041d1dd33b6a9d.zip chromium_src-e9ba44740c88677d8b566583f7041d1dd33b6a9d.tar.gz chromium_src-e9ba44740c88677d8b566583f7041d1dd33b6a9d.tar.bz2 |
This is almost a complete rewrite of DidNavigate and the associated NavigationController logic. The approach is that the NavigationController should be responsible for the logic and memory management of navigation. Previously, half the logic and memory management lived in WebContents which made it very hard to figure out what was going on.
I split out the various navigation types into separate functions, which then copy and update any existing NavigationEntry as necessary. Previously, WebContents would make a new one which would be manually populated with random fields (I think some were forgotten, too), and then the NavigationController may or may not commit it.
Review URL: http://codereview.chromium.org/479
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2201 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r-- | chrome/browser/dom_ui/new_tab_ui.cc | 12 | ||||
-rw-r--r-- | chrome/browser/dom_ui/new_tab_ui.h | 2 |
2 files changed, 4 insertions, 10 deletions
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index b5cdf52..3d0cdf1 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -797,15 +797,9 @@ void NewTabUIContents::AttachMessageHandlers() { } } -bool NewTabUIContents::Navigate(const NavigationEntry& entry, bool reload) { - const bool result = WebContents::Navigate(entry, reload); - - // Force the title to say 'New tab', even when loading. The supplied entry is - // also the pending entry. - NavigationEntry* pending_entry = controller()->GetPendingEntry(); - DCHECK(pending_entry && pending_entry == &entry); - pending_entry->set_title(forced_title_); - +bool NewTabUIContents::NavigateToPendingEntry(bool reload) { + const bool result = WebContents::NavigateToPendingEntry(reload); + controller()->GetPendingEntry()->set_title(forced_title_); return result; } diff --git a/chrome/browser/dom_ui/new_tab_ui.h b/chrome/browser/dom_ui/new_tab_ui.h index 3584954..092cdb4 100644 --- a/chrome/browser/dom_ui/new_tab_ui.h +++ b/chrome/browser/dom_ui/new_tab_ui.h @@ -290,7 +290,7 @@ class NewTabUIContents : public DOMUIHost { // WebContents overrides. // Overriden to force the title of the page to forced_title_. - virtual bool Navigate(const NavigationEntry& entry, bool reload); + virtual bool NavigateToPendingEntry(bool reload); // We don't want a favicon on the new tab page. virtual bool ShouldDisplayFavIcon() { return false; } // The bookmark bar is always visible on the new tab. |