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

Unified Diff: components/omnibox/browser/search_provider.cc

Issue 1855423003: Interpret '?' and Ctrl-K or Ctrl-E as putting omnibox in keyword search mode for Default Search Pro… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed forced queries using '?'. Removed Ctrl-K preserving the user's keyword if they're already … Created 4 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: components/omnibox/browser/search_provider.cc
diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc
index ab129045d463d475bec2afa4412c14ecfade3212..ee0f405e37740db135f934855fd170e56d26a7cb 100644
--- a/components/omnibox/browser/search_provider.cc
+++ b/components/omnibox/browser/search_provider.cc
@@ -745,11 +745,6 @@ bool SearchProvider::IsQueryPotentionallyPrivate() const {
// If the input type might be a URL, we take extra care so that private data
// isn't sent to the server.
- // FORCED_QUERY means the user is explicitly asking us to search for this, so
- // we assume it isn't a URL and/or there isn't private data.
- if (input_.type() == metrics::OmniboxInputType::FORCED_QUERY)
- return false;
-
// Next we check the scheme. If this is UNKNOWN/URL with a scheme that isn't
// http/https/ftp, we shouldn't send it. Sending things like file: and data:
// is both a waste of time and a disclosure of potentially private, local
@@ -1316,7 +1311,6 @@ int SearchProvider::
switch (input_.type()) {
case metrics::OmniboxInputType::UNKNOWN:
case metrics::OmniboxInputType::QUERY:
- case metrics::OmniboxInputType::FORCED_QUERY:
return kNonURLVerbatimRelevance;
case metrics::OmniboxInputType::URL:
@@ -1427,13 +1421,6 @@ AutocompleteMatch SearchProvider::NavigationToMatch(
net::UnescapeRule::SPACES, nullptr, nullptr,
&inline_autocomplete_offset),
client()->GetSchemeClassifier());
- // Preserve the forced query '?' prefix in |match.fill_into_edit|.
- // Otherwise, user edits to a suggestion would show non-Search results.
- if (input_.type() == metrics::OmniboxInputType::FORCED_QUERY) {
- match.fill_into_edit.insert(0, base::ASCIIToUTF16("?"));
- if (inline_autocomplete_offset != base::string16::npos)
- ++inline_autocomplete_offset;
- }
if (inline_autocomplete_offset != base::string16::npos) {
DCHECK(inline_autocomplete_offset <= match.fill_into_edit.length());
match.inline_autocompletion =

Powered by Google App Engine
This is Rietveld 408576698