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

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

Issue 2852693002: Remove DetermineIfPageSupportsInstant and all its plumbing (Closed)
Patch Set: rebase Created 3 years, 8 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 1037cb53896c88ebb25647f967c9aedefb386afb..d511a1806c016e4f4e3ea2d46e096d47d7872178 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -74,14 +74,6 @@ bool IsNTP(const content::WebContents* contents) {
return search::IsInstantNTP(contents);
}
-bool IsLocal(const content::WebContents* contents) {
- if (!contents)
- return false;
- const content::NavigationEntry* entry =
- contents->GetController().GetVisibleEntry();
- return entry && entry->GetURL() == chrome::kChromeSearchLocalNtpUrl;
-}
-
// Returns true if |contents| are rendered inside an Instant process.
bool InInstantProcess(Profile* profile,
const content::WebContents* contents) {
@@ -299,7 +291,7 @@ void SearchTabHelper::DidFinishLoad(content::RenderFrameHost* render_frame_host,
if (search::IsInstantNTP(web_contents_))
RecordNewTabLoadTime(web_contents_);
- DetermineIfPageSupportsInstant();
+ InstantSupportChanged(InInstantProcess(profile(), web_contents_));
}
}
@@ -499,21 +491,6 @@ void SearchTabHelper::UpdateMode(bool update_origin) {
}
}
-void SearchTabHelper::DetermineIfPageSupportsInstant() {
- if (!InInstantProcess(profile(), web_contents_)) {
- // The page is not in the Instant process. This page does not support
- // instant. If we send an IPC message to a page that is not in the Instant
- // process, it will never receive it and will never respond. Therefore,
- // return immediately.
- InstantSupportChanged(false);
- } else if (IsLocal(web_contents_)) {
- // Local pages always support Instant.
- InstantSupportChanged(true);
- } else {
- ipc_router_.DetermineIfPageSupportsInstant();
- }
-}
-
const OmniboxView* SearchTabHelper::GetOmniboxView() const {
#if defined(OS_ANDROID)
return nullptr;
« no previous file with comments | « chrome/browser/ui/search/search_tab_helper.h ('k') | chrome/browser/ui/search/search_tab_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698