OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_AUTOCOMPLETE_HISTORY_PROVIDER_UTIL_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_UTIL_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_UTIL_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <vector> | 10 #include <vector> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // A match after any scheme/"www.", if the user input could match at both | 50 // A match after any scheme/"www.", if the user input could match at both |
51 // locations. If the user types "w", an innermost match ("website.com") is | 51 // locations. If the user types "w", an innermost match ("website.com") is |
52 // better than a non-innermost match ("www.google.com"). If the user types | 52 // better than a non-innermost match ("www.google.com"). If the user types |
53 // "x", no scheme in our prefix list (or "www.") begins with x, so all | 53 // "x", no scheme in our prefix list (or "www.") begins with x, so all |
54 // matches are, vacuously, "innermost matches". | 54 // matches are, vacuously, "innermost matches". |
55 bool innermost_match; | 55 bool innermost_match; |
56 }; | 56 }; |
57 typedef std::deque<HistoryMatch> HistoryMatches; | 57 typedef std::deque<HistoryMatch> HistoryMatches; |
58 | 58 |
59 struct Prefix { | 59 struct Prefix { |
60 Prefix(const std::wstring& prefix, int num_components) | 60 Prefix(const string16& prefix, int num_components) |
61 : prefix(prefix), | 61 : prefix(prefix), |
62 num_components(num_components) {} | 62 num_components(num_components) {} |
63 | 63 |
64 std::wstring prefix; | 64 string16 prefix; |
65 | 65 |
66 // The number of "components" in the prefix. The scheme is a component, | 66 // The number of "components" in the prefix. The scheme is a component, |
67 // and the initial "www." or "ftp." is a component. So "http://foo.com" | 67 // and the initial "www." or "ftp." is a component. So "http://foo.com" |
68 // and "www.bar.com" each have one component, "ftp://ftp.ftp.com" has two, | 68 // and "www.bar.com" each have one component, "ftp://ftp.ftp.com" has two, |
69 // and "mysite.com" has none. This is used to tell whether the user's | 69 // and "mysite.com" has none. This is used to tell whether the user's |
70 // input is an innermost match or not. See comments in HistoryMatch. | 70 // input is an innermost match or not. See comments in HistoryMatch. |
71 int num_components; | 71 int num_components; |
72 }; | 72 }; |
73 typedef std::vector<Prefix> Prefixes; | 73 typedef std::vector<Prefix> Prefixes; |
74 | 74 |
75 // Returns the date threshold for considering an history item as significant. | 75 // Returns the date threshold for considering an history item as significant. |
76 base::Time AutocompleteAgeThreshold(); | 76 base::Time AutocompleteAgeThreshold(); |
77 | 77 |
78 } | 78 } |
79 | 79 |
80 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_UTIL_H_ | 80 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_UTIL_H_ |
OLD | NEW |