BRM093_Permanently-disable-query-in-omnibox.patch 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. From: csagan5 <32685696+csagan5@users.noreply.github.com>
  2. Date: Wed, 17 Oct 2018 06:06:11 +0200
  3. Subject: Permanently disable query-in-omnibox
  4. ---
  5. .../chromium/chrome/browser/ChromeFeatureList.java | 1 -
  6. .../chrome/browser/toolbar/ToolbarModel.java | 2 +-
  7. chrome/browser/about_flags.cc | 4 ----
  8. chrome/browser/android/chrome_feature_list.cc | 1 -
  9. chrome/browser/flag_descriptions.cc | 5 ----
  10. chrome/browser/flag_descriptions.h | 3 ---
  11. components/omnibox/browser/query_in_omnibox.cc | 27 +---------------------
  12. 7 files changed, 2 insertions(+), 41 deletions(-)
  13. diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
  14. --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
  15. +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
  16. @@ -272,7 +272,6 @@ public abstract class ChromeFeatureList {
  17. public static final String SOUND_CONTENT_SETTING = "SoundContentSetting";
  18. public static final String SPANNABLE_INLINE_AUTOCOMPLETE = "SpannableInlineAutocomplete";
  19. public static final String SUBRESOURCE_FILTER = "SubresourceFilter";
  20. - public static final String QUERY_IN_OMNIBOX = "QueryInOmnibox";
  21. public static final String TAB_REPARENTING = "TabReparenting";
  22. public static final String TRUSTED_WEB_ACTIVITY = "TrustedWebActivity";
  23. public static final String TRUSTED_WEB_ACTIVITY_POST_MESSAGE = "TrustedWebActivityPostMessage";
  24. diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java
  25. --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java
  26. +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java
  27. @@ -85,7 +85,7 @@ public class ToolbarModel implements ToolbarDataProvider {
  28. */
  29. public void initializeWithNative() {
  30. mNativeToolbarModelAndroid = nativeInit();
  31. - mQueryInOmniboxEnabled = ChromeFeatureList.isEnabled(ChromeFeatureList.QUERY_IN_OMNIBOX);
  32. + mQueryInOmniboxEnabled = false;
  33. }
  34. /**
  35. diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
  36. --- a/chrome/browser/about_flags.cc
  37. +++ b/chrome/browser/about_flags.cc
  38. @@ -3977,10 +3977,6 @@ const FeatureEntry kFeatureEntries[] = {
  39. FEATURE_VALUE_TYPE(features::kOobeRecommendAppsScreen)},
  40. #endif // OS_CHROMEOS
  41. - {"enable-query-in-omnibox", flag_descriptions::kQueryInOmniboxName,
  42. - flag_descriptions::kQueryInOmniboxDescription, kOsAll,
  43. - FEATURE_VALUE_TYPE(omnibox::kQueryInOmnibox)},
  44. -
  45. {"enable-viz-hit-test-draw-quad",
  46. flag_descriptions::kVizHitTestDrawQuadName,
  47. flag_descriptions::kVizHitTestDrawQuadDescription, kOsAll,
  48. diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc
  49. --- a/chrome/browser/android/chrome_feature_list.cc
  50. +++ b/chrome/browser/android/chrome_feature_list.cc
  51. @@ -167,7 +167,6 @@ const base::Feature* kFeaturesExposedToJava[] = {
  52. &offline_pages::kOfflinePagesSharingFeature,
  53. &offline_pages::kOfflinePagesLivePageSharingFeature,
  54. &offline_pages::kPrefetchingOfflinePagesFeature,
  55. - &omnibox::kQueryInOmnibox,
  56. &omnibox::kUIExperimentHideSteadyStateUrlSchemeAndSubdomains,
  57. &password_manager::features::kPasswordExport,
  58. &password_manager::features::kPasswordSearchMobile,
  59. diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
  60. --- a/chrome/browser/flag_descriptions.cc
  61. +++ b/chrome/browser/flag_descriptions.cc
  62. @@ -1522,11 +1522,6 @@ const char kPullToRefreshDescription[] =
  63. "Pull-to-refresh gesture in response to vertical overscroll.";
  64. const char kPullToRefreshEnabledTouchscreen[] = "Enabled for touchscreen only";
  65. -const char kQueryInOmniboxName[] = "Query in Omnibox";
  66. -const char kQueryInOmniboxDescription[] =
  67. - "Only display query terms in the omnibox when viewing a search results "
  68. - "page.";
  69. -
  70. const char kQuicName[] = "Experimental QUIC protocol";
  71. const char kQuicDescription[] = "Enable experimental QUIC protocol support.";
  72. diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
  73. --- a/chrome/browser/flag_descriptions.h
  74. +++ b/chrome/browser/flag_descriptions.h
  75. @@ -934,9 +934,6 @@ extern const char kPullToRefreshName[];
  76. extern const char kPullToRefreshDescription[];
  77. extern const char kPullToRefreshEnabledTouchscreen[];
  78. -extern const char kQueryInOmniboxName[];
  79. -extern const char kQueryInOmniboxDescription[];
  80. -
  81. extern const char kQuicName[];
  82. extern const char kQuicDescription[];
  83. diff --git a/components/omnibox/browser/query_in_omnibox.cc b/components/omnibox/browser/query_in_omnibox.cc
  84. --- a/components/omnibox/browser/query_in_omnibox.cc
  85. +++ b/components/omnibox/browser/query_in_omnibox.cc
  86. @@ -10,16 +10,6 @@
  87. #include "components/omnibox/browser/omnibox_field_trial.h"
  88. #include "components/search_engines/template_url_service.h"
  89. -namespace {
  90. -
  91. -bool SecurityLevelSafeForQueryInOmnibox(
  92. - security_state::SecurityLevel security_level) {
  93. - return security_level == security_state::SecurityLevel::SECURE ||
  94. - security_level == security_state::SecurityLevel::EV_SECURE;
  95. -}
  96. -
  97. -} // namespace
  98. -
  99. QueryInOmnibox::QueryInOmnibox(AutocompleteClassifier* autocomplete_classifier,
  100. TemplateURLService* template_url_service)
  101. : autocomplete_classifier_(autocomplete_classifier),
  102. @@ -32,22 +22,7 @@ bool QueryInOmnibox::GetDisplaySearchTerms(
  103. security_state::SecurityLevel security_level,
  104. const GURL& url,
  105. base::string16* search_terms) {
  106. - if (!base::FeatureList::IsEnabled(omnibox::kQueryInOmnibox))
  107. - return false;
  108. -
  109. - if (!ignore_security_level_ &&
  110. - !SecurityLevelSafeForQueryInOmnibox(security_level)) {
  111. - return false;
  112. - }
  113. -
  114. - base::string16 extracted_search_terms = ExtractSearchTermsInternal(url);
  115. - if (extracted_search_terms.empty())
  116. - return false;
  117. -
  118. - if (search_terms)
  119. - *search_terms = extracted_search_terms;
  120. -
  121. - return true;
  122. + return false;
  123. }
  124. base::string16 QueryInOmnibox::ExtractSearchTermsInternal(const GURL& url) {
  125. --
  126. 2.11.0