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

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, 5 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 95169)
+++ chrome/browser/autocomplete/autocomplete_match.h (working copy)
@@ -9,6 +9,7 @@
#include <vector>
#include <string>
+#include "base/memory/scoped_ptr.h"
#include "content/common/page_transition_types.h"
#include "googleurl/src/gurl.h"
@@ -87,8 +88,11 @@
int relevance,
bool deletable,
Type type);
+ AutocompleteMatch(const AutocompleteMatch& match);
~AutocompleteMatch();
+ AutocompleteMatch& operator=(const AutocompleteMatch& match);
+
// Converts |type| to a string representation. Used in logging.
static std::string TypeToString(Type type);
@@ -101,6 +105,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,
@@ -125,6 +130,10 @@
int style,
ACMatchClassifications* classifications);
+ // Copies the destination_url with "www." stripped off to
+ // |stripped_destination_url|.
+ void ComputeStrippedDestinationURL();
+
// 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).
@@ -157,6 +166,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;
@@ -177,6 +189,14 @@
// 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;
+
+ // If this is a keyword search match, |keyword| is the keyword text.
Peter Kasting 2011/08/04 20:07:53 Nit: Maybe the explicit "If this match is a keywor
aaron.randolph 2011/08/04 21:02:50 I don't think that would be accurate because if th
Peter Kasting 2011/08/04 21:31:42 That was what I was asking in my patch set 7 comme
aaron.randolph 2011/08/04 22:32:25 In the places where |keyword| is used, we don't kn
Peter Kasting 2011/08/04 23:13:16 It sounds like this member deserves a block commen
+ 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;

Powered by Google App Engine
This is Rietveld 408576698