| 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 profile in Chrome. | 8 // active profile in Chrome. |
| 9 // | 9 // |
| 10 // Download observers: | 10 // Download observers: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 class DownloadItem; | 50 class DownloadItem; |
| 51 class DownloadPrefs; | 51 class DownloadPrefs; |
| 52 class DownloadStatusUpdater; | 52 class DownloadStatusUpdater; |
| 53 class GURL; | 53 class GURL; |
| 54 class Profile; | 54 class Profile; |
| 55 class ResourceDispatcherHost; | 55 class ResourceDispatcherHost; |
| 56 class TabContents; | 56 class TabContents; |
| 57 struct DownloadCreateInfo; | 57 struct DownloadCreateInfo; |
| 58 struct DownloadSaveInfo; | 58 struct DownloadSaveInfo; |
| 59 | 59 |
| 60 namespace net { | |
| 61 class URLRequestContextGetter; | |
| 62 } | |
| 63 | |
| 64 // Browser's download manager: manages all downloads and destination view. | 60 // Browser's download manager: manages all downloads and destination view. |
| 65 class DownloadManager | 61 class DownloadManager |
| 66 : public base::RefCountedThreadSafe<DownloadManager, | 62 : public base::RefCountedThreadSafe<DownloadManager, |
| 67 BrowserThread::DeleteOnUIThread>, | 63 BrowserThread::DeleteOnUIThread>, |
| 68 public DownloadStatusUpdaterDelegate, | 64 public DownloadStatusUpdaterDelegate, |
| 69 public SelectFileDialog::Listener { | 65 public SelectFileDialog::Listener { |
| 70 public: | 66 public: |
| 71 explicit DownloadManager(DownloadStatusUpdater* status_updater); | 67 explicit DownloadManager(DownloadStatusUpdater* status_updater); |
| 72 | 68 |
| 73 // Shutdown the download manager. Must be called before destruction. | 69 // Shutdown the download manager. Must be called before destruction. |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 #endif | 363 #endif |
| 368 | 364 |
| 369 // True if the download manager has been initialized and requires a shutdown. | 365 // True if the download manager has been initialized and requires a shutdown. |
| 370 bool shutdown_needed_; | 366 bool shutdown_needed_; |
| 371 | 367 |
| 372 // Observers that want to be notified of changes to the set of downloads. | 368 // Observers that want to be notified of changes to the set of downloads. |
| 373 ObserverList<Observer> observers_; | 369 ObserverList<Observer> observers_; |
| 374 | 370 |
| 375 // The current active profile. | 371 // The current active profile. |
| 376 Profile* profile_; | 372 Profile* profile_; |
| 377 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | |
| 378 | 373 |
| 379 scoped_ptr<DownloadHistory> download_history_; | 374 scoped_ptr<DownloadHistory> download_history_; |
| 380 | 375 |
| 381 scoped_ptr<DownloadPrefs> download_prefs_; | 376 scoped_ptr<DownloadPrefs> download_prefs_; |
| 382 | 377 |
| 383 // Non-owning pointer for handling file writing on the download_thread_. | 378 // Non-owning pointer for handling file writing on the download_thread_. |
| 384 DownloadFileManager* file_manager_; | 379 DownloadFileManager* file_manager_; |
| 385 | 380 |
| 386 // Non-owning pointer for updating the download status. | 381 // Non-owning pointer for updating the download status. |
| 387 base::WeakPtr<DownloadStatusUpdater> status_updater_; | 382 base::WeakPtr<DownloadStatusUpdater> status_updater_; |
| 388 | 383 |
| 389 // The user's last choice for download directory. This is only used when the | 384 // The user's last choice for download directory. This is only used when the |
| 390 // user wants us to prompt for a save location for each download. | 385 // user wants us to prompt for a save location for each download. |
| 391 FilePath last_download_path_; | 386 FilePath last_download_path_; |
| 392 | 387 |
| 393 // The "Save As" dialog box used to ask the user where a file should be | 388 // The "Save As" dialog box used to ask the user where a file should be |
| 394 // saved. | 389 // saved. |
| 395 scoped_refptr<SelectFileDialog> select_file_dialog_; | 390 scoped_refptr<SelectFileDialog> select_file_dialog_; |
| 396 | 391 |
| 397 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; | 392 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; |
| 398 | 393 |
| 399 DISALLOW_COPY_AND_ASSIGN(DownloadManager); | 394 DISALLOW_COPY_AND_ASSIGN(DownloadManager); |
| 400 }; | 395 }; |
| 401 | 396 |
| 402 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ | 397 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |