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

Unified Diff: chrome/browser/autocomplete/autocomplete_match.h

Issue 6731036: Enabled pressing TAB to cycle through the Omnibox results. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 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: chrome/browser/autocomplete/autocomplete_match.h
===================================================================
--- chrome/browser/autocomplete/autocomplete_match.h (revision 81359)
+++ chrome/browser/autocomplete/autocomplete_match.h (working copy)
@@ -99,6 +99,7 @@
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,
@@ -123,6 +124,15 @@
int style,
ACMatchClassifications* classifications);
+ // Copies the destination_url with "www." stripped off to
+ // |stripped_destination_url|.
+ void ComputeStrippedDestinationURL();
+
+ bool has_keyword_hint() const {
+ return keyword_state == DUAL_SHOWING_KEYWORD ||
Peter Kasting 2011/04/13 21:06:59 This isn't right. DUAL_SHOWING_NON_KEYWORD is the
+ keyword_state == DUAL_SHOWING_NON_KEYWORD;
+ }
+
// 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).
@@ -155,6 +165,9 @@
// 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;
@@ -175,9 +188,22 @@
// Type of this match.
Type type;
+ enum KeywordState {
Peter Kasting 2011/04/13 21:06:59 Nit: Probably want to document these.
+ NO_KEYWORD,
+ KEYWORD,
+ DUAL_SHOWING_NON_KEYWORD,
+ DUAL_SHOWING_KEYWORD,
+ };
+
+ KeywordState keyword_state;
+
+ // Keyword for this match.
+ string16 keyword;
+
// If this match corresponds to a keyword, this is the TemplateURL the
- // keyword was obtained from.
- const TemplateURL* template_url;
+ // keyword was obtained from. If this match has a keyword hint, this is
+ // the TemplateURL for the keyword.
+ const TemplateURL* keyword_url;
// True if the user has starred the destination URL.
bool starred;

Powered by Google App Engine
This is Rietveld 408576698