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

Side by Side Diff: components/omnibox/autocomplete_result.h

Issue 1155673002: Omnibox - Add About Flag to Reverse Title and URLs in the Dropdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: peter's comments, including refactoring Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_OMNIBOX_AUTOCOMPLETE_RESULT_H_ 5 #ifndef COMPONENTS_OMNIBOX_AUTOCOMPLETE_RESULT_H_
6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_RESULT_H_ 6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_RESULT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 AutocompleteResult(); 63 AutocompleteResult();
64 ~AutocompleteResult(); 64 ~AutocompleteResult();
65 65
66 // Copies matches from |old_matches| to provide a consistant result set. See 66 // Copies matches from |old_matches| to provide a consistant result set. See
67 // comments in code for specifics. 67 // comments in code for specifics.
68 void CopyOldMatches(const AutocompleteInput& input, 68 void CopyOldMatches(const AutocompleteInput& input,
69 const AutocompleteResult& old_matches, 69 const AutocompleteResult& old_matches,
70 TemplateURLService* template_url_service); 70 TemplateURLService* template_url_service);
71 71
72 // Adds a new set of matches to the result set. Does not re-sort. 72 // Adds a new set of matches to the result set. Does not re-sort. May
73 void AppendMatches(const ACMatches& matches); 73 // transform the matches while adding them to make them better fit with the
74 // result set. Whether the transformation happens and how it does can
75 // change depending on |input|.
Peter Kasting 2015/05/22 23:39:36 Nit: These last two sentences are vague. I'd just
Mark P 2015/05/23 20:32:13 I slightly prefer the vagueness because I want to
76 void AppendMatches(const AutocompleteInput& input,
77 const ACMatches& matches);
74 78
75 // Removes duplicates, puts the list in sorted order and culls to leave only 79 // Removes duplicates, puts the list in sorted order and culls to leave only
76 // the best kMaxMatches matches. Sets the default match to the best match 80 // the best kMaxMatches matches. Sets the default match to the best match
77 // and updates the alternate nav URL. 81 // and updates the alternate nav URL.
78 void SortAndCull(const AutocompleteInput& input, 82 void SortAndCull(const AutocompleteInput& input,
79 TemplateURLService* template_url_service); 83 TemplateURLService* template_url_service);
80 84
81 // Returns true if at least one match was copied from the last result. 85 // Returns true if at least one match was copied from the last result.
82 bool HasCopiedMatches() const; 86 bool HasCopiedMatches() const;
83 87
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // user's local intranet contains site "foo", and the user types "foo", we 200 // user's local intranet contains site "foo", and the user types "foo", we
197 // default to searching for "foo" when the user may have meant to navigate 201 // default to searching for "foo" when the user may have meant to navigate
198 // there. In cases like this, the default match will point to the "search for 202 // there. In cases like this, the default match will point to the "search for
199 // 'foo'" result, and this will contain "http://foo/". 203 // 'foo'" result, and this will contain "http://foo/".
200 GURL alternate_nav_url_; 204 GURL alternate_nav_url_;
201 205
202 DISALLOW_COPY_AND_ASSIGN(AutocompleteResult); 206 DISALLOW_COPY_AND_ASSIGN(AutocompleteResult);
203 }; 207 };
204 208
205 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_RESULT_H_ 209 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_RESULT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698