diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-06 00:23:55 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-06 00:23:55 +0000 |
commit | 4c6092c5b185ac77c5751947f3ec335bc3db68f2 (patch) | |
tree | 9be7c9ec494b04318acc39dad19c64493dbb2a7b /chrome | |
parent | 5665769ecaa9305433d8582aa26fb44f0ab0146f (diff) | |
download | chromium_src-4c6092c5b185ac77c5751947f3ec335bc3db68f2.zip chromium_src-4c6092c5b185ac77c5751947f3ec335bc3db68f2.tar.gz chromium_src-4c6092c5b185ac77c5751947f3ec335bc3db68f2.tar.bz2 |
When navigating to a page triggering an interstitial from the NTP, the title would still be the NTP's one.
http://crbug.com/11998
TEST=See bug.
Review URL: http://codereview.chromium.org/119262
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17806 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index dcbfcef..754c9e9 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -431,11 +431,17 @@ const GURL& TabContents::GetURL() const { } const string16& TabContents::GetTitle() const { + // Transient entries take precedence. They are used for interstitial pages + // that are shown on top of existing pages. + NavigationEntry* entry = controller_.GetTransientEntry(); + if (entry) + return entry->GetTitleForDisplay(&controller_); + DOMUI* our_dom_ui = render_manager_.pending_dom_ui() ? render_manager_.pending_dom_ui() : render_manager_.dom_ui(); if (our_dom_ui) { // Don't override the title in view source mode. - NavigationEntry* entry = controller_.GetActiveEntry(); + entry = controller_.GetActiveEntry(); if (!(entry && entry->IsViewSourceMode())) { // Give the DOM UI the chance to override our title. const string16& title = our_dom_ui->overridden_title(); @@ -448,12 +454,6 @@ const string16& TabContents::GetTitle() const { // navigation entry. For example, when the user types in a URL, we want to // keep the old page's title until the new load has committed and we get a new // title. - // The exception is with transient pages, for which we really want to use - // their title, as they are not committed. - NavigationEntry* entry = controller_.GetTransientEntry(); - if (entry) - return entry->GetTitleForDisplay(&controller_); - entry = controller_.GetLastCommittedEntry(); if (entry) return entry->GetTitleForDisplay(&controller_); |