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

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

Issue 11824050: InstantExtended: Committed NTP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 7 years, 11 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 9bc6c73a68a4ade7419f73b7feb15a5921d77bcb..186834fab9203db3fbe73ab5e6bd1c4e9179640d 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -61,8 +61,7 @@ namespace chrome {
namespace search {
SearchTabHelper::SearchTabHelper(content::WebContents* web_contents)
- : WebContentsObserver(web_contents),
- is_search_enabled_(IsSearchEnabled(ProfileFromWebContents(web_contents))),
+ : is_search_enabled_(IsSearchEnabled(ProfileFromWebContents(web_contents))),
user_input_in_progress_(false),
model_(web_contents) {
if (!is_search_enabled_)
@@ -96,19 +95,6 @@ void SearchTabHelper::NavigationEntryUpdated() {
UpdateModelBasedOnURL(web_contents()->GetURL());
}
-void SearchTabHelper::NavigateToPendingEntry(
- const GURL& url,
- content::NavigationController::ReloadType reload_type) {
- if (!is_search_enabled_)
- return;
-
- // NTP mode changes are initiated at "pending", all others are initiated
- // when "committed". This is because NTP is rendered natively so is faster
- // to render than the web contents and we need to coordinate the animations.
- if (IsNTP(url))
- UpdateModelBasedOnURL(url);
-}
-
void SearchTabHelper::Observe(
int type,
const content::NotificationSource& source,
@@ -116,10 +102,7 @@ void SearchTabHelper::Observe(
DCHECK_EQ(content::NOTIFICATION_NAV_ENTRY_COMMITTED, type);
content::LoadCommittedDetails* committed_details =
content::Details<content::LoadCommittedDetails>(details).ptr();
- // See comment in |NavigateToPendingEntry()| about why |!IsNTP()| is used.
- if (!IsNTP(committed_details->entry->GetURL())) {
- UpdateModelBasedOnURL(committed_details->entry->GetURL());
- }
+ UpdateModelBasedOnURL(committed_details->entry->GetVirtualURL());
}
void SearchTabHelper::UpdateModelBasedOnURL(const GURL& url) {

Powered by Google App Engine
This is Rietveld 408576698