OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 DownloadCreateCallback; | 418 DownloadCreateCallback; |
419 | 419 |
420 // Begins a history request to create a new persistent entry for a download. | 420 // Begins a history request to create a new persistent entry for a download. |
421 // 'info' contains all the download's creation state, and 'callback' runs | 421 // 'info' contains all the download's creation state, and 'callback' runs |
422 // when the history service request is complete. | 422 // when the history service request is complete. |
423 Handle CreateDownload(int32 id, | 423 Handle CreateDownload(int32 id, |
424 const DownloadHistoryInfo& info, | 424 const DownloadHistoryInfo& info, |
425 CancelableRequestConsumerBase* consumer, | 425 CancelableRequestConsumerBase* consumer, |
426 DownloadCreateCallback* callback); | 426 DownloadCreateCallback* callback); |
427 | 427 |
| 428 // Implemented by the caller of 'GetNextDownloadId' below. |
| 429 typedef Callback1<int/*next_download_id*/>::Type DownloadNextIdCallback; |
| 430 |
| 431 // Runs the callback with the next available download id. |
| 432 Handle GetNextDownloadId(CancelableRequestConsumerBase* consumer, |
| 433 DownloadNextIdCallback* callback); |
| 434 |
428 // Implemented by the caller of 'QueryDownloads' below, and is called when the | 435 // Implemented by the caller of 'QueryDownloads' below, and is called when the |
429 // history service has retrieved a list of all download state. The call | 436 // history service has retrieved a list of all download state. The call |
430 typedef Callback1<std::vector<DownloadHistoryInfo>*>::Type | 437 typedef Callback1<std::vector<DownloadHistoryInfo>*>::Type |
431 DownloadQueryCallback; | 438 DownloadQueryCallback; |
432 | 439 |
433 // Begins a history request to retrieve the state of all downloads in the | 440 // Begins a history request to retrieve the state of all downloads in the |
434 // history db. 'callback' runs when the history service request is complete, | 441 // history db. 'callback' runs when the history service request is complete, |
435 // at which point 'info' contains an array of DownloadHistoryInfo, one per | 442 // at which point 'info' contains an array of DownloadHistoryInfo, one per |
436 // download. | 443 // download. |
437 Handle QueryDownloads(CancelableRequestConsumerBase* consumer, | 444 Handle QueryDownloads(CancelableRequestConsumerBase* consumer, |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 BookmarkService* bookmark_service_; | 876 BookmarkService* bookmark_service_; |
870 bool no_db_; | 877 bool no_db_; |
871 | 878 |
872 // True if needs top site migration. | 879 // True if needs top site migration. |
873 bool needs_top_sites_migration_; | 880 bool needs_top_sites_migration_; |
874 | 881 |
875 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 882 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
876 }; | 883 }; |
877 | 884 |
878 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ | 885 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ |
OLD | NEW |