Index: chrome/browser/download/save_package.h |
=================================================================== |
--- chrome/browser/download/save_package.h (revision 92431) |
+++ chrome/browser/download/save_package.h (working copy) |
@@ -16,12 +16,11 @@ |
#include "base/hash_tables.h" |
#include "base/memory/ref_counted.h" |
#include "base/task.h" |
+#include "chrome/browser/download/download_manager.h" |
#include "chrome/browser/ui/shell_dialogs.h" |
#include "content/browser/tab_contents/tab_contents_observer.h" |
#include "googleurl/src/gurl.h" |
-class DownloadItem; |
-class DownloadManager; |
class GURL; |
class MessageLoop; |
class PrefService; |
@@ -53,7 +52,8 @@ |
// saving job, and exist for the duration of one tab's life time. |
class SavePackage : public base::RefCountedThreadSafe<SavePackage>, |
public TabContentsObserver, |
- public SelectFileDialog::Listener { |
+ public SelectFileDialog::Listener, |
+ public DownloadManager::Observer { |
public: |
enum SavePackageType { |
// The value of the save type before its set by the user. |
@@ -139,10 +139,17 @@ |
// have the specified MIME type. |
static bool IsSavableContents(const std::string& contents_mime_type); |
- // SelectFileDialog::Listener ------------------------------------------------ |
- virtual void FileSelected(const FilePath& path, int index, void* params); |
- virtual void FileSelectionCanceled(void* params); |
+ // Interfaces ---------------------------------------------------------------- |
+ // SelectFileDialog::Listener. |
+ virtual void FileSelected(const FilePath& path, |
+ int index, void* params) OVERRIDE; |
+ virtual void FileSelectionCanceled(void* params) OVERRIDE; |
+ |
+ // DownloadManager::Observer. |
+ virtual void ModelChanged() OVERRIDE {} |
+ virtual void ManagerGoingDown() OVERRIDE; |
+ |
private: |
friend class base::RefCountedThreadSafe<SavePackage>; |
@@ -162,7 +169,7 @@ |
void DoSavingProcess(); |
// TabContentsObserver implementation. |
- virtual bool OnMessageReceived(const IPC::Message& message); |
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
// Return max length of a path for a specific base directory. |
// This is needed on POSIX, which restrict the length of file names in |
@@ -252,6 +259,9 @@ |
static const FilePath::CharType* ExtensionForMimeType( |
const std::string& contents_mime_type); |
+ // Update the download history of this item. |
+ void FinalizeDownloadEntry(); |
+ |
// Owning TabContentsWrapper. |
TabContentsWrapper* wrapper_; |
@@ -315,6 +325,8 @@ |
// For managing select file dialogs. |
scoped_refptr<SelectFileDialog> select_file_dialog_; |
+ DownloadManager* download_manager_; |
+ |
friend class SavePackageTest; |
FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestSuggestedSaveNames); |
FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestLongSafePureFilename); |