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 profile in Chrome. | 8 // active profile in Chrome. |
| 9 // | 9 // |
| 10 // Download observers: | 10 // Download observers: |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 | 35 |
| 36 #include "base/basictypes.h" | 36 #include "base/basictypes.h" |
| 37 #include "base/file_path.h" | 37 #include "base/file_path.h" |
| 38 #include "base/gtest_prod_util.h" | 38 #include "base/gtest_prod_util.h" |
| 39 #include "base/memory/ref_counted.h" | 39 #include "base/memory/ref_counted.h" |
| 40 #include "base/memory/weak_ptr.h" | 40 #include "base/memory/weak_ptr.h" |
| 41 #include "base/observer_list.h" | 41 #include "base/observer_list.h" |
| 42 #include "base/scoped_ptr.h" | 42 #include "base/scoped_ptr.h" |
| 43 #include "base/time.h" | 43 #include "base/time.h" |
| 44 #include "chrome/browser/download/download_status_updater_delegate.h" | 44 #include "chrome/browser/download/download_status_updater_delegate.h" |
| 45 #include "chrome/browser/download/download_process_handle.h" | |
| 45 #include "chrome/browser/ui/shell_dialogs.h" | 46 #include "chrome/browser/ui/shell_dialogs.h" |
| 46 #include "content/browser/browser_thread.h" | 47 #include "content/browser/browser_thread.h" |
| 47 | 48 |
| 48 class DownloadFileManager; | 49 class DownloadFileManager; |
| 49 class DownloadHistory; | 50 class DownloadHistory; |
| 50 class DownloadItem; | 51 class DownloadItem; |
| 51 class DownloadPrefs; | 52 class DownloadPrefs; |
| 52 class DownloadStatusUpdater; | 53 class DownloadStatusUpdater; |
| 53 class GURL; | 54 class GURL; |
| 54 class Profile; | 55 class Profile; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 190 // Remove a download observer from ourself. | 191 // Remove a download observer from ourself. |
| 191 void RemoveObserver(Observer* observer); | 192 void RemoveObserver(Observer* observer); |
| 192 | 193 |
| 193 // Methods called on completion of a query sent to the history system. | 194 // Methods called on completion of a query sent to the history system. |
| 194 void OnQueryDownloadEntriesComplete( | 195 void OnQueryDownloadEntriesComplete( |
| 195 std::vector<DownloadCreateInfo>* entries); | 196 std::vector<DownloadCreateInfo>* entries); |
| 196 void OnCreateDownloadEntryComplete( | 197 void OnCreateDownloadEntryComplete( |
| 197 DownloadCreateInfo info, int64 db_handle); | 198 DownloadCreateInfo info, int64 db_handle); |
| 198 | 199 |
| 199 // Display a new download in the appropriate browser UI. | 200 // Display a new download in the appropriate browser UI. |
| 200 void ShowDownloadInBrowser(const DownloadCreateInfo& info, | 201 void ShowDownloadInBrowser(DownloadProcessHandle process_handle, |
|
Paweł Hajdan Jr.
2011/05/05 20:13:51
nit: Why not const DownloadProcessHandle& process_
ahendrickson
2011/05/06 16:16:50
Because I need to use a non-const member function.
| |
| 201 DownloadItem* download); | 202 DownloadItem* download); |
| 202 | 203 |
| 203 // The number of in progress (including paused) downloads. | 204 // The number of in progress (including paused) downloads. |
| 204 int in_progress_count() const { | 205 int in_progress_count() const { |
| 205 return static_cast<int>(in_progress_.size()); | 206 return static_cast<int>(in_progress_.size()); |
| 206 } | 207 } |
| 207 | 208 |
| 208 Profile* profile() { return profile_; } | 209 Profile* profile() { return profile_; } |
| 209 | 210 |
| 210 DownloadHistory* download_history() { return download_history_.get(); } | 211 DownloadHistory* download_history() { return download_history_.get(); } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 393 // The "Save As" dialog box used to ask the user where a file should be | 394 // The "Save As" dialog box used to ask the user where a file should be |
| 394 // saved. | 395 // saved. |
| 395 scoped_refptr<SelectFileDialog> select_file_dialog_; | 396 scoped_refptr<SelectFileDialog> select_file_dialog_; |
| 396 | 397 |
| 397 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; | 398 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; |
| 398 | 399 |
| 399 DISALLOW_COPY_AND_ASSIGN(DownloadManager); | 400 DISALLOW_COPY_AND_ASSIGN(DownloadManager); |
| 400 }; | 401 }; |
| 401 | 402 |
| 402 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ | 403 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |