OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_HISTORY_CORE_BROWSER_URL_DATABASE_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_URL_DATABASE_H_ |
6 #define COMPONENTS_HISTORY_CORE_BROWSER_URL_DATABASE_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_URL_DATABASE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 bool GetNextURL(URLRow* r); | 143 bool GetNextURL(URLRow* r); |
144 | 144 |
145 private: | 145 private: |
146 DISALLOW_COPY_AND_ASSIGN(URLEnumerator); | 146 DISALLOW_COPY_AND_ASSIGN(URLEnumerator); |
147 }; | 147 }; |
148 | 148 |
149 // Initializes the given enumerator to enumerator all URLs in the database. | 149 // Initializes the given enumerator to enumerator all URLs in the database. |
150 bool InitURLEnumeratorForEverything(URLEnumerator* enumerator); | 150 bool InitURLEnumeratorForEverything(URLEnumerator* enumerator); |
151 | 151 |
152 // Initializes the given enumerator to enumerator all URLs in the database | 152 // Initializes the given enumerator to enumerator all URLs in the database |
153 // that are historically significant: ones having been visited within 3 days, | 153 // that are historically significant: ones having their URL manually typed |
154 // having their URL manually typed more than once, or having been visited | 154 // more than once, having been visited within 3 days, or having been visited |
155 // more than 3 times. | 155 // more than 3 times in the order of the most significant ones first. |
156 bool InitURLEnumeratorForSignificant(URLEnumerator* enumerator); | 156 bool InitURLEnumeratorForSignificant(URLEnumerator* enumerator); |
157 | 157 |
158 // Autocomplete -------------------------------------------------------------- | 158 // Autocomplete -------------------------------------------------------------- |
159 | 159 |
160 // Fills the given array with URLs matching the given prefix. They will be | 160 // Fills the given array with URLs matching the given prefix. They will be |
161 // sorted by typed count, then by visit count, then by visit date (most recent | 161 // sorted by typed count, then by visit count, then by visit date (most recent |
162 // first) up to the given maximum number. If |typed_only| is true, only urls | 162 // first) up to the given maximum number. If |typed_only| is true, only urls |
163 // that have been typed once are returned. For caller convenience, returns | 163 // that have been typed once are returned. For caller convenience, returns |
164 // whether any results were found. | 164 // whether any results were found. |
165 bool AutocompleteForPrefix(const std::string& prefix, | 165 bool AutocompleteForPrefix(const std::string& prefix, |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 // is_null() then this function determines a new time threshold each time it is | 329 // is_null() then this function determines a new time threshold each time it is |
330 // called. Since getting system time can be costly (such as for cases where | 330 // called. Since getting system time can be costly (such as for cases where |
331 // this function will be called in a loop over many history items), you can | 331 // this function will be called in a loop over many history items), you can |
332 // provide a non-null |time_cache| by simply initializing |time_cache| with | 332 // provide a non-null |time_cache| by simply initializing |time_cache| with |
333 // AutocompleteAgeThreshold() (or any other desired time in the past). | 333 // AutocompleteAgeThreshold() (or any other desired time in the past). |
334 bool RowQualifiesAsSignificant(const URLRow& row, const base::Time& threshold); | 334 bool RowQualifiesAsSignificant(const URLRow& row, const base::Time& threshold); |
335 | 335 |
336 } // namespace history | 336 } // namespace history |
337 | 337 |
338 #endif // COMPONENTS_HISTORY_CORE_BROWSER_URL_DATABASE_H_ | 338 #endif // COMPONENTS_HISTORY_CORE_BROWSER_URL_DATABASE_H_ |
OLD | NEW |