0008-restore-classic-ntp.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --- a/chrome/browser/search/search.cc
  2. +++ b/chrome/browser/search/search.cc
  3. @@ -183,26 +183,7 @@ struct NewTabURLDetails {
  4. : chrome::kChromeSearchLocalNtpUrl);
  5. #endif
  6. - if (ShouldShowLocalNewTab(profile))
  7. - return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
  8. -
  9. - const TemplateURL* template_url =
  10. - GetDefaultSearchProviderTemplateURL(profile);
  11. - if (!profile || !template_url)
  12. - return NewTabURLDetails(local_url, NEW_TAB_URL_BAD);
  13. -
  14. - GURL search_provider_url(template_url->new_tab_url_ref().ReplaceSearchTerms(
  15. - TemplateURLRef::SearchTermsArgs(base::string16()),
  16. - UIThreadSearchTermsData()));
  17. -
  18. - if (!search_provider_url.is_valid())
  19. - return NewTabURLDetails(local_url, NEW_TAB_URL_NOT_SET);
  20. - if (!search_provider_url.SchemeIsCryptographic())
  21. - return NewTabURLDetails(local_url, NEW_TAB_URL_INSECURE);
  22. - if (!IsURLAllowedForSupervisedUser(search_provider_url, profile))
  23. - return NewTabURLDetails(local_url, NEW_TAB_URL_BLOCKED);
  24. -
  25. - return NewTabURLDetails(search_provider_url, NEW_TAB_URL_VALID);
  26. + return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
  27. }
  28. const GURL url;
  29. --- a/components/ntp_snippets/features.cc
  30. +++ b/components/ntp_snippets/features.cc
  31. @@ -39,7 +39,7 @@ const base::Feature* const kAllFeatures[
  32. &kOptionalImagesEnabledFeature};
  33. const base::Feature kArticleSuggestionsFeature{
  34. - "NTPArticleSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
  35. + "NTPArticleSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
  36. const base::Feature kRemoteSuggestionsEmulateM58FetchingSchedule{
  37. "RemoteSuggestionsEmulateM58FetchingSchedule",
  38. @@ -69,10 +69,10 @@ const char kNotificationsDailyLimit[] =
  39. const char kNotificationsIgnoredLimitParam[] = "ignored_limit";
  40. const base::Feature kKeepPrefetchedContentSuggestions{
  41. - "KeepPrefetchedContentSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
  42. + "KeepPrefetchedContentSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
  43. const base::Feature kOptionalImagesEnabledFeature{
  44. - "NTPRemoteSuggestionsOptionalImages", base::FEATURE_ENABLED_BY_DEFAULT};
  45. + "NTPRemoteSuggestionsOptionalImages", base::FEATURE_DISABLED_BY_DEFAULT};
  46. std::vector<const base::Feature*> GetAllFeatures() {
  47. // Skip the last feature as it's a nullptr.