| 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_IN_MEMORY_URL_INDEX_TYPES_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_ |
| 6 #define COMPONENTS_OMNIBOX_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/containers/hash_tables.h" | |
| 13 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 14 #include "components/history/core/browser/history_types.h" | 13 #include "components/history/core/browser/history_types.h" |
| 15 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 16 | 15 |
| 17 // Matches within URL and Title Strings ---------------------------------------- | 16 // Matches within URL and Title Strings ---------------------------------------- |
| 18 | 17 |
| 19 // Specifies where an omnibox term occurs within a string. Used for specifying | 18 // Specifies where an omnibox term occurs within a string. Used for specifying |
| 20 // highlights in AutocompleteMatches (ACMatchClassifications) and to assist in | 19 // highlights in AutocompleteMatches (ACMatchClassifications) and to assist in |
| 21 // scoring a result. | 20 // scoring a result. |
| 22 struct TermMatch { | 21 struct TermMatch { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 history::URLRow url_row; | 146 history::URLRow url_row; |
| 148 | 147 |
| 149 // This field gets filled in asynchronously after a visit. As such, | 148 // This field gets filled in asynchronously after a visit. As such, |
| 150 // it's almost always correct. If it's wrong, it's likely to either | 149 // it's almost always correct. If it's wrong, it's likely to either |
| 151 // be empty (if this URL was recently added to the index) or | 150 // be empty (if this URL was recently added to the index) or |
| 152 // slightly out-of-date (one visit behind). | 151 // slightly out-of-date (one visit behind). |
| 153 VisitInfoVector visits; | 152 VisitInfoVector visits; |
| 154 }; | 153 }; |
| 155 | 154 |
| 156 // A map from history_id to the history's URL and title. | 155 // A map from history_id to the history's URL and title. |
| 157 typedef base::hash_map<HistoryID, HistoryInfoMapValue> HistoryInfoMap; | 156 typedef std::map<HistoryID, HistoryInfoMapValue> HistoryInfoMap; |
| 158 | 157 |
| 159 // A map from history_id to URL and page title word start metrics. | 158 // A map from history_id to URL and page title word start metrics. |
| 160 struct RowWordStarts { | 159 struct RowWordStarts { |
| 161 RowWordStarts(); | 160 RowWordStarts(); |
| 162 ~RowWordStarts(); | 161 ~RowWordStarts(); |
| 163 | 162 |
| 164 // Clears both url_word_starts_ and title_word_starts_. | 163 // Clears both url_word_starts_ and title_word_starts_. |
| 165 void Clear(); | 164 void Clear(); |
| 166 | 165 |
| 167 WordStarts url_word_starts_; | 166 WordStarts url_word_starts_; |
| 168 WordStarts title_word_starts_; | 167 WordStarts title_word_starts_; |
| 169 }; | 168 }; |
| 170 typedef std::map<HistoryID, RowWordStarts> WordStartsMap; | 169 typedef std::map<HistoryID, RowWordStarts> WordStartsMap; |
| 171 | 170 |
| 172 #endif // COMPONENTS_OMNIBOX_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_ | 171 #endif // COMPONENTS_OMNIBOX_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_ |
| OLD | NEW |