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

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

Issue 410533002: Merge 278958 "Discard ChromeViewHostMsg_SearchBox* IPCs if they ..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1985/src
Patch Set: Created 6 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 | « chrome/browser/search/search.h ('k') | chrome/browser/ui/search/search_ipc_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/search.cc
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
index 409d14b4d863e5bd67b941dfe1fba5da5d3db6ba..1ba630cd60771a97270bedb3070c1f5f76b9c9e9 100644
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -191,22 +191,7 @@ bool MatchesAnySearchURL(const GURL& url, TemplateURL* template_url) {
return false;
}
-// Returns true if |contents| is rendered inside the Instant process for
-// |profile|.
-bool IsRenderedInInstantProcess(const content::WebContents* contents,
- Profile* profile) {
- const content::RenderProcessHost* process_host =
- contents->GetRenderProcessHost();
- if (!process_host)
- return false;
- const InstantService* instant_service =
- InstantServiceFactory::GetForProfile(profile);
- if (!instant_service)
- return false;
-
- return instant_service->IsInstantProcess(process_host->GetID());
-}
// |url| should either have a secure scheme or have a non-HTTPS base URL that
// the user specified using --google-base-url. (This allows testers to use
@@ -332,7 +317,7 @@ struct NewTabURLDetails {
default:
// Use the local New Tab otherwise.
return NewTabURLDetails(local_url, state);
- };
+ }
}
GURL url;
@@ -461,6 +446,21 @@ bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile) {
IsInstantURL(url, profile));
}
+bool IsRenderedInInstantProcess(const content::WebContents* contents,
+ Profile* profile) {
+ const content::RenderProcessHost* process_host =
+ contents->GetRenderProcessHost();
+ if (!process_host)
+ return false;
+
+ const InstantService* instant_service =
+ InstantServiceFactory::GetForProfile(profile);
+ if (!instant_service)
+ return false;
+
+ return instant_service->IsInstantProcess(process_host->GetID());
+}
+
bool ShouldUseProcessPerSiteForInstantURL(const GURL& url, Profile* profile) {
return ShouldAssignURLToInstantRenderer(url, profile) &&
(url.host() == chrome::kChromeSearchLocalNtpHost ||
« no previous file with comments | « chrome/browser/search/search.h ('k') | chrome/browser/ui/search/search_ipc_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698