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_HISTORY_TYPES_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_TYPES_H_ |
6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_TYPES_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_TYPES_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
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 // The segment id (see visitsegment_database.*). | 91 // The segment id (see visitsegment_database.*). |
92 // If 0, the segment id is null in the table. | 92 // If 0, the segment id is null in the table. |
93 SegmentID segment_id; | 93 SegmentID segment_id; |
94 | 94 |
95 // Record how much time a user has this visit starting from the user | 95 // Record how much time a user has this visit starting from the user |
96 // opened this visit to the user closed or ended this visit. | 96 // opened this visit to the user closed or ended this visit. |
97 // This includes both active and inactive time as long as | 97 // This includes both active and inactive time as long as |
98 // the visit was present. | 98 // the visit was present. |
99 base::TimeDelta visit_duration; | 99 base::TimeDelta visit_duration; |
100 | 100 HistoryContext context; |
101 // Compares two visits based on dates, for sorting. | 101 // Compares two visits based on dates, for sorting. |
102 bool operator<(const VisitRow& other) { | 102 bool operator<(const VisitRow& other) { |
103 return visit_time < other.visit_time; | 103 return visit_time < other.visit_time; |
104 } | 104 } |
105 | 105 |
106 // We allow the implicit copy constuctor and operator=. | 106 // We allow the implicit copy constuctor and operator=. |
107 }; | 107 }; |
108 | 108 |
109 // We pass around vectors of visits a lot | 109 // We pass around vectors of visits a lot |
110 typedef std::vector<VisitRow> VisitVector; | 110 typedef std::vector<VisitRow> VisitVector; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 // The time range to search for matches in. The beginning is inclusive and | 234 // The time range to search for matches in. The beginning is inclusive and |
235 // the ending is exclusive. Either one (or both) may be null. | 235 // the ending is exclusive. Either one (or both) may be null. |
236 // | 236 // |
237 // This will match only the one recent visit of a URL. For text search | 237 // This will match only the one recent visit of a URL. For text search |
238 // queries, if the URL was visited in the given time period, but has also | 238 // queries, if the URL was visited in the given time period, but has also |
239 // been visited more recently than that, it will not be returned. When the | 239 // been visited more recently than that, it will not be returned. When the |
240 // text query is empty, this will return the most recent visit within the | 240 // text query is empty, this will return the most recent visit within the |
241 // time range. | 241 // time range. |
242 base::Time begin_time; | 242 base::Time begin_time; |
243 base::Time end_time; | 243 base::Time end_time; |
244 | 244 HistoryContext context; |
245 // Sets the query time to the last |days_ago| days to the present time. | 245 // Sets the query time to the last |days_ago| days to the present time. |
246 void SetRecentDayRange(int days_ago); | 246 void SetRecentDayRange(int days_ago); |
247 | 247 |
248 // The maximum number of results to return. The results will be sorted with | 248 // The maximum number of results to return. The results will be sorted with |
249 // the most recent first, so older results may not be returned if there is not | 249 // the most recent first, so older results may not be returned if there is not |
250 // enough room. When 0, this will return everything (the default). | 250 // enough room. When 0, this will return everything (the default). |
251 int max_count; | 251 int max_count; |
252 | 252 |
253 enum DuplicateHandling { | 253 enum DuplicateHandling { |
254 // Omit visits for which there is a more recent visit to the same URL. | 254 // Omit visits for which there is a more recent visit to the same URL. |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 void SetTimeRangeForOneDay(base::Time time); | 516 void SetTimeRangeForOneDay(base::Time time); |
517 | 517 |
518 std::set<GURL> urls; | 518 std::set<GURL> urls; |
519 base::Time begin_time; | 519 base::Time begin_time; |
520 base::Time end_time; | 520 base::Time end_time; |
521 }; | 521 }; |
522 | 522 |
523 } // namespace history | 523 } // namespace history |
524 | 524 |
525 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_TYPES_H_ | 525 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_TYPES_H_ |
OLD | NEW |