From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 26 Nov 2017 11:40:05 +0100
Subject: Restore classic new tab page

License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
 chrome/browser/search/search.cc | 42 +++------------------------------
 1 file changed, 3 insertions(+), 39 deletions(-)

diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -94,16 +94,6 @@ enum NewTabURLState {
   NEW_TAB_URL_MAX
 };
 
-const TemplateURL* GetDefaultSearchProviderTemplateURL(Profile* profile) {
-  if (profile) {
-    TemplateURLService* template_url_service =
-        TemplateURLServiceFactory::GetForProfile(profile);
-    if (template_url_service)
-      return template_url_service->GetDefaultSearchProvider();
-  }
-  return nullptr;
-}
-
 bool IsMatchingServiceWorker(const GURL& my_url, const GURL& document_url) {
   // The origin should match.
   if (!MatchesOrigin(my_url, document_url))
@@ -137,31 +127,6 @@ bool IsNTPOrRelatedURLHelper(const GURL& url, Profile* profile) {
                                     IsMatchingServiceWorker(url, new_tab_url));
 }
 
-bool IsURLAllowedForSupervisedUser(const GURL& url, Profile* profile) {
-#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
-  // If this isn't a supervised child user, skip the URL filter check, since it
-  // can be fairly expensive.
-  if (!profile->IsChild())
-    return true;
-  SupervisedUserService* supervised_user_service =
-      SupervisedUserServiceFactory::GetForProfile(profile);
-  SupervisedUserURLFilter* url_filter = supervised_user_service->GetURLFilter();
-  if (url_filter->GetFilteringBehaviorForURL(url) ==
-          SupervisedUserURLFilter::BLOCK) {
-    return false;
-  }
-#endif
-  return true;
-}
-
-bool ShouldShowLocalNewTab(Profile* profile) {
-#if !BUILDFLAG(IS_ANDROID)
-  return DefaultSearchProviderIsGoogle(profile);
-#else
-  return false;
-#endif
-}
-
 // Used to look up the URL to use for the New Tab page. Also tracks how we
 // arrived at that URL so it can be logged with UMA.
 struct NewTabURLDetails {
@@ -184,10 +149,9 @@ struct NewTabURLDetails {
                              : chrome::kChromeUINewTabPageThirdPartyURL);
 #endif
 
-    if (ShouldShowLocalNewTab(profile))
-      return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
+    return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
 
-    const TemplateURL* template_url =
+/*    const TemplateURL* template_url =
         GetDefaultSearchProviderTemplateURL(profile);
     if (!profile || !template_url)
       return NewTabURLDetails(local_url, NEW_TAB_URL_BAD);
@@ -203,7 +167,7 @@ struct NewTabURLDetails {
     if (!IsURLAllowedForSupervisedUser(search_provider_url, profile))
       return NewTabURLDetails(local_url, NEW_TAB_URL_BLOCKED);
 
-    return NewTabURLDetails(search_provider_url, NEW_TAB_URL_VALID);
+    return NewTabURLDetails(search_provider_url, NEW_TAB_URL_VALID);*/
   }
 
   const GURL url;
--
2.25.1
