| 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 #ifndef CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_DELEGATE_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_DELEGATE_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "content/public/browser/download_manager_delegate.h" | 10 #include "content/public/browser/download_manager_delegate.h" |
| 11 | 11 |
| 12 class DownloadManager; | 12 class DownloadManager; |
| 13 | 13 |
| 14 class MockDownloadManagerDelegate : public content::DownloadManagerDelegate { | 14 class MockDownloadManagerDelegate : public content::DownloadManagerDelegate { |
| 15 public: | 15 public: |
| 16 MockDownloadManagerDelegate(); | 16 MockDownloadManagerDelegate(); |
| 17 virtual ~MockDownloadManagerDelegate(); | 17 virtual ~MockDownloadManagerDelegate(); |
| 18 void SetDownloadManager(DownloadManager* dm); | 18 void SetDownloadManager(DownloadManager* dm); |
| 19 virtual void Shutdown() OVERRIDE; | 19 virtual void Shutdown() OVERRIDE; |
| 20 virtual bool ShouldStartDownload(int32 download_id) OVERRIDE; | 20 virtual bool ShouldStartDownload(int32 download_id) OVERRIDE; |
| 21 virtual void ChooseDownloadPath(TabContents* tab_contents, | 21 virtual void ChooseDownloadPath(TabContents* tab_contents, |
| 22 const FilePath& suggested_path, | 22 const FilePath& suggested_path, |
| 23 void* data) OVERRIDE; | 23 void* data) OVERRIDE; |
| 24 virtual bool OverrideIntermediatePath(DownloadItem* item, | 24 virtual bool OverrideIntermediatePath(DownloadItem* item, |
| 25 FilePath* intermediate_path) OVERRIDE; | 25 FilePath* intermediate_path) OVERRIDE; |
| 26 virtual TabContents* GetAlternativeTabContentsToNotifyForDownload() OVERRIDE; | 26 virtual TabContents* GetAlternativeTabContentsToNotifyForDownload() OVERRIDE; |
| 27 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) OVERRIDE; | 27 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) OVERRIDE; |
| 28 virtual bool ShouldCompleteDownload(DownloadItem* item) OVERRIDE; |
| 28 virtual bool ShouldOpenDownload(DownloadItem* item) OVERRIDE; | 29 virtual bool ShouldOpenDownload(DownloadItem* item) OVERRIDE; |
| 29 virtual bool ShouldCompleteDownload(DownloadItem* item) OVERRIDE; | |
| 30 virtual bool GenerateFileHash() OVERRIDE; | 30 virtual bool GenerateFileHash() OVERRIDE; |
| 31 virtual void OnResponseCompleted(DownloadItem* item, | 31 virtual void OnResponseCompleted(DownloadItem* item, |
| 32 const std::string& hash) OVERRIDE; | 32 const std::string& hash) OVERRIDE; |
| 33 virtual void AddItemToPersistentStore(DownloadItem* item) OVERRIDE; | 33 virtual void AddItemToPersistentStore(DownloadItem* item) OVERRIDE; |
| 34 virtual void UpdateItemInPersistentStore(DownloadItem* item) OVERRIDE; | 34 virtual void UpdateItemInPersistentStore(DownloadItem* item) OVERRIDE; |
| 35 virtual void UpdatePathForItemInPersistentStore( | 35 virtual void UpdatePathForItemInPersistentStore( |
| 36 DownloadItem* item, | 36 DownloadItem* item, |
| 37 const FilePath& new_path) OVERRIDE; | 37 const FilePath& new_path) OVERRIDE; |
| 38 virtual void RemoveItemFromPersistentStore(DownloadItem* item) OVERRIDE; | 38 virtual void RemoveItemFromPersistentStore(DownloadItem* item) OVERRIDE; |
| 39 virtual void RemoveItemsFromPersistentStoreBetween( | 39 virtual void RemoveItemsFromPersistentStoreBetween( |
| 40 const base::Time remove_begin, | 40 const base::Time remove_begin, |
| 41 const base::Time remove_end) OVERRIDE; | 41 const base::Time remove_end) OVERRIDE; |
| 42 virtual void GetSaveDir(TabContents* tab_contents, | 42 virtual void GetSaveDir(TabContents* tab_contents, |
| 43 FilePath* website_save_dir, | 43 FilePath* website_save_dir, |
| 44 FilePath* download_save_dir) OVERRIDE; | 44 FilePath* download_save_dir) OVERRIDE; |
| 45 virtual void ChooseSavePath(const base::WeakPtr<SavePackage>& save_package, | 45 virtual void ChooseSavePath(const base::WeakPtr<SavePackage>& save_package, |
| 46 const FilePath& suggested_path, | 46 const FilePath& suggested_path, |
| 47 bool can_save_as_complete) OVERRIDE; | 47 bool can_save_as_complete) OVERRIDE; |
| 48 virtual void DownloadProgressUpdated() OVERRIDE; | 48 virtual void DownloadProgressUpdated() OVERRIDE; |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 scoped_refptr<DownloadManager> download_manager_; | 51 scoped_refptr<DownloadManager> download_manager_; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 #endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_DELEGATE_H_ | 54 #endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_DELEGATE_H_ |
| OLD | NEW |