| 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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 212 |
| 213 // Determines the relevance for a match, given its type. If | 213 // Determines the relevance for a match, given its type. If |
| 214 // |match_type| is NORMAL, |match_number| is a number [0, | 214 // |match_type| is NORMAL, |match_number| is a number [0, |
| 215 // kMaxSuggestions) indicating the relevance of the match (higher == | 215 // kMaxSuggestions) indicating the relevance of the match (higher == |
| 216 // more relevant). For other values of |match_type|, |match_number| | 216 // more relevant). For other values of |match_type|, |match_number| |
| 217 // is ignored. Only called some of the time; for some matches, | 217 // is ignored. Only called some of the time; for some matches, |
| 218 // relevancy scores are assigned consecutively decreasing (1416, | 218 // relevancy scores are assigned consecutively decreasing (1416, |
| 219 // 1415, 1414, ...). | 219 // 1415, 1414, ...). |
| 220 int CalculateRelevance(MatchType match_type, size_t match_number) const; | 220 int CalculateRelevance(MatchType match_type, size_t match_number) const; |
| 221 | 221 |
| 222 // Helper function that actually launches the two autocomplete passes. | |
| 223 void RunAutocompletePasses(const AutocompleteInput& input, | |
| 224 bool fixup_input_and_run_pass_1); | |
| 225 | |
| 226 // Given a |match| containing the "what you typed" suggestion created by | 222 // Given a |match| containing the "what you typed" suggestion created by |
| 227 // SuggestExactInput(), looks up its info in the DB. If found, fills in the | 223 // SuggestExactInput(), looks up its info in the DB. If found, fills in the |
| 228 // title from the DB, promotes the match's priority to that of an inline | 224 // title from the DB, promotes the match's priority to that of an inline |
| 229 // autocomplete match (maybe it should be slightly better?), and places it on | 225 // autocomplete match (maybe it should be slightly better?), and places it on |
| 230 // the front of |matches| (so we pick the right matches to throw away | 226 // the front of |matches| (so we pick the right matches to throw away |
| 231 // when culling redirects to/from it). Returns whether a match was promoted. | 227 // when culling redirects to/from it). Returns whether a match was promoted. |
| 232 bool FixupExactSuggestion(history::URLDatabase* db, | 228 bool FixupExactSuggestion(history::URLDatabase* db, |
| 233 const AutocompleteInput& input, | 229 const AutocompleteInput& input, |
| 234 const VisitClassifier& classifier, | 230 const VisitClassifier& classifier, |
| 235 AutocompleteMatch* match, | 231 AutocompleteMatch* match, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 // URL-what-you-typed was visited before or not. If false, the only | 335 // URL-what-you-typed was visited before or not. If false, the only |
| 340 // possible result that HistoryURL provider can return is | 336 // possible result that HistoryURL provider can return is |
| 341 // URL-what-you-typed. This variable is not part of params_ because | 337 // URL-what-you-typed. This variable is not part of params_ because |
| 342 // it never changes after the HistoryURLProvider is initialized. | 338 // it never changes after the HistoryURLProvider is initialized. |
| 343 // It's used to aid the transition to get all URLs from history to | 339 // It's used to aid the transition to get all URLs from history to |
| 344 // be scored in the HistoryQuick provider only. | 340 // be scored in the HistoryQuick provider only. |
| 345 bool search_url_database_; | 341 bool search_url_database_; |
| 346 }; | 342 }; |
| 347 | 343 |
| 348 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ | 344 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ |
| OLD | NEW |