OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_HISTORY_VISIT_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_VISIT_DATABASE_H_ |
6 #define CHROME_BROWSER_HISTORY_VISIT_DATABASE_H_ | 6 #define CHROME_BROWSER_HISTORY_VISIT_DATABASE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/history/history_types.h" | 9 #include "chrome/browser/history/history_types.h" |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 bool GetRedirectFromVisit(VisitID from_visit, | 127 bool GetRedirectFromVisit(VisitID from_visit, |
128 VisitID* to_visit, | 128 VisitID* to_visit, |
129 GURL* to_url); | 129 GURL* to_url); |
130 | 130 |
131 // Similar to the above function except finds a redirect going to a given | 131 // Similar to the above function except finds a redirect going to a given |
132 // |to_visit|. | 132 // |to_visit|. |
133 bool GetRedirectToVisit(VisitID to_visit, | 133 bool GetRedirectToVisit(VisitID to_visit, |
134 VisitID* from_visit, | 134 VisitID* from_visit, |
135 GURL* from_url); | 135 GURL* from_url); |
136 | 136 |
137 // Returns the number of visits to all urls on the scheme/host/post | 137 // Gets the number of user-visible visits to all URLs on the same |
138 // identified by url. This is only valid for http and https urls (all other | 138 // scheme/host/port as |url|, as well as the time of the earliest visit. |
139 // schemes are ignored and false is returned). | 139 // "User-visible" is defined as in GetVisibleVisitsInRange() above, i.e. |
140 // count is set to the number of visits, first_visit is set to the first time | 140 // excluding redirects and subframes. |
141 // the host was visited. Returns true on success. | 141 // This function is only valid for HTTP and HTTPS URLs; all other schemes |
142 bool GetVisitCountToHost(const GURL& url, int* count, | 142 // cause the function to return false. |
143 base::Time* first_visit); | 143 bool GetVisibleVisitCountToHost(const GURL& url, |
| 144 int* count, |
| 145 base::Time* first_visit); |
144 | 146 |
145 // Get the time of the first item in our database. | 147 // Get the time of the first item in our database. |
146 bool GetStartDate(base::Time* first_visit); | 148 bool GetStartDate(base::Time* first_visit); |
147 | 149 |
148 // Get the source information about the given visits. | 150 // Get the source information about the given visits. |
149 void GetVisitsSource(const VisitVector& visits, | 151 void GetVisitsSource(const VisitVector& visits, |
150 VisitSourceMap* sources); | 152 VisitSourceMap* sources); |
151 | 153 |
152 protected: | 154 protected: |
153 // Returns the database for the functions in this interface. | 155 // Returns the database for the functions in this interface. |
(...skipping 11 matching lines...) Expand all Loading... |
165 // hasn't happened yet. | 167 // hasn't happened yet. |
166 static void FillVisitVector(sql::Statement& statement, VisitVector* visits); | 168 static void FillVisitVector(sql::Statement& statement, VisitVector* visits); |
167 | 169 |
168 private: | 170 private: |
169 DISALLOW_COPY_AND_ASSIGN(VisitDatabase); | 171 DISALLOW_COPY_AND_ASSIGN(VisitDatabase); |
170 }; | 172 }; |
171 | 173 |
172 } // history | 174 } // history |
173 | 175 |
174 #endif // CHROME_BROWSER_HISTORY_VISIT_DATABASE_H_ | 176 #endif // CHROME_BROWSER_HISTORY_VISIT_DATABASE_H_ |
OLD | NEW |