| 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 COMPONENTS_OMNIBOX_BROWSER_SCORED_HISTORY_MATCH_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_SCORED_HISTORY_MATCH_H_ |
| 6 #define COMPONENTS_OMNIBOX_BROWSER_SCORED_HISTORY_MATCH_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_SCORED_HISTORY_MATCH_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // both those constraints are true, calculates a raw score. This raw score | 41 // both those constraints are true, calculates a raw score. This raw score |
| 42 // is in part determined by whether the matches occur at word boundaries, the | 42 // is in part determined by whether the matches occur at word boundaries, the |
| 43 // locations of which are stored in |word_starts|. For some terms, it's | 43 // locations of which are stored in |word_starts|. For some terms, it's |
| 44 // appropriate to look for the word boundary within the term. For instance, | 44 // appropriate to look for the word boundary within the term. For instance, |
| 45 // the term ".net" should look for a word boundary at the "n". These offsets | 45 // the term ".net" should look for a word boundary at the "n". These offsets |
| 46 // (".net" should have an offset of 1) come from | 46 // (".net" should have an offset of 1) come from |
| 47 // |terms_to_word_starts_offsets|. |is_url_bookmarked| indicates whether the | 47 // |terms_to_word_starts_offsets|. |is_url_bookmarked| indicates whether the |
| 48 // match's URL is referenced by any bookmarks, which can also affect the raw | 48 // match's URL is referenced by any bookmarks, which can also affect the raw |
| 49 // score. The raw score allows the matches to be ordered and can be used to | 49 // score. The raw score allows the matches to be ordered and can be used to |
| 50 // influence the final score calculated by the client of this index. If the | 50 // influence the final score calculated by the client of this index. If the |
| 51 // row does not qualify the raw score will be 0. |languages| is used to help | 51 // row does not qualify the raw score will be 0. |
| 52 // parse/format the URL before looking for the terms. | |
| 53 ScoredHistoryMatch(const history::URLRow& row, | 52 ScoredHistoryMatch(const history::URLRow& row, |
| 54 const VisitInfoVector& visits, | 53 const VisitInfoVector& visits, |
| 55 const std::string& languages, | |
| 56 const base::string16& lower_string, | 54 const base::string16& lower_string, |
| 57 const String16Vector& terms_vector, | 55 const String16Vector& terms_vector, |
| 58 const WordStarts& terms_to_word_starts_offsets, | 56 const WordStarts& terms_to_word_starts_offsets, |
| 59 const RowWordStarts& word_starts, | 57 const RowWordStarts& word_starts, |
| 60 bool is_url_bookmarked, | 58 bool is_url_bookmarked, |
| 61 TemplateURLService* template_url_service, | 59 TemplateURLService* template_url_service, |
| 62 base::Time now); | 60 base::Time now); |
| 63 | 61 |
| 64 ~ScoredHistoryMatch(); | 62 ~ScoredHistoryMatch(); |
| 65 | 63 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 static char hqp_relevance_buckets_str_[]; | 195 static char hqp_relevance_buckets_str_[]; |
| 198 | 196 |
| 199 // |hqp_relevance_buckets_| gives mapping from (topicality*frequency) | 197 // |hqp_relevance_buckets_| gives mapping from (topicality*frequency) |
| 200 // to the final relevance scoring. Please see GetFinalRelevancyScore() | 198 // to the final relevance scoring. Please see GetFinalRelevancyScore() |
| 201 // for more details and scoring method. | 199 // for more details and scoring method. |
| 202 static std::vector<ScoreMaxRelevance>* hqp_relevance_buckets_; | 200 static std::vector<ScoreMaxRelevance>* hqp_relevance_buckets_; |
| 203 }; | 201 }; |
| 204 typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches; | 202 typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches; |
| 205 | 203 |
| 206 #endif // COMPONENTS_OMNIBOX_BROWSER_SCORED_HISTORY_MATCH_H_ | 204 #endif // COMPONENTS_OMNIBOX_BROWSER_SCORED_HISTORY_MATCH_H_ |
| OLD | NEW |