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

Side by Side Diff: content/browser/download/mock_download_manager_delegate.h

Issue 8414007: Rearrange Should*Download delegate calls to be more useful and intuitive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaked comment. Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 MockDownloadManagerDelegate : public content::DownloadManagerDelegate { 12 class MockDownloadManagerDelegate : public content::DownloadManagerDelegate {
13 public: 13 public:
14 virtual ~MockDownloadManagerDelegate(); 14 virtual ~MockDownloadManagerDelegate();
15 virtual void Shutdown() OVERRIDE; 15 virtual void Shutdown() OVERRIDE;
16 virtual bool ShouldStartDownload(int32 download_id) OVERRIDE; 16 virtual bool ShouldStartDownload(int32 download_id) OVERRIDE;
17 virtual void ChooseDownloadPath(TabContents* tab_contents, 17 virtual void ChooseDownloadPath(TabContents* tab_contents,
18 const FilePath& suggested_path, 18 const FilePath& suggested_path,
19 void* data) OVERRIDE; 19 void* data) OVERRIDE;
20 virtual bool OverrideIntermediatePath(DownloadItem* item, 20 virtual bool OverrideIntermediatePath(DownloadItem* item,
21 FilePath* intermediate_path) OVERRIDE; 21 FilePath* intermediate_path) OVERRIDE;
22 virtual TabContents* GetAlternativeTabContentsToNotifyForDownload() OVERRIDE; 22 virtual TabContents* GetAlternativeTabContentsToNotifyForDownload() OVERRIDE;
23 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) OVERRIDE; 23 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) OVERRIDE;
24 virtual bool ShouldCompleteDownload(DownloadItem* item) OVERRIDE;
24 virtual bool ShouldOpenDownload(DownloadItem* item) OVERRIDE; 25 virtual bool ShouldOpenDownload(DownloadItem* item) OVERRIDE;
25 virtual bool ShouldCompleteDownload(DownloadItem* item) OVERRIDE;
26 virtual bool GenerateFileHash() OVERRIDE; 26 virtual bool GenerateFileHash() OVERRIDE;
27 virtual void OnResponseCompleted(DownloadItem* item, 27 virtual void OnResponseCompleted(DownloadItem* item,
28 const std::string& hash) OVERRIDE; 28 const std::string& hash) OVERRIDE;
29 virtual void AddItemToPersistentStore(DownloadItem* item) OVERRIDE; 29 virtual void AddItemToPersistentStore(DownloadItem* item) OVERRIDE;
30 virtual void UpdateItemInPersistentStore(DownloadItem* item) OVERRIDE; 30 virtual void UpdateItemInPersistentStore(DownloadItem* item) OVERRIDE;
31 virtual void UpdatePathForItemInPersistentStore( 31 virtual void UpdatePathForItemInPersistentStore(
32 DownloadItem* item, 32 DownloadItem* item,
33 const FilePath& new_path) OVERRIDE; 33 const FilePath& new_path) OVERRIDE;
34 virtual void RemoveItemFromPersistentStore(DownloadItem* item) OVERRIDE; 34 virtual void RemoveItemFromPersistentStore(DownloadItem* item) OVERRIDE;
35 virtual void RemoveItemsFromPersistentStoreBetween( 35 virtual void RemoveItemsFromPersistentStoreBetween(
36 const base::Time remove_begin, 36 const base::Time remove_begin,
37 const base::Time remove_end) OVERRIDE; 37 const base::Time remove_end) OVERRIDE;
38 virtual void GetSaveDir(TabContents* tab_contents, 38 virtual void GetSaveDir(TabContents* tab_contents,
39 FilePath* website_save_dir, 39 FilePath* website_save_dir,
40 FilePath* download_save_dir) OVERRIDE; 40 FilePath* download_save_dir) OVERRIDE;
41 virtual void ChooseSavePath(const base::WeakPtr<SavePackage>& save_package, 41 virtual void ChooseSavePath(const base::WeakPtr<SavePackage>& save_package,
42 const FilePath& suggested_path, 42 const FilePath& suggested_path,
43 bool can_save_as_complete) OVERRIDE; 43 bool can_save_as_complete) OVERRIDE;
44 virtual void DownloadProgressUpdated() OVERRIDE; 44 virtual void DownloadProgressUpdated() OVERRIDE;
45 }; 45 };
46 46
47 #endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_DELEGATE_H_ 47 #endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698