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