| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ | 5 #ifndef CONTENT_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ |
| 6 #define CONTENT_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ | 6 #define CONTENT_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "content/public/browser/download_manager_delegate.h" | 10 #include "content/public/browser/download_manager_delegate.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 void SetDownloadManager(DownloadManager* manager); | 22 void SetDownloadManager(DownloadManager* manager); |
| 23 | 23 |
| 24 virtual void Shutdown() OVERRIDE; | 24 virtual void Shutdown() OVERRIDE; |
| 25 virtual bool DetermineDownloadTarget( | 25 virtual bool DetermineDownloadTarget( |
| 26 DownloadItem* download, | 26 DownloadItem* download, |
| 27 const DownloadTargetCallback& callback) OVERRIDE; | 27 const DownloadTargetCallback& callback) OVERRIDE; |
| 28 | 28 |
| 29 // Inhibits prompting and sets the default download path. | 29 // Inhibits prompting and sets the default download path. |
| 30 void SetDownloadBehaviorForTesting( | 30 void SetDownloadBehaviorForTesting( |
| 31 const FilePath& default_download_path); | 31 const base::FilePath& default_download_path); |
| 32 | 32 |
| 33 protected: | 33 protected: |
| 34 // To allow subclasses for testing. | 34 // To allow subclasses for testing. |
| 35 virtual ~ShellDownloadManagerDelegate(); | 35 virtual ~ShellDownloadManagerDelegate(); |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 friend class base::RefCountedThreadSafe<ShellDownloadManagerDelegate>; | 38 friend class base::RefCountedThreadSafe<ShellDownloadManagerDelegate>; |
| 39 | 39 |
| 40 | 40 |
| 41 void GenerateFilename(int32 download_id, | 41 void GenerateFilename(int32 download_id, |
| 42 const DownloadTargetCallback& callback, | 42 const DownloadTargetCallback& callback, |
| 43 const FilePath& generated_name, | 43 const base::FilePath& generated_name, |
| 44 const FilePath& suggested_directory); | 44 const base::FilePath& suggested_directory); |
| 45 void OnDownloadPathGenerated(int32 download_id, | 45 void OnDownloadPathGenerated(int32 download_id, |
| 46 const DownloadTargetCallback& callback, | 46 const DownloadTargetCallback& callback, |
| 47 const FilePath& suggested_path); | 47 const base::FilePath& suggested_path); |
| 48 void ChooseDownloadPath(int32 download_id, | 48 void ChooseDownloadPath(int32 download_id, |
| 49 const DownloadTargetCallback& callback, | 49 const DownloadTargetCallback& callback, |
| 50 const FilePath& suggested_path); | 50 const base::FilePath& suggested_path); |
| 51 | 51 |
| 52 DownloadManager* download_manager_; | 52 DownloadManager* download_manager_; |
| 53 FilePath default_download_path_; | 53 base::FilePath default_download_path_; |
| 54 bool suppress_prompting_; | 54 bool suppress_prompting_; |
| 55 | 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(ShellDownloadManagerDelegate); | 56 DISALLOW_COPY_AND_ASSIGN(ShellDownloadManagerDelegate); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace content | 59 } // namespace content |
| 60 | 60 |
| 61 #endif // CONTENT_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ | 61 #endif // CONTENT_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ |
| OLD | NEW |