| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 size_t source_index, | 284 size_t source_index, |
| 285 const std::vector<GURL>& remove) const; | 285 const std::vector<GURL>& remove) const; |
| 286 | 286 |
| 287 // Converts a line from the database into an autocomplete match for display. | 287 // Converts a line from the database into an autocomplete match for display. |
| 288 AutocompleteMatch HistoryMatchToACMatch( | 288 AutocompleteMatch HistoryMatchToACMatch( |
| 289 const HistoryURLProviderParams& params, | 289 const HistoryURLProviderParams& params, |
| 290 const history::HistoryMatch& history_match, | 290 const history::HistoryMatch& history_match, |
| 291 MatchType match_type, | 291 MatchType match_type, |
| 292 int relevance); | 292 int relevance); |
| 293 | 293 |
| 294 // Returns a set of classifications that highlight all the occurrences |
| 295 // of |input_text| at word breaks in |description|. |
| 296 static ACMatchClassifications ClassifyDescription( |
| 297 const string16& input_text, |
| 298 const string16& description); |
| 299 |
| 294 // Params for the current query. The provider should not free this directly; | 300 // Params for the current query. The provider should not free this directly; |
| 295 // instead, it is passed as a parameter through the history backend, and the | 301 // instead, it is passed as a parameter through the history backend, and the |
| 296 // parameter itself is freed once it's no longer needed. The only reason we | 302 // parameter itself is freed once it's no longer needed. The only reason we |
| 297 // keep this member is so we can set the cancel bit on it. | 303 // keep this member is so we can set the cancel bit on it. |
| 298 HistoryURLProviderParams* params_; | 304 HistoryURLProviderParams* params_; |
| 299 | 305 |
| 300 // If true, HistoryURL provider should lookup and cull redirects. If | 306 // If true, HistoryURL provider should lookup and cull redirects. If |
| 301 // false, it returns matches that may be redirects to each other and | 307 // false, it returns matches that may be redirects to each other and |
| 302 // simply hopes the default AutoCompleteController behavior to remove | 308 // simply hopes the default AutoCompleteController behavior to remove |
| 303 // URLs that are likely duplicates (http://google.com <-> | 309 // URLs that are likely duplicates (http://google.com <-> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 315 // URL-what-you-typed was visited before or not. If false, the only | 321 // URL-what-you-typed was visited before or not. If false, the only |
| 316 // possible result that HistoryURL provider can return is | 322 // possible result that HistoryURL provider can return is |
| 317 // URL-what-you-typed. This variable is not part of params_ because | 323 // URL-what-you-typed. This variable is not part of params_ because |
| 318 // it never changes after the HistoryURLProvider is initialized. | 324 // it never changes after the HistoryURLProvider is initialized. |
| 319 // It's used to aid the transition to get all URLs from history to | 325 // It's used to aid the transition to get all URLs from history to |
| 320 // be scored in the HistoryQuick provider only. | 326 // be scored in the HistoryQuick provider only. |
| 321 bool search_url_database_; | 327 bool search_url_database_; |
| 322 }; | 328 }; |
| 323 | 329 |
| 324 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ | 330 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ |
| OLD | NEW |