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

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

Issue 2232863002: Remove search::GetSearchTerms since it always returns empty string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_query_extract
Patch Set: Android Created 4 years, 4 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 d962d6296e3249686cef37ada18411f9f99b49b3..61106b03ae1501e3c91e628ef831fdcfd9d4f1fc 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -74,10 +74,6 @@ bool IsNTP(const content::WebContents* contents) {
return search::IsInstantNTP(contents);
}
-bool IsSearchResults(const content::WebContents* contents) {
- return !search::GetSearchTerms(contents).empty();
-}
-
bool IsLocal(const content::WebContents* contents) {
if (!contents)
return false;
@@ -297,16 +293,12 @@ void SearchTabHelper::NavigationEntryCommitted(
// support for the navigated page. So, copy over the Instant support from
// the previous entry. If the page does not support Instant, update the
// location bar from here to turn off search terms replacement.
- search::SetInstantSupportStateInNavigationEntry(model_.instant_support(),
- entry);
if (delegate_ && model_.instant_support() == INSTANT_SUPPORT_NO)
delegate_->OnWebContentsInstantSupportDisabled(web_contents_);
return;
}
model_.SetInstantSupportState(INSTANT_SUPPORT_UNKNOWN);
- search::SetInstantSupportStateInNavigationEntry(model_.instant_support(),
- entry);
if (InInstantProcess(profile(), web_contents_))
ipc_router_.OnNavigationEntryCommitted();
@@ -461,12 +453,9 @@ void SearchTabHelper::InstantSupportChanged(bool instant_support) {
model_.SetInstantSupportState(new_state);
- content::NavigationEntry* entry =
- web_contents_->GetController().GetLastCommittedEntry();
- if (entry) {
- search::SetInstantSupportStateInNavigationEntry(new_state, entry);
- if (delegate_ && !instant_support)
- delegate_->OnWebContentsInstantSupportDisabled(web_contents_);
+ if (web_contents_->GetController().GetLastCommittedEntry() && delegate_ &&
+ !instant_support) {
+ delegate_->OnWebContentsInstantSupportDisabled(web_contents_);
}
}
@@ -476,9 +465,6 @@ void SearchTabHelper::UpdateMode(bool update_origin) {
if (IsNTP(web_contents_)) {
type = SearchMode::MODE_NTP;
origin = SearchMode::ORIGIN_NTP;
- } else if (IsSearchResults(web_contents_)) {
- type = SearchMode::MODE_SEARCH_RESULTS;
- origin = SearchMode::ORIGIN_SEARCH;
}
if (!update_origin)
origin = model_.mode().origin;
« no previous file with comments | « chrome/browser/ui/search/instant_controller.cc ('k') | chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698