Chromium Code Reviews| 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 // The DownloadManager object manages the process of downloading, including | 5 // The DownloadManager object manages the process of downloading, including |
| 6 // updates to the history system and providing the information for displaying | 6 // updates to the history system and providing the information for displaying |
| 7 // the downloads view in the Destinations tab. There is one DownloadManager per | 7 // the downloads view in the Destinations tab. There is one DownloadManager per |
| 8 // active browser context in Chrome. | 8 // active browser context in Chrome. |
| 9 // | 9 // |
| 10 // Download observers: | 10 // Download observers: |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 class DownloadManagerDelegate; | 56 class DownloadManagerDelegate; |
| 57 class DownloadStatusUpdater; | 57 class DownloadStatusUpdater; |
| 58 class GURL; | 58 class GURL; |
| 59 class ResourceDispatcherHost; | 59 class ResourceDispatcherHost; |
| 60 class TabContents; | 60 class TabContents; |
| 61 struct DownloadCreateInfo; | 61 struct DownloadCreateInfo; |
| 62 struct DownloadSaveInfo; | 62 struct DownloadSaveInfo; |
| 63 | 63 |
| 64 namespace content { | 64 namespace content { |
| 65 class BrowserContext; | 65 class BrowserContext; |
| 66 } | 66 } // namespace content |
|
cbentzel
2011/10/20 18:18:53
Nit: end namespaces not needed for forward declara
| |
| 67 | |
| 68 namespace download_util { | |
| 69 class DownloadQuery; | |
| 70 } // namespace download_util | |
| 67 | 71 |
| 68 // Browser's download manager: manages all downloads and destination view. | 72 // Browser's download manager: manages all downloads and destination view. |
| 69 class CONTENT_EXPORT DownloadManager | 73 class CONTENT_EXPORT DownloadManager |
| 70 : public base::RefCountedThreadSafe<DownloadManager, | 74 : public base::RefCountedThreadSafe<DownloadManager, |
| 71 BrowserThread::DeleteOnUIThread>, | 75 BrowserThread::DeleteOnUIThread>, |
| 72 public DownloadStatusUpdaterDelegate { | 76 public DownloadStatusUpdaterDelegate { |
| 73 public: | 77 public: |
| 74 DownloadManager(DownloadManagerDelegate* delegate, | 78 DownloadManager(DownloadManagerDelegate* delegate, |
| 75 DownloadStatusUpdater* status_updater); | 79 DownloadStatusUpdater* status_updater); |
| 76 | 80 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 100 | 104 |
| 101 typedef std::vector<DownloadItem*> DownloadVector; | 105 typedef std::vector<DownloadItem*> DownloadVector; |
| 102 | 106 |
| 103 // Return all temporary downloads that reside in the specified directory. | 107 // Return all temporary downloads that reside in the specified directory. |
| 104 void GetTemporaryDownloads(const FilePath& dir_path, DownloadVector* result); | 108 void GetTemporaryDownloads(const FilePath& dir_path, DownloadVector* result); |
| 105 | 109 |
| 106 // Return all non-temporary downloads in the specified directory that are | 110 // Return all non-temporary downloads in the specified directory that are |
| 107 // are in progress or have completed. | 111 // are in progress or have completed. |
| 108 void GetAllDownloads(const FilePath& dir_path, DownloadVector* result); | 112 void GetAllDownloads(const FilePath& dir_path, DownloadVector* result); |
| 109 | 113 |
| 114 // Fill |results| with the items that match |query|. | |
| 115 void Search(const download_util::DownloadQuery& query, | |
| 116 DownloadVector* results) const; | |
| 117 | |
| 110 // Returns all non-temporary downloads matching |query|. Empty query matches | 118 // Returns all non-temporary downloads matching |query|. Empty query matches |
| 111 // everything. | 119 // everything. |
| 112 void SearchDownloads(const string16& query, DownloadVector* result); | 120 void SearchDownloads(const string16& query, DownloadVector* result); |
| 113 | 121 |
| 114 // Returns the next download id in a DownloadId and increments the counter. | 122 // Returns the next download id in a DownloadId and increments the counter. |
| 115 // May be called on any thread. The incremented counter is not persisted, but | 123 // May be called on any thread. The incremented counter is not persisted, but |
| 116 // the base counter for this accessor is initialized from the largest id | 124 // the base counter for this accessor is initialized from the largest id |
| 117 // actually saved to the download history database. | 125 // actually saved to the download history database. |
| 118 DownloadId GetNextId(); | 126 DownloadId GetNextId(); |
| 119 | 127 |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 434 DownloadManagerDelegate* delegate_; | 442 DownloadManagerDelegate* delegate_; |
| 435 | 443 |
| 436 // TODO(rdsmith): Remove when http://crbug.com/85408 is fixed. | 444 // TODO(rdsmith): Remove when http://crbug.com/85408 is fixed. |
| 437 // For debugging only. | 445 // For debugging only. |
| 438 int64 largest_db_handle_in_history_; | 446 int64 largest_db_handle_in_history_; |
| 439 | 447 |
| 440 DISALLOW_COPY_AND_ASSIGN(DownloadManager); | 448 DISALLOW_COPY_AND_ASSIGN(DownloadManager); |
| 441 }; | 449 }; |
| 442 | 450 |
| 443 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ | 451 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |