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

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: 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 it is not
255 bool IsTopMatchHighRankSearchForURL() const; 255 // in |matches_| but can be important in testing these constraints if
256 bool IsTopMatchNotInlinable() const; 256 // its high-ranked than the best result in |matches_|.
257 bool IsTopMatchScoreTooLow(
258 int keyword_search_what_you_typed_relevance) const;
259 bool IsTopMatchHighRankSearchForURL(
260 int keyword_search_what_you_typed_relevance) const;
261 bool IsTopMatchNotInlinable(
262 int keyword_search_what_you_typed_relevance) const;
257 263
258 // Updates |matches_| from the latest results; applies calculated relevances 264 // Updates |matches_| from the latest results; applies calculated relevances
259 // if suggested relevances cause undesriable behavior. Updates |done_|. 265 // if suggested relevances cause undesriable behavior. Updates |done_|.
260 void UpdateMatches(); 266 void UpdateMatches();
261 267
262 // Converts the top navigation result in |navigation_results| to an 268 // Converts the top navigation result in |navigation_results| to an
263 // AutocompleteMatch and adds it to |matches_|. |is_keyword| must be true if 269 // AutocompleteMatch and adds it to |matches_|. |is_keyword| must be true if
264 // the results come from the keyword provider. 270 // the results come from the keyword provider.
265 void AddNavigationResultsToMatches( 271 void AddNavigationResultsToMatches(
266 const NavigationResults& navigation_results, 272 const NavigationResults& navigation_results,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 bool field_trial_triggered_; 390 bool field_trial_triggered_;
385 391
386 // Same as above except that it is maintained across the current Omnibox 392 // Same as above except that it is maintained across the current Omnibox
387 // session. 393 // session.
388 bool field_trial_triggered_in_session_; 394 bool field_trial_triggered_in_session_;
389 395
390 DISALLOW_COPY_AND_ASSIGN(SearchProvider); 396 DISALLOW_COPY_AND_ASSIGN(SearchProvider);
391 }; 397 };
392 398
393 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ 399 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698