| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 class DownloadStatusUpdater; | 58 class DownloadStatusUpdater; |
| 59 class GURL; | 59 class GURL; |
| 60 class ResourceDispatcherHost; | 60 class ResourceDispatcherHost; |
| 61 class TabContents; | 61 class TabContents; |
| 62 struct DownloadCreateInfo; | 62 struct DownloadCreateInfo; |
| 63 struct DownloadSaveInfo; | 63 struct DownloadSaveInfo; |
| 64 | 64 |
| 65 namespace content { | 65 namespace content { |
| 66 class BrowserContext; | 66 class BrowserContext; |
| 67 class DownloadManagerDelegate; | 67 class DownloadManagerDelegate; |
| 68 } | 68 } // namespace content |
| 69 |
| 70 namespace download_util { |
| 71 class DownloadQuery; |
| 72 } // namespace download_util |
| 69 | 73 |
| 70 // Browser's download manager: manages all downloads and destination view. | 74 // Browser's download manager: manages all downloads and destination view. |
| 71 class CONTENT_EXPORT DownloadManager | 75 class CONTENT_EXPORT DownloadManager |
| 72 : public base::RefCountedThreadSafe< | 76 : public base::RefCountedThreadSafe< |
| 73 DownloadManager, content::BrowserThread::DeleteOnUIThread>, | 77 DownloadManager, content::BrowserThread::DeleteOnUIThread>, |
| 74 public DownloadStatusUpdaterDelegate { | 78 public DownloadStatusUpdaterDelegate { |
| 75 public: | 79 public: |
| 76 DownloadManager(content::DownloadManagerDelegate* delegate, | 80 DownloadManager(content::DownloadManagerDelegate* delegate, |
| 77 DownloadIdFactory* id_factory, | 81 DownloadIdFactory* id_factory, |
| 78 DownloadStatusUpdater* status_updater); | 82 DownloadStatusUpdater* status_updater); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 103 | 107 |
| 104 typedef std::vector<DownloadItem*> DownloadVector; | 108 typedef std::vector<DownloadItem*> DownloadVector; |
| 105 | 109 |
| 106 // Return all temporary downloads that reside in the specified directory. | 110 // Return all temporary downloads that reside in the specified directory. |
| 107 void GetTemporaryDownloads(const FilePath& dir_path, DownloadVector* result); | 111 void GetTemporaryDownloads(const FilePath& dir_path, DownloadVector* result); |
| 108 | 112 |
| 109 // Return all non-temporary downloads in the specified directory that are | 113 // Return all non-temporary downloads in the specified directory that are |
| 110 // are in progress or have completed. | 114 // are in progress or have completed. |
| 111 void GetAllDownloads(const FilePath& dir_path, DownloadVector* result); | 115 void GetAllDownloads(const FilePath& dir_path, DownloadVector* result); |
| 112 | 116 |
| 117 // Fill |results| with the items that match |query|. |
| 118 void Search(const download_util::DownloadQuery& query, |
| 119 DownloadVector* results) const; |
| 120 |
| 113 // Returns all non-temporary downloads matching |query|. Empty query matches | 121 // Returns all non-temporary downloads matching |query|. Empty query matches |
| 114 // everything. | 122 // everything. |
| 115 void SearchDownloads(const string16& query, DownloadVector* result); | 123 void SearchDownloads(const string16& query, DownloadVector* result); |
| 116 | 124 |
| 117 // Returns true if initialized properly. | 125 // Returns true if initialized properly. |
| 118 bool Init(content::BrowserContext* browser_context); | 126 bool Init(content::BrowserContext* browser_context); |
| 119 | 127 |
| 120 // Notifications sent from the download thread to the UI thread | 128 // Notifications sent from the download thread to the UI thread |
| 121 void StartDownload(int32 id); | 129 void StartDownload(int32 id); |
| 122 void UpdateDownload(int32 download_id, int64 size); | 130 void UpdateDownload(int32 download_id, int64 size); |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 DownloadIdFactory* id_factory_; | 425 DownloadIdFactory* id_factory_; |
| 418 | 426 |
| 419 // TODO(rdsmith): Remove when http://crbug.com/85408 is fixed. | 427 // TODO(rdsmith): Remove when http://crbug.com/85408 is fixed. |
| 420 // For debugging only. | 428 // For debugging only. |
| 421 int64 largest_db_handle_in_history_; | 429 int64 largest_db_handle_in_history_; |
| 422 | 430 |
| 423 DISALLOW_COPY_AND_ASSIGN(DownloadManager); | 431 DISALLOW_COPY_AND_ASSIGN(DownloadManager); |
| 424 }; | 432 }; |
| 425 | 433 |
| 426 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ | 434 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |