| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 GetVisibleVisitCountToHostCallback; | 299 GetVisibleVisitCountToHostCallback; |
| 300 | 300 |
| 301 // 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) |
| 302 // to all urls on the same scheme/host/port as |url|. This is only valid for | 302 // to all urls on the same scheme/host/port as |url|. This is only valid for |
| 303 // HTTP and HTTPS URLs. | 303 // HTTP and HTTPS URLs. |
| 304 Handle GetVisibleVisitCountToHost( | 304 Handle GetVisibleVisitCountToHost( |
| 305 const GURL& url, | 305 const GURL& url, |
| 306 CancelableRequestConsumerBase* consumer, | 306 CancelableRequestConsumerBase* consumer, |
| 307 const GetVisibleVisitCountToHostCallback& callback); | 307 const GetVisibleVisitCountToHostCallback& callback); |
| 308 | 308 |
| 309 // Called when QueryTopURLsAndRedirects completes. The vector contains a list | |
| 310 // of the top |result_count| URLs. For each of these URLs, there is an entry | |
| 311 // in the map containing redirects from the URL. For example, if we have the | |
| 312 // redirect chain A -> B -> C and A is a top visited URL, then A will be in | |
| 313 // the vector and "A => {B -> C}" will be in the map. | |
| 314 typedef base::Callback< | |
| 315 void(Handle, | |
| 316 bool, // Did we get the top urls and redirects? | |
| 317 std::vector<GURL>*, // List of top URLs. | |
| 318 history::RedirectMap*)> // Redirects for top URLs. | |
| 319 QueryTopURLsAndRedirectsCallback; | |
| 320 | |
| 321 // Request the top |result_count| most visited URLs and the chain of redirects | |
| 322 // leading to each of these URLs. | |
| 323 // TODO(Nik): remove this. Use QueryMostVisitedURLs instead. | |
| 324 Handle QueryTopURLsAndRedirects( | |
| 325 int result_count, | |
| 326 CancelableRequestConsumerBase* consumer, | |
| 327 const QueryTopURLsAndRedirectsCallback& callback); | |
| 328 | |
| 329 typedef base::Callback<void(Handle, history::MostVisitedURLList)> | |
| 330 QueryMostVisitedURLsCallback; | |
| 331 | |
| 332 typedef base::Callback<void(Handle, const history::FilteredURLList&)> | |
| 333 QueryFilteredURLsCallback; | |
| 334 | |
| 335 // Request the |result_count| most visited URLs and the chain of | 309 // Request the |result_count| most visited URLs and the chain of |
| 336 // redirects leading to each of these URLs. |days_back| is the | 310 // redirects leading to each of these URLs. |days_back| is the |
| 337 // number of days of history to use. Used by TopSites. | 311 // number of days of history to use. Used by TopSites. |
| 312 typedef base::Callback<void(Handle, history::MostVisitedURLList)> |
| 313 QueryMostVisitedURLsCallback; |
| 314 |
| 338 Handle QueryMostVisitedURLs(int result_count, int days_back, | 315 Handle QueryMostVisitedURLs(int result_count, int days_back, |
| 339 CancelableRequestConsumerBase* consumer, | 316 CancelableRequestConsumerBase* consumer, |
| 340 const QueryMostVisitedURLsCallback& callback); | 317 const QueryMostVisitedURLsCallback& callback); |
| 341 | 318 |
| 342 // Request the |result_count| URLs filtered and sorted based on the |filter|. | 319 // Request the |result_count| URLs filtered and sorted based on the |filter|. |
| 343 // If |extended_info| is true, additional data will be provided in the | 320 // If |extended_info| is true, additional data will be provided in the |
| 344 // results. Computing this additional data is expensive, likely to become | 321 // results. Computing this additional data is expensive, likely to become |
| 345 // more expensive as additional data points are added in future changes, and | 322 // more expensive as additional data points are added in future changes, and |
| 346 // not useful in most cases. Set |extended_info| to true only if you | 323 // not useful in most cases. Set |extended_info| to true only if you |
| 347 // explicitly require the additional data. | 324 // explicitly require the additional data. |
| 325 typedef base::Callback<void(Handle, const history::FilteredURLList&)> |
| 326 QueryFilteredURLsCallback; |
| 327 |
| 348 Handle QueryFilteredURLs( | 328 Handle QueryFilteredURLs( |
| 349 int result_count, | 329 int result_count, |
| 350 const history::VisitFilter& filter, | 330 const history::VisitFilter& filter, |
| 351 bool extended_info, | 331 bool extended_info, |
| 352 CancelableRequestConsumerBase* consumer, | 332 CancelableRequestConsumerBase* consumer, |
| 353 const QueryFilteredURLsCallback& callback); | 333 const QueryFilteredURLsCallback& callback); |
| 354 | 334 |
| 355 // Database management operations -------------------------------------------- | 335 // Database management operations -------------------------------------------- |
| 356 | 336 |
| 357 // Delete all the information related to a single url. | 337 // Delete all the information related to a single url. |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 1013 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; |
| 1034 | 1014 |
| 1035 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; | 1015 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; |
| 1036 | 1016 |
| 1037 history::DeleteDirectiveHandler delete_directive_handler_; | 1017 history::DeleteDirectiveHandler delete_directive_handler_; |
| 1038 | 1018 |
| 1039 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 1019 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
| 1040 }; | 1020 }; |
| 1041 | 1021 |
| 1042 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 1022 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
| OLD | NEW |