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 |
| 182 // range. "User-visible" is defined as in GetVisibleVisitsInRange() above, |
| 183 // i.e. excluding redirects and subframes. Also, if a URL is visited in |
| 184 // multiple days, the URL is counted once for each day. For determination |
| 185 // of the date, timestamps are converted to dates using local time. |
| 186 int GetHistoryCount(); |
| 187 |
181 // Get the time of the first item in our database. | 188 // Get the time of the first item in our database. |
182 bool GetStartDate(base::Time* first_visit); | 189 bool GetStartDate(base::Time* first_visit); |
183 | 190 |
184 // Get the source information about the given visits. | 191 // Get the source information about the given visits. |
185 void GetVisitsSource(const VisitVector& visits, | 192 void GetVisitsSource(const VisitVector& visits, |
186 VisitSourceMap* sources); | 193 VisitSourceMap* sources); |
187 | 194 |
188 protected: | 195 protected: |
189 // Returns the database for the functions in this interface. | 196 // Returns the database for the functions in this interface. |
190 virtual sql::Connection& GetDB() = 0; | 197 virtual sql::Connection& GetDB() = 0; |
(...skipping 27 matching lines...) Expand all Loading... |
218 DISALLOW_COPY_AND_ASSIGN(VisitDatabase); | 225 DISALLOW_COPY_AND_ASSIGN(VisitDatabase); |
219 }; | 226 }; |
220 | 227 |
221 // Rows, in order, of the visit table. | 228 // Rows, in order, of the visit table. |
222 #define HISTORY_VISIT_ROW_FIELDS \ | 229 #define HISTORY_VISIT_ROW_FIELDS \ |
223 " id,url,visit_time,from_visit,transition,segment_id,visit_duration " | 230 " id,url,visit_time,from_visit,transition,segment_id,visit_duration " |
224 | 231 |
225 } // namespace history | 232 } // namespace history |
226 | 233 |
227 #endif // COMPONENTS_HISTORY_CORE_BROWSER_VISIT_DATABASE_H_ | 234 #endif // COMPONENTS_HISTORY_CORE_BROWSER_VISIT_DATABASE_H_ |
OLD | NEW |