| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // Term matches within the URL. | 98 // Term matches within the URL. |
| 99 TermMatches url_matches; | 99 TermMatches url_matches; |
| 100 // Term matches within the page title. | 100 // Term matches within the page title. |
| 101 TermMatches title_matches; | 101 TermMatches title_matches; |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 friend class ScoredHistoryMatchTest; | 104 friend class ScoredHistoryMatchTest; |
| 105 FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, GetFinalRelevancyScore); | 105 FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, GetFinalRelevancyScore); |
| 106 FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, GetHQPBucketsFromString); | 106 FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, GetHQPBucketsFromString); |
| 107 FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, ScoringBookmarks); | 107 FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, ScoringBookmarks); |
| 108 FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, ScoringPort); |
| 108 FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, ScoringScheme); | 109 FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, ScoringScheme); |
| 109 FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, ScoringTLD); | 110 FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, ScoringTLD); |
| 110 | 111 |
| 111 // Initialize ScoredHistoryMatch statics. Must be called before any other | 112 // Initialize ScoredHistoryMatch statics. Must be called before any other |
| 112 // method of ScoredHistoryMatch and before creating any instances. | 113 // method of ScoredHistoryMatch and before creating any instances. |
| 113 static void Init(); | 114 static void Init(); |
| 114 | 115 |
| 115 // Return a topicality score based on how many matches appear in the url and | 116 // Return a topicality score based on how many matches appear in the url and |
| 116 // the page's title and where they are (e.g., at word boundaries). Revises | 117 // the page's title and where they are (e.g., at word boundaries). Revises |
| 117 // url_matches and title_matches in the process so they only reflect matches | 118 // url_matches and title_matches in the process so they only reflect matches |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 static char hqp_relevance_buckets_str_[]; | 196 static char hqp_relevance_buckets_str_[]; |
| 196 | 197 |
| 197 // |hqp_relevance_buckets_| gives mapping from (topicality*frequency) | 198 // |hqp_relevance_buckets_| gives mapping from (topicality*frequency) |
| 198 // to the final relevance scoring. Please see GetFinalRelevancyScore() | 199 // to the final relevance scoring. Please see GetFinalRelevancyScore() |
| 199 // for more details and scoring method. | 200 // for more details and scoring method. |
| 200 static std::vector<ScoreMaxRelevance>* hqp_relevance_buckets_; | 201 static std::vector<ScoreMaxRelevance>* hqp_relevance_buckets_; |
| 201 }; | 202 }; |
| 202 typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches; | 203 typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches; |
| 203 | 204 |
| 204 #endif // COMPONENTS_OMNIBOX_BROWSER_SCORED_HISTORY_MATCH_H_ | 205 #endif // COMPONENTS_OMNIBOX_BROWSER_SCORED_HISTORY_MATCH_H_ |
| OLD | NEW |