summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/search_provider.cc
diff options
context:
space:
mode:
authoraaron.randolph@gmail.com <aaron.randolph@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 01:52:28 +0000
committeraaron.randolph@gmail.com <aaron.randolph@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 01:52:28 +0000
commit467a0f60ce6043bfbe240f4482f75e4b90cb3883 (patch)
treed333964e748707afa903a118d9f7e548a5d7966f /chrome/browser/autocomplete/search_provider.cc
parent55df2967e77f53ec6b919e4b1a33c512cb73ff24 (diff)
downloadchromium_src-467a0f60ce6043bfbe240f4482f75e4b90cb3883.zip
chromium_src-467a0f60ce6043bfbe240f4482f75e4b90cb3883.tar.gz
chromium_src-467a0f60ce6043bfbe240f4482f75e4b90cb3883.tar.bz2
Enabled pressing TAB to traverse through the Omnibox results, removed moving the caret to the end of the line with TAB, and filtered out redundant URLs.
This adds the ability to move through Omnibox result matches using TAB in addition to the arrow keys. To enable this, pressing TAB to move the caret to the end of the line was removed and the keyword hint/shortcut logic has been modified. The Omnibox popup now shows keyword markers on the right side of matches that have associated keywords (represented by a right arrow). When this kind of match is selected, and the keyword is accepted, the match changes appearance by animating in the associated keyword match from the right to display the "Search X for <>" message. If multiple matches have the same keyword then only the most relevant match will display the keyword marker and hint. Pressing TAB while a keyword hint is shown will enter keyword mode in place; the results will no longer change when keyword mode is entered. Additionally, substituting keyword provider matches will only be shown if a keyword substitution is available. Finally, results with redundant destination URLs (e.g., "foo.com", "www.foo.com") will have the less relevant URLs filtered out. This also addresses some GTK omnibox browsertest flakiness; see bug 112041. Contributed by aaron.randolph@gmail.com BUG=57748,76278,77662,80934,84420 TEST=Press TAB to move the selection down the list of results, SHIFT+TAB to move up. Review URL: http://codereview.chromium.org/6731036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120005 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/search_provider.cc')
-rw-r--r--chrome/browser/autocomplete/search_provider.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index 62d5b92..6280427 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -874,7 +874,9 @@ void SearchProvider::AddMatchToMap(const string16& query_string,
if (is_keyword) {
match.fill_into_edit.append(
providers_.keyword_provider().keyword() + char16(' '));
- search_start += providers_.keyword_provider().keyword().size() + 1;
+
+ match.keyword = providers_.keyword_provider().keyword();
+ search_start += match.keyword.size() + 1;
}
match.fill_into_edit.append(query_string);
// Not all suggestions start with the original input.