| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 // Pre-calculates days_ago_to_recency_numerator_, used in | 91 // Pre-calculates days_ago_to_recency_numerator_, used in |
| 92 // GetRecencyScore(). | 92 // GetRecencyScore(). |
| 93 static void FillInDaysAgoToRecencyScoreArray(); | 93 static void FillInDaysAgoToRecencyScoreArray(); |
| 94 | 94 |
| 95 // Returns a popularity score based on |typed_count| and | 95 // Returns a popularity score based on |typed_count| and |
| 96 // |visit_count|. | 96 // |visit_count|. |
| 97 static float GetPopularityScore(int typed_count, | 97 static float GetPopularityScore(int typed_count, |
| 98 int visit_count); | 98 int visit_count); |
| 99 | 99 |
| 100 // Sets use_new_scoring based on command line flags and/or |
| 101 // field trial state. |
| 102 static void InitializeNewScoringField(); |
| 103 |
| 100 // End of functions used only in "new" scoring -------------------------- | 104 // End of functions used only in "new" scoring -------------------------- |
| 101 | 105 |
| 102 // An interim score taking into consideration location and completeness | 106 // An interim score taking into consideration location and completeness |
| 103 // of the match. | 107 // of the match. |
| 104 int raw_score; | 108 int raw_score; |
| 105 TermMatches url_matches; // Term matches within the URL. | 109 TermMatches url_matches; // Term matches within the URL. |
| 106 TermMatches title_matches; // Term matches within the page title. | 110 TermMatches title_matches; // Term matches within the page title. |
| 107 bool can_inline; // True if this is a candidate for in-line autocompletion. | 111 bool can_inline; // True if this is a candidate for in-line autocompletion. |
| 108 | 112 |
| 109 // Pre-computed information to speed up calculating recency scores. | 113 // Pre-computed information to speed up calculating recency scores. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 131 | 135 |
| 132 // Whether to use new-score or old-scoring. Set in the constructor | 136 // Whether to use new-score or old-scoring. Set in the constructor |
| 133 // by examining command line flags. | 137 // by examining command line flags. |
| 134 static bool use_new_scoring; | 138 static bool use_new_scoring; |
| 135 }; | 139 }; |
| 136 typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches; | 140 typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches; |
| 137 | 141 |
| 138 } // namespace history | 142 } // namespace history |
| 139 | 143 |
| 140 #endif // CHROME_BROWSER_HISTORY_SCORED_HISTORY_MATCH_H_ | 144 #endif // CHROME_BROWSER_HISTORY_SCORED_HISTORY_MATCH_H_ |
| OLD | NEW |