| 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 CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
| 6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 263 |
| 264 // Called when the results of QueryRedirectsFrom are available. | 264 // Called when the results of QueryRedirectsFrom are available. |
| 265 // The given vector will contain a list of all redirects, not counting | 265 // The given vector will contain a list of all redirects, not counting |
| 266 // the original page. If A redirects to B which redirects to C, the vector | 266 // the original page. If A redirects to B which redirects to C, the vector |
| 267 // will contain [B, C], and A will be in 'from_url'. | 267 // will contain [B, C], and A will be in 'from_url'. |
| 268 // | 268 // |
| 269 // For QueryRedirectsTo, the order is reversed. For A->B->C, the vector will | 269 // For QueryRedirectsTo, the order is reversed. For A->B->C, the vector will |
| 270 // contain [B, A] and C will be in 'to_url'. | 270 // contain [B, A] and C will be in 'to_url'. |
| 271 // | 271 // |
| 272 // If there is no such URL in the database or the most recent visit has no | 272 // If there is no such URL in the database or the most recent visit has no |
| 273 // redirect, the vector will be empty. If the history system failed for | 273 // redirect, the vector will be empty. If the given page has redirected to |
| 274 // some reason, success will additionally be false. If the given page | 274 // multiple destinations, this will pick a random one. |
| 275 // has redirected to multiple destinations, this will pick a random one. | 275 typedef base::Callback<void(const history::RedirectList*)> |
| 276 typedef base::Callback<void(Handle, | 276 QueryRedirectsCallback; |
| 277 GURL, // from_url / to_url | |
| 278 bool, // success | |
| 279 history::RedirectList*)> QueryRedirectsCallback; | |
| 280 | 277 |
| 281 // Schedules a query for the most recent redirect coming out of the given | 278 // Schedules a query for the most recent redirect coming out of the given |
| 282 // URL. See the RedirectQuerySource above, which is guaranteed to be called | 279 // URL. See the RedirectQuerySource above, which is guaranteed to be called |
| 283 // if the request is not canceled. | 280 // if the request is not canceled. |
| 284 Handle QueryRedirectsFrom(const GURL& from_url, | 281 base::CancelableTaskTracker::TaskId QueryRedirectsFrom( |
| 285 CancelableRequestConsumerBase* consumer, | 282 const GURL& from_url, |
| 286 const QueryRedirectsCallback& callback); | 283 const QueryRedirectsCallback& callback, |
| 284 base::CancelableTaskTracker* tracker); |
| 287 | 285 |
| 288 // Schedules a query to get the most recent redirects ending at the given | 286 // Schedules a query to get the most recent redirects ending at the given |
| 289 // URL. | 287 // URL. |
| 290 Handle QueryRedirectsTo(const GURL& to_url, | 288 base::CancelableTaskTracker::TaskId QueryRedirectsTo( |
| 291 CancelableRequestConsumerBase* consumer, | 289 const GURL& to_url, |
| 292 const QueryRedirectsCallback& callback); | 290 const QueryRedirectsCallback& callback, |
| 291 base::CancelableTaskTracker* tracker); |
| 293 | 292 |
| 294 typedef base::Callback< | 293 typedef base::Callback< |
| 295 void(Handle, | 294 void(Handle, |
| 296 bool, // Were we able to determine the # of visits? | 295 bool, // Were we able to determine the # of visits? |
| 297 int, // Number of visits. | 296 int, // Number of visits. |
| 298 base::Time)> // Time of first visit. Only set if bool | 297 base::Time)> // Time of first visit. Only set if bool |
| 299 // is true and int is > 0. | 298 // is true and int is > 0. |
| 300 GetVisibleVisitCountToHostCallback; | 299 GetVisibleVisitCountToHostCallback; |
| 301 | 300 |
| 302 // Requests the number of user-visible visits (i.e. no redirects or subframes) | 301 // Requests the number of user-visible visits (i.e. no redirects or subframes) |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 1033 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; |
| 1035 | 1034 |
| 1036 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; | 1035 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; |
| 1037 | 1036 |
| 1038 history::DeleteDirectiveHandler delete_directive_handler_; | 1037 history::DeleteDirectiveHandler delete_directive_handler_; |
| 1039 | 1038 |
| 1040 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 1039 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
| 1041 }; | 1040 }; |
| 1042 | 1041 |
| 1043 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 1042 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
| OLD | NEW |