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 #ifndef CHROME_BROWSER_HISTORY_SCORED_HISTORY_MATCH_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_SCORED_HISTORY_MATCH_H_ |
| 6 #define CHROME_BROWSER_HISTORY_SCORED_HISTORY_MATCH_H_ | 6 #define CHROME_BROWSER_HISTORY_SCORED_HISTORY_MATCH_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 | 23 |
| 24 // An HistoryMatch that has a score as well as metrics defining where in the | 24 // An HistoryMatch that has a score as well as metrics defining where in the |
| 25 // history item's URL and/or page title matches have occurred. | 25 // history item's URL and/or page title matches have occurred. |
| 26 class ScoredHistoryMatch : public history::HistoryMatch { | 26 class ScoredHistoryMatch : public history::HistoryMatch { |
| 27 public: | 27 public: |
| 28 // The maximum number of recent visits to examine in GetFrecency(). | 28 // The maximum number of recent visits to examine in GetFrecency(). |
| 29 // Public so url_index_private_data.cc knows how many visits it is | 29 // Public so url_index_private_data.cc knows how many visits it is |
| 30 // expected to deliver (at minimum) to this class. | 30 // expected to deliver (at minimum) to this class. |
| 31 static const size_t kMaxVisitsToScore; | 31 static const size_t kMaxVisitsToScore; |
| 32 | 32 |
| 33 //These values are duplicated from the HistoryURLProvider | |
|
sdefresne
2014/05/22 12:39:23
Those constants are only used on scored_history_ma
| |
| 34 static const int kScoreForBestInlineableResult; | |
| 35 static const int kScoreForUnvisitedIntranetResult; | |
| 36 static const int kScoreForWhatYouTypedResult; | |
| 37 static const int kBaseScoreForNonInlineableResult; | |
| 38 | |
| 33 ScoredHistoryMatch(); // Required by STL. | 39 ScoredHistoryMatch(); // Required by STL. |
| 34 | 40 |
| 35 // Creates a new match with a raw score calculated for the history item | 41 // Creates a new match with a raw score calculated for the history item |
| 36 // given in |row| with recent visits as indicated in |visits|. First | 42 // given in |row| with recent visits as indicated in |visits|. First |
| 37 // determines if the row qualifies by seeing if all of the terms in | 43 // determines if the row qualifies by seeing if all of the terms in |
| 38 // |terms_vector| occur in |row|. If so, calculates a raw score. This raw | 44 // |terms_vector| occur in |row|. If so, calculates a raw score. This raw |
| 39 // score is in part determined by whether the matches occur at word | 45 // score is in part determined by whether the matches occur at word |
| 40 // boundaries, the locations of which are stored in |word_starts|. For some | 46 // boundaries, the locations of which are stored in |word_starts|. For some |
| 41 // terms, it's appropriate to look for the word boundary within the term. | 47 // terms, it's appropriate to look for the word boundary within the term. |
| 42 // For instance, the term ".net" should look for a word boundary at the "n". | 48 // For instance, the term ".net" should look for a word boundary at the "n". |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 // matches) because if a non-inlineable match comes first than all matches | 206 // matches) because if a non-inlineable match comes first than all matches |
| 201 // will get demoted later in HistoryQuickProvider to non-inlineable scores. | 207 // will get demoted later in HistoryQuickProvider to non-inlineable scores. |
| 202 // Set to -1 to indicate no maximum score. | 208 // Set to -1 to indicate no maximum score. |
| 203 static int max_assigned_score_for_non_inlineable_matches_; | 209 static int max_assigned_score_for_non_inlineable_matches_; |
| 204 }; | 210 }; |
| 205 typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches; | 211 typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches; |
| 206 | 212 |
| 207 } // namespace history | 213 } // namespace history |
| 208 | 214 |
| 209 #endif // CHROME_BROWSER_HISTORY_SCORED_HISTORY_MATCH_H_ | 215 #endif // CHROME_BROWSER_HISTORY_SCORED_HISTORY_MATCH_H_ |
| OLD | NEW |