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 10 matching lines...) Expand all Loading... | |
| 21 // The DownloadManager uses the history service for storing persistent | 21 // The DownloadManager uses the history service for storing persistent |
| 22 // information about the state of all downloads. The history system maintains a | 22 // information about the state of all downloads. The history system maintains a |
| 23 // separate table for this called 'downloads'. At the point that the | 23 // separate table for this called 'downloads'. At the point that the |
| 24 // DownloadManager is constructed, we query the history service for the state of | 24 // DownloadManager is constructed, we query the history service for the state of |
| 25 // all persisted downloads. | 25 // all persisted downloads. |
| 26 | 26 |
| 27 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ | 27 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ |
| 28 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ | 28 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ |
| 29 #pragma once | 29 #pragma once |
| 30 | 30 |
| 31 #include <hash_map> | |
|
achuithb
2011/06/20 22:52:03
fix lint error
| |
| 31 #include <map> | 32 #include <map> |
| 32 #include <set> | 33 #include <set> |
| 33 #include <string> | 34 #include <string> |
| 34 #include <vector> | 35 #include <vector> |
| 35 | 36 |
| 36 #include "base/basictypes.h" | 37 #include "base/basictypes.h" |
| 37 #include "base/file_path.h" | 38 #include "base/file_path.h" |
| 38 #include "base/gtest_prod_util.h" | 39 #include "base/gtest_prod_util.h" |
| 39 #include "base/memory/ref_counted.h" | 40 #include "base/memory/ref_counted.h" |
| 40 #include "base/memory/scoped_ptr.h" | 41 #include "base/memory/scoped_ptr.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 DownloadItem* GetDownloadItem(int id); | 345 DownloadItem* GetDownloadItem(int id); |
| 345 | 346 |
| 346 // Get the download item from the active map. Useful when the item is not | 347 // Get the download item from the active map. Useful when the item is not |
| 347 // yet in the history map. | 348 // yet in the history map. |
| 348 DownloadItem* GetActiveDownloadItem(int id); | 349 DownloadItem* GetActiveDownloadItem(int id); |
| 349 | 350 |
| 350 // Debugging routine to confirm relationship between below | 351 // Debugging routine to confirm relationship between below |
| 351 // containers; no-op if NDEBUG. | 352 // containers; no-op if NDEBUG. |
| 352 void AssertContainersConsistent() const; | 353 void AssertContainersConsistent() const; |
| 353 | 354 |
| 355 // Add a DownloadItem to history_downloads_. | |
| 356 void AddDownloadItemToHistory(DownloadItem* item, int64 db_handle); | |
| 357 | |
| 354 // |downloads_| is the owning set for all downloads known to the | 358 // |downloads_| is the owning set for all downloads known to the |
| 355 // DownloadManager. This includes downloads started by the user in | 359 // DownloadManager. This includes downloads started by the user in |
| 356 // this session, downloads initialized from the history system, and | 360 // this session, downloads initialized from the history system, and |
| 357 // "save page as" downloads. All other DownloadItem containers in | 361 // "save page as" downloads. All other DownloadItem containers in |
| 358 // the DownloadManager are maps; they do not own the DownloadItems. | 362 // the DownloadManager are maps; they do not own the DownloadItems. |
| 359 // Note that this is the only place (with any functional implications; | 363 // Note that this is the only place (with any functional implications; |
| 360 // see save_page_as_downloads_ below) that "save page as" downloads are | 364 // see save_page_as_downloads_ below) that "save page as" downloads are |
| 361 // kept, as the DownloadManager's only job is to hold onto those | 365 // kept, as the DownloadManager's only job is to hold onto those |
| 362 // until destruction. | 366 // until destruction. |
| 363 // | 367 // |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 424 // The "Save As" dialog box used to ask the user where a file should be | 428 // The "Save As" dialog box used to ask the user where a file should be |
| 425 // saved. | 429 // saved. |
| 426 scoped_refptr<SelectFileDialog> select_file_dialog_; | 430 scoped_refptr<SelectFileDialog> select_file_dialog_; |
| 427 | 431 |
| 428 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; | 432 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; |
| 429 | 433 |
| 430 DISALLOW_COPY_AND_ASSIGN(DownloadManager); | 434 DISALLOW_COPY_AND_ASSIGN(DownloadManager); |
| 431 }; | 435 }; |
| 432 | 436 |
| 433 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ | 437 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |