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_HISTORY_CORE_BROWSER_VISIT_DATABASE_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_VISIT_DATABASE_H_ |
6 #define COMPONENTS_HISTORY_CORE_BROWSER_VISIT_DATABASE_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_VISIT_DATABASE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "components/history/core/browser/history_types.h" | 10 #include "components/history/core/browser/history_types.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // Gets the number of user-visible visits to all URLs on the same | 171 // Gets the number of user-visible visits to all URLs on the same |
172 // scheme/host/port as |url|, as well as the time of the earliest visit. | 172 // scheme/host/port as |url|, as well as the time of the earliest visit. |
173 // "User-visible" is defined as in GetVisibleVisitsInRange() above, i.e. | 173 // "User-visible" is defined as in GetVisibleVisitsInRange() above, i.e. |
174 // excluding redirects and subframes. | 174 // excluding redirects and subframes. |
175 // This function is only valid for HTTP and HTTPS URLs; all other schemes | 175 // This function is only valid for HTTP and HTTPS URLs; all other schemes |
176 // cause the function to return false. | 176 // cause the function to return false. |
177 bool GetVisibleVisitCountToHost(const GURL& url, | 177 bool GetVisibleVisitCountToHost(const GURL& url, |
178 int* count, | 178 int* count, |
179 base::Time* first_visit); | 179 base::Time* first_visit); |
180 | 180 |
181 // Gets the number of URLs as seen in chrome://history with infinite date | 181 // Gets the number of URLs as seen in chrome://history within the time |
182 // range. "User-visible" is defined as in GetVisibleVisitsInRange() above, | 182 // range [|begin_time|, |end_time|). "User-visible" is defined as in |
183 // i.e. excluding redirects and subframes. Also, if a URL is visited in | 183 // GetVisibleVisitsInRange() above, i.e. excluding redirects and subframes. |
184 // multiple days, the URL is counted once for each day. For determination | 184 // Each URL is counted only once per day. For determination of the date, |
185 // of the date, timestamps are converted to dates using local time. | 185 // timestamps are converted to dates using local time. Returns false if |
186 // Returns false if there's a failure executing the statement. True otherwise. | 186 // there is a failure executing the statement. True otherwise. |
187 bool GetHistoryCount(int* count); | 187 bool GetHistoryCount(const base::Time& begin_time, |
| 188 const base::Time& end_time, |
| 189 int* count); |
188 | 190 |
189 // Get the time of the first item in our database. | 191 // Get the time of the first item in our database. |
190 bool GetStartDate(base::Time* first_visit); | 192 bool GetStartDate(base::Time* first_visit); |
191 | 193 |
192 // Get the source information about the given visits. | 194 // Get the source information about the given visits. |
193 void GetVisitsSource(const VisitVector& visits, | 195 void GetVisitsSource(const VisitVector& visits, |
194 VisitSourceMap* sources); | 196 VisitSourceMap* sources); |
195 | 197 |
196 protected: | 198 protected: |
197 // Returns the database for the functions in this interface. | 199 // Returns the database for the functions in this interface. |
(...skipping 28 matching lines...) Expand all Loading... |
226 DISALLOW_COPY_AND_ASSIGN(VisitDatabase); | 228 DISALLOW_COPY_AND_ASSIGN(VisitDatabase); |
227 }; | 229 }; |
228 | 230 |
229 // Rows, in order, of the visit table. | 231 // Rows, in order, of the visit table. |
230 #define HISTORY_VISIT_ROW_FIELDS \ | 232 #define HISTORY_VISIT_ROW_FIELDS \ |
231 " id,url,visit_time,from_visit,transition,segment_id,visit_duration " | 233 " id,url,visit_time,from_visit,transition,segment_id,visit_duration " |
232 | 234 |
233 } // namespace history | 235 } // namespace history |
234 | 236 |
235 #endif // COMPONENTS_HISTORY_CORE_BROWSER_VISIT_DATABASE_H_ | 237 #endif // COMPONENTS_HISTORY_CORE_BROWSER_VISIT_DATABASE_H_ |
OLD | NEW |