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

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

Issue 2152483002: Force early creation of NTPUserDataLogger. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f807b049e863370bc342bd8d00dae714b248b503 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -257,6 +257,14 @@ void SearchTabHelper::Submit(const base::string16& text,
void SearchTabHelper::OnTabActivated() {
ipc_router_.OnTabActivated();
+ if (search::IsInstantNTP(web_contents_)) {
+ // Force creation of NTPUserDataLogger, if we loaded an NTP. The
+ // NTPUserDataLogger tries to detect whether the NTP is being created at
+ // startup or from the user opening a new tab, and if we wait until later,
+ // it won't correctly detect this case.
+ NTPUserDataLogger::GetOrCreateFromWebContents(web_contents_);
+ }
+
OmniboxView* omnibox_view = GetOmniboxView();
if (search::ShouldPrerenderInstantUrlOnOmniboxFocus() &&
omnibox_has_focus_fn_(omnibox_view)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698