Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Unified Diff: chrome/browser/ui/search/search_tab_helper.cc

Issue 2086423005: Using WebContents::UpdateTitleForEntry() instead of NavigationEntry::SetTitle() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improving comment and removing the NOTREACHED. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/search/search_tab_helper.cc
diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc
index 3ff3225effe808b617a10aaabdf5f0f290800216..cda38cc8194d9087e472082bc50e4d8a6ff6c862 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -291,8 +291,10 @@ void SearchTabHelper::DidStartNavigationToPendingEntry(
// prevents any flickering of the tab title.
content::NavigationEntry* entry =
web_contents_->GetController().GetPendingEntry();
- if (entry)
- entry->SetTitle(l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
+ if (entry) {
+ web_contents_->UpdateTitleForEntry(
+ entry, l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
+ }
}
}
@@ -320,7 +322,8 @@ void SearchTabHelper::DidNavigateMainFrame(
if (entry && entry->GetTitle().empty() &&
(entry->GetVirtualURL() == GURL(chrome::kChromeUINewTabURL) ||
search::NavEntryIsInstantNTP(web_contents_, entry))) {
- entry->SetTitle(l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
+ web_contents_->UpdateTitleForEntry(
+ entry, l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
}
}

Powered by Google App Engine
This is Rietveld 408576698