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_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 namespace history { | 43 namespace history { |
44 class InMemoryHistoryBackend; | 44 class InMemoryHistoryBackend; |
45 class InMemoryURLIndex; | 45 class InMemoryURLIndex; |
46 class InMemoryURLIndexTest; | 46 class InMemoryURLIndexTest; |
47 class HistoryAddPageArgs; | 47 class HistoryAddPageArgs; |
48 class HistoryBackend; | 48 class HistoryBackend; |
49 class HistoryDatabase; | 49 class HistoryDatabase; |
50 struct HistoryDetails; | 50 struct HistoryDetails; |
51 class HistoryQueryTest; | 51 class HistoryQueryTest; |
| 52 class TimeFilter; |
52 class URLDatabase; | 53 class URLDatabase; |
53 } // namespace history | 54 } // namespace history |
54 | 55 |
55 | 56 |
56 // HistoryDBTask can be used to process arbitrary work on the history backend | 57 // HistoryDBTask can be used to process arbitrary work on the history backend |
57 // thread. HistoryDBTask is scheduled using HistoryService::ScheduleDBTask. | 58 // thread. HistoryDBTask is scheduled using HistoryService::ScheduleDBTask. |
58 // When HistoryBackend processes the task it invokes RunOnDBThread. Once the | 59 // When HistoryBackend processes the task it invokes RunOnDBThread. Once the |
59 // task completes and has not been canceled, DoneRunOnMainThread is invoked back | 60 // task completes and has not been canceled, DoneRunOnMainThread is invoked back |
60 // on the main thread. | 61 // on the main thread. |
61 class HistoryDBTask : public base::RefCountedThreadSafe<HistoryDBTask> { | 62 class HistoryDBTask : public base::RefCountedThreadSafe<HistoryDBTask> { |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 typedef base::Callback<void(Handle, history::MostVisitedURLList)> | 356 typedef base::Callback<void(Handle, history::MostVisitedURLList)> |
356 QueryMostVisitedURLsCallback; | 357 QueryMostVisitedURLsCallback; |
357 | 358 |
358 // Request the |result_count| most visited URLs and the chain of | 359 // Request the |result_count| most visited URLs and the chain of |
359 // redirects leading to each of these URLs. |days_back| is the | 360 // redirects leading to each of these URLs. |days_back| is the |
360 // number of days of history to use. Used by TopSites. | 361 // number of days of history to use. Used by TopSites. |
361 Handle QueryMostVisitedURLs(int result_count, int days_back, | 362 Handle QueryMostVisitedURLs(int result_count, int days_back, |
362 CancelableRequestConsumerBase* consumer, | 363 CancelableRequestConsumerBase* consumer, |
363 const QueryMostVisitedURLsCallback& callback); | 364 const QueryMostVisitedURLsCallback& callback); |
364 | 365 |
| 366 // Request the |result_count| most visited URLs during the time peiods |
| 367 // specified in the |filter|. |
| 368 Handle QueryMostVisitedURLsDuringTime( |
| 369 int result_count, |
| 370 const history::TimeFilter& filter, |
| 371 CancelableRequestConsumerBase* consumer, |
| 372 const QueryMostVisitedURLsCallback& callback); |
| 373 |
365 // Thumbnails ---------------------------------------------------------------- | 374 // Thumbnails ---------------------------------------------------------------- |
366 | 375 |
367 // Implemented by consumers to get thumbnail data. Called when a request for | 376 // Implemented by consumers to get thumbnail data. Called when a request for |
368 // the thumbnail data is complete. Once this callback is made, the request | 377 // the thumbnail data is complete. Once this callback is made, the request |
369 // will be completed and no other calls will be made for that handle. | 378 // will be completed and no other calls will be made for that handle. |
370 // | 379 // |
371 // This function will be called even on error conditions or if there is no | 380 // This function will be called even on error conditions or if there is no |
372 // thumbnail for that page. In these cases, the data pointer will be NULL. | 381 // thumbnail for that page. In these cases, the data pointer will be NULL. |
373 typedef base::Callback<void(Handle, scoped_refptr<RefCountedBytes>)> | 382 typedef base::Callback<void(Handle, scoped_refptr<RefCountedBytes>)> |
374 ThumbnailDataCallback; | 383 ThumbnailDataCallback; |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 // True if needs top site migration. | 879 // True if needs top site migration. |
871 bool needs_top_sites_migration_; | 880 bool needs_top_sites_migration_; |
872 | 881 |
873 // The index used for quick history lookups. | 882 // The index used for quick history lookups. |
874 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 883 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; |
875 | 884 |
876 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 885 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
877 }; | 886 }; |
878 | 887 |
879 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ | 888 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ |
OLD | NEW |