Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2505)

Unified Diff: chrome/browser/download/download_manager.h

Issue 7277073: Support for adding save page download items into downloads history. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/download_manager.h
===================================================================
--- chrome/browser/download/download_manager.h (revision 92431)
+++ chrome/browser/download/download_manager.h (working copy)
@@ -164,10 +164,6 @@
// history and remove the download from |active_downloads_|.
void DownloadCompleted(int32 download_id);
- // Called when a Save Page As download is started. Transfers ownership
- // of |download_item| to the DownloadManager.
- void SavePageAsDownloadStarted(DownloadItem* download_item);
-
// Download the object at the URL. Used in cases such as "Save Link As..."
void DownloadUrl(const GURL& url,
const GURL& referrer,
@@ -202,10 +198,12 @@
return static_cast<int>(in_progress_.size());
}
- Profile* profile() { return profile_; }
+ Profile* profile() const { return profile_; }
- DownloadPrefs* download_prefs() { return download_prefs_.get(); }
+ DownloadPrefs* download_prefs() const { return download_prefs_.get(); }
+ DownloadHistory* download_history() const { return download_history_.get(); }
Randy Smith (Not in Mondays) 2011/07/15 17:58:39 If this is now only used by the browsertest, can y
achuithb 2011/07/16 20:15:32 Done.
+
// Creates the download item. Must be called on the UI thread.
void CreateDownloadItem(DownloadCreateInfo* info);
@@ -266,6 +264,19 @@
// been removed from the active map, or was retrieved from the history DB.
DownloadItem* GetDownloadItem(int id);
+ // Called when Save Page download starts. Transfers ownership of |download|
+ // to the DownloadManager.
+ void SavePageDownloadStarted(DownloadItem* download);
+
+ // Callback when Save Page As entry is commited to the history system.
+ void OnSavePageDownloadEntryAdded(int32 download_id, int64 db_handle);
+
+ // Called when Save Page download is done.
+ void SavePageDownloadFinished(DownloadItem* download);
+
+ // Save Page Ids.
+ int32 GetNextSavePageId();
+
private:
// For testing.
friend class DownloadManagerTest;
@@ -396,6 +407,7 @@
DownloadMap history_downloads_;
DownloadMap in_progress_;
DownloadMap active_downloads_;
+ DownloadMap save_page_downloads_;
Randy Smith (Not in Mondays) 2011/07/15 17:58:39 There's no point to having both this and save_page
achuithb 2011/07/16 20:15:32 Done.
#if !defined(NDEBUG)
DownloadSet save_page_as_downloads_;
#endif
@@ -423,6 +435,9 @@
// user wants us to prompt for a save location for each download.
FilePath last_download_path_;
+ // Save Page Ids.
+ int32 next_save_page_id_;
+
// The "Save As" dialog box used to ask the user where a file should be
// saved.
scoped_refptr<SelectFileDialog> select_file_dialog_;

Powered by Google App Engine
This is Rietveld 408576698