summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_match.h
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 03:04:01 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 03:04:01 +0000
commit4d75f8a78eb16ec4e15326a3feb3c7fbf83a73d6 (patch)
tree6ef8e544403eb8cbdf2458e09d877a0e3fede42e /chrome/browser/autocomplete/autocomplete_match.h
parent55a38d3f47d1fa53a89f8090a012526382b8e54a (diff)
downloadchromium_src-4d75f8a78eb16ec4e15326a3feb3c7fbf83a73d6.zip
chromium_src-4d75f8a78eb16ec4e15326a3feb3c7fbf83a73d6.tar.gz
chromium_src-4d75f8a78eb16ec4e15326a3feb3c7fbf83a73d6.tar.bz2
Revert 120005 - 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 TBR=aaron.randolph@gmail.com Review URL: https://chromiumcodereview.appspot.com/9310017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120018 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_match.h')
-rw-r--r--chrome/browser/autocomplete/autocomplete_match.h37
1 files changed, 0 insertions, 37 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_match.h b/chrome/browser/autocomplete/autocomplete_match.h
index aff42cf..d1229a9 100644
--- a/chrome/browser/autocomplete/autocomplete_match.h
+++ b/chrome/browser/autocomplete/autocomplete_match.h
@@ -9,7 +9,6 @@
#include <vector>
#include <string>
-#include "base/memory/scoped_ptr.h"
#include "content/public/common/page_transition_types.h"
#include "googleurl/src/gurl.h"
@@ -91,13 +90,9 @@ struct AutocompleteMatch {
int relevance,
bool deletable,
Type type);
- AutocompleteMatch(const AutocompleteMatch& match);
~AutocompleteMatch();
// Converts |type| to a string representation. Used in logging and debugging.
- AutocompleteMatch& operator=(const AutocompleteMatch& match);
-
- // Converts |type| to a string representation. Used in logging.
static std::string TypeToString(Type type);
// Converts |type| to a resource identifier for the appropriate icon for this
@@ -109,7 +104,6 @@ struct AutocompleteMatch {
const AutocompleteMatch& elem2);
// Comparison functions for removing matches with duplicate destinations.
- // Destinations are compared using |stripped_destination_url|.
static bool DestinationSortFunc(const AutocompleteMatch& elem1,
const AutocompleteMatch& elem2);
static bool DestinationsEqual(const AutocompleteMatch& elem1,
@@ -139,18 +133,6 @@ struct AutocompleteMatch {
// or |description|.
static string16 SanitizeString(const string16& text);
- // Copies the destination_url with "www." stripped off to
- // |stripped_destination_url|. This method is invoked internally by the
- // AutocompleteController and does not normally need to be invoked.
- void ComputeStrippedDestinationURL();
-
- // Gets the selected keyword or keyword hint for this match. Returns
- // true if |keyword| represents a keyword hint, or false if |keyword|
- // represents a selected keyword. (|keyword| will always be set [though
- // possibly to the empty string], and you cannot have both a selected keyword
- // and a keyword hint simultaneously.)
- bool GetKeyword(string16* keyword) const;
-
// The provider of this match, used to remember which provider the user had
// selected when the input changes. This may be NULL, in which case there is
// no provider (or memory of the user's selection).
@@ -183,9 +165,6 @@ struct AutocompleteMatch {
// It may be empty if there is no possible navigation.
GURL destination_url;
- // The destination URL with "www." stripped off for better dupe finding.
- GURL stripped_destination_url;
-
// The main text displayed in the address bar dropdown.
string16 contents;
ACMatchClassifications contents_class;
@@ -206,22 +185,6 @@ struct AutocompleteMatch {
// Type of this match.
Type type;
- // Set with a keyword provider match if this match can show a keyword hint.
- // For example, if this is a SearchProvider match for "www.amazon.com",
- // |associated_keyword| could be a KeywordProvider match for "amazon.com".
- scoped_ptr<AutocompleteMatch> associated_keyword;
-
- // For matches that correspond to valid substituting keywords ("search
- // engines" that aren't the default engine, or extension keywords), this
- // is the keyword. If this is set, then when displaying this match, the
- // edit will use the "keyword mode" UI that shows a blue
- // "Search <engine name>" chit before the user's typing. This should be
- // set for any match that's an |associated_keyword| of a match in the main
- // result list, as well as any other matches in the main result list that
- // are direct keyword matches (e.g. if the user types in a keyword name and
- // some search terms directly).
- string16 keyword;
-
// Indicates the TemplateURL the match originated from. This is set for
// keywords as well as matches for the default search provider.
const TemplateURL* template_url;