| 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" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 class DownloadManager; | 14 class DownloadManager; |
| 15 | 15 |
| 16 class ShellDownloadManagerDelegate | 16 class ShellDownloadManagerDelegate |
| 17 : public DownloadManagerDelegate, | 17 : public DownloadManagerDelegate, |
| 18 public base::RefCountedThreadSafe<ShellDownloadManagerDelegate> { | 18 public base::RefCountedThreadSafe<ShellDownloadManagerDelegate> { |
| 19 public: | 19 public: |
| 20 ShellDownloadManagerDelegate(); | 20 ShellDownloadManagerDelegate(); |
| 21 | 21 |
| 22 void SetDownloadManager(DownloadManager* manager); | 22 void SetDownloadManager(DownloadManager* manager); |
| 23 | 23 |
| 24 virtual bool ShouldStartDownload(int32 download_id) OVERRIDE; | 24 virtual bool DetermineDownloadTarget( |
| 25 virtual void ChooseDownloadPath(DownloadItem* item) OVERRIDE; | 25 DownloadItem* download, |
| 26 const DownloadTargetCallback& callback) OVERRIDE; |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 friend class base::RefCountedThreadSafe<ShellDownloadManagerDelegate>; | 29 friend class base::RefCountedThreadSafe<ShellDownloadManagerDelegate>; |
| 29 | 30 |
| 30 virtual ~ShellDownloadManagerDelegate(); | 31 virtual ~ShellDownloadManagerDelegate(); |
| 31 | 32 |
| 32 void GenerateFilename(int32 download_id, | 33 void GenerateFilename(int32 download_id, |
| 34 const DownloadTargetCallback& callback, |
| 33 const FilePath& generated_name); | 35 const FilePath& generated_name); |
| 34 void RestartDownload(int32 download_id, | 36 void ChooseDownloadPath(int32 download_id, |
| 35 const FilePath& suggested_path); | 37 const DownloadTargetCallback& callback, |
| 38 const FilePath& suggested_path); |
| 36 | 39 |
| 37 DownloadManager* download_manager_; | 40 DownloadManager* download_manager_; |
| 38 | 41 |
| 39 DISALLOW_COPY_AND_ASSIGN(ShellDownloadManagerDelegate); | 42 DISALLOW_COPY_AND_ASSIGN(ShellDownloadManagerDelegate); |
| 40 }; | 43 }; |
| 41 | 44 |
| 42 } // namespace content | 45 } // namespace content |
| 43 | 46 |
| 44 #endif // CONTENT_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ | 47 #endif // CONTENT_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_ |
| OLD | NEW |