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

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

Issue 78443005: New Tab: fix tab title flickering. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Try again. Created 7 years, 1 month 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 5c72d74486fad8987f07a02a0b398769df274c4a..3774b945087c312bd83b4f6c907b0338c0cfa45c 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -221,6 +221,19 @@ void SearchTabHelper::RenderViewCreated(
ipc_router_.SetPromoInformation(IsAppLauncherEnabled());
}
+void SearchTabHelper::DidStartNavigationToPendingEntry(
+ const GURL& url,
+ content::NavigationController::ReloadType /* reload_type */) {
+ // Set the title on any pending entry corresponding to the NTP. This prevents
+ // any flickering of the tab title.
Charlie Reis 2013/11/25 18:17:47 nit: Please move the comment inside the if.
samarth 2013/11/25 18:40:51 Done.
+ if (chrome::IsNTPURL(url, profile())) {
+ content::NavigationEntry* entry =
+ web_contents_->GetController().GetVisibleEntry();
Charlie Reis 2013/11/25 18:17:47 Please use GetPendingEntry instead of GetVisibleEn
samarth 2013/11/25 18:40:51 Done.
+ if (entry)
+ entry->SetTitle(l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
+ }
+}
+
void SearchTabHelper::DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) {

Powered by Google App Engine
This is Rietveld 408576698