Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 autocomplete entries that start with "Search <engine> |
| 7 // "Search <engine> for ...", including searching for the current input string, | 7 // for ...", including searching for the current input string, search |
| 8 // search history, and search suggestions. An instance of it gets created and | 8 // 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 |
| 11 #ifndef CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 11 #ifndef CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
| 12 #define CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 12 #define CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <string> | 15 #include <string> |
| 16 #include <vector> | 16 #include <vector> |
| 17 | 17 |
| 18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 // results correspond to the keyword provider or default provider. | 286 // results correspond to the keyword provider or default provider. |
| 287 void AddSuggestResultsToMap(const SuggestResults& results, | 287 void AddSuggestResultsToMap(const SuggestResults& results, |
| 288 bool is_keyword, | 288 bool is_keyword, |
| 289 MatchMap* map); | 289 MatchMap* map); |
| 290 | 290 |
| 291 // Get the relevance score for the verbatim result; this value may be provided | 291 // Get the relevance score for the verbatim result; this value may be provided |
| 292 // by the suggest server; otherwise it is calculated locally. | 292 // by the suggest server; otherwise it is calculated locally. |
| 293 int GetVerbatimRelevance() const; | 293 int GetVerbatimRelevance() const; |
| 294 // Calculate the relevance score for the verbatim result. | 294 // Calculate the relevance score for the verbatim result. |
| 295 int CalculateRelevanceForVerbatim() const; | 295 int CalculateRelevanceForVerbatim() const; |
| 296 // Calculate the relevance score for the keyword verbatim result (used if | |
|
Bart N.
2013/01/29 18:50:42
Nit: We usually refer in 3rd-person when describin
Mark P
2013/01/30 19:46:21
Cleaned up some nearby comments.
| |
| 297 // we have a keyword provider). | |
| 298 static int CalculateRelevanceForKeywordVerbatim(AutocompleteInput::Type type, | |
|
Bart N.
2013/01/29 18:50:42
Note: As you've seen in my pending CL (12039053),
Mark P
2013/01/30 19:46:21
Ack.
| |
| 299 bool prefer_keyword); | |
| 296 // |time| is the time at which this query was last seen. |is_keyword| | 300 // |time| is the time at which this query was last seen. |is_keyword| |
| 297 // indicates whether the results correspond to the keyword provider or default | 301 // indicates whether the results correspond to the keyword provider or default |
| 298 // provider. |prevent_inline_autocomplete| is true if we should not inline | 302 // provider. |prevent_inline_autocomplete| is true if we should not inline |
| 299 // autocomplete this query. | 303 // autocomplete this query. |
| 300 int CalculateRelevanceForHistory(const base::Time& time, | 304 int CalculateRelevanceForHistory(const base::Time& time, |
| 301 bool is_keyword, | 305 bool is_keyword, |
| 302 bool prevent_inline_autocomplete) const; | 306 bool prevent_inline_autocomplete) const; |
| 303 // Calculate the relevance for search suggestion results. Set |for_keyword| to | 307 // Calculate the relevance for search suggestion results. Set |for_keyword| to |
| 304 // true for relevance values applicable to keyword provider results. | 308 // true for relevance values applicable to keyword provider results. |
| 305 int CalculateRelevanceForSuggestion(bool for_keyword) const; | 309 int CalculateRelevanceForSuggestion(bool for_keyword) const; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 386 bool field_trial_triggered_; | 390 bool field_trial_triggered_; |
| 387 | 391 |
| 388 // 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 |
| 389 // session. | 393 // session. |
| 390 bool field_trial_triggered_in_session_; | 394 bool field_trial_triggered_in_session_; |
| 391 | 395 |
| 392 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 396 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
| 393 }; | 397 }; |
| 394 | 398 |
| 395 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 399 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
| OLD | NEW |