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

Side by Side Diff: chrome/browser/autocomplete/search_provider.h

Issue 11953016: Omnibox: Better Enforce Suggest Relevance Constraints in Keyword Mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments and spacing Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file contains the Search autocomplete provider. This provider is 5 // This file contains the Search autocomplete provider. This provider is
6 // responsible for all non-keyword autocomplete entries that start with 6 // responsible for all non-keyword autocomplete entries that start with
7 // "Search <engine> for ...", including searching for the current input string, 7 // "Search <engine> for ...", including searching for the current input string,
8 // search history, and search suggestions. An instance of it gets created and 8 // search history, and search suggestions. An instance of it gets created and
9 // managed by the autocomplete controller. 9 // managed by the autocomplete controller.
10 10
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // Parses results from the suggest server and updates the appropriate suggest 244 // Parses results from the suggest server and updates the appropriate suggest
245 // and navigation result lists, depending on whether |is_keyword| is true. 245 // and navigation result lists, depending on whether |is_keyword| is true.
246 // Returns whether the appropriate result list members were updated. 246 // Returns whether the appropriate result list members were updated.
247 bool ParseSuggestResults(base::Value* root_val, bool is_keyword); 247 bool ParseSuggestResults(base::Value* root_val, bool is_keyword);
248 248
249 // Converts the parsed results to a set of AutocompleteMatches, |matches_|. 249 // Converts the parsed results to a set of AutocompleteMatches, |matches_|.
250 void ConvertResultsToAutocompleteMatches(); 250 void ConvertResultsToAutocompleteMatches();
251 251
252 // Checks if suggested relevances violate certain expected constraints. 252 // Checks if suggested relevances violate certain expected constraints.
253 // See UpdateMatches() for the use and explanation of these constraints. 253 // See UpdateMatches() for the use and explanation of these constraints.
254 bool IsTopMatchScoreTooLow() const; 254 // We pass in keyword_search_what_you_typed_relevance because the
msw 2013/01/23 19:15:19 nit: vertical bars, and i prefer 'verbatim' to 'se
255 bool IsTopMatchHighRankSearchForURL() const; 255 // keyword verbatim result is not in |matches_| but can be important in
256 bool IsTopMatchNotInlinable() const; 256 // testing these constraints if has a higher relevance than the best
msw 2013/01/23 19:15:19 nit: "if it"?
257 // result in |matches_|.
258 bool IsTopMatchScoreTooLow(
259 int keyword_search_what_you_typed_relevance) const;
260 bool IsTopMatchHighRankSearchForURL(
261 int keyword_search_what_you_typed_relevance) const;
262 bool IsTopMatchNotInlinable(
263 int keyword_search_what_you_typed_relevance) const;
257 264
258 // Updates |matches_| from the latest results; applies calculated relevances 265 // Updates |matches_| from the latest results; applies calculated relevances
259 // if suggested relevances cause undesriable behavior. Updates |done_|. 266 // if suggested relevances cause undesriable behavior. Updates |done_|.
260 void UpdateMatches(); 267 void UpdateMatches();
261 268
262 // Converts the top navigation result in |navigation_results| to an 269 // Converts the top navigation result in |navigation_results| to an
263 // AutocompleteMatch and adds it to |matches_|. |is_keyword| must be true if 270 // AutocompleteMatch and adds it to |matches_|. |is_keyword| must be true if
264 // the results come from the keyword provider. 271 // the results come from the keyword provider.
265 void AddNavigationResultsToMatches( 272 void AddNavigationResultsToMatches(
266 const NavigationResults& navigation_results, 273 const NavigationResults& navigation_results,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 bool field_trial_triggered_; 391 bool field_trial_triggered_;
385 392
386 // Same as above except that it is maintained across the current Omnibox 393 // Same as above except that it is maintained across the current Omnibox
387 // session. 394 // session.
388 bool field_trial_triggered_in_session_; 395 bool field_trial_triggered_in_session_;
389 396
390 DISALLOW_COPY_AND_ASSIGN(SearchProvider); 397 DISALLOW_COPY_AND_ASSIGN(SearchProvider);
391 }; 398 };
392 399
393 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ 400 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698