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

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: Fix compile error 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 2ba04505a85de5bc8d11a6e6b0628dafb7a04f54..23b0fbb6733d3e97f804293ffe0e9e0d9e8eb37b 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