| 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 CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_CHROME_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/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 public content::DownloadManagerDelegate, | 44 public content::DownloadManagerDelegate, |
| 45 public content::NotificationObserver { | 45 public content::NotificationObserver { |
| 46 public: | 46 public: |
| 47 explicit ChromeDownloadManagerDelegate(Profile* profile); | 47 explicit ChromeDownloadManagerDelegate(Profile* profile); |
| 48 | 48 |
| 49 void SetDownloadManager(content::DownloadManager* dm); | 49 void SetDownloadManager(content::DownloadManager* dm); |
| 50 | 50 |
| 51 // Returns true if the given item is for an extension download. | 51 // Returns true if the given item is for an extension download. |
| 52 static bool IsExtensionDownload(const content::DownloadItem* item); | 52 static bool IsExtensionDownload(const content::DownloadItem* item); |
| 53 | 53 |
| 54 static void DisableSafeBrowsing(content::DownloadItem* item); |
| 55 |
| 54 virtual void Shutdown() OVERRIDE; | 56 virtual void Shutdown() OVERRIDE; |
| 55 virtual content::DownloadId GetNextId() OVERRIDE; | 57 virtual content::DownloadId GetNextId() OVERRIDE; |
| 56 virtual bool ShouldStartDownload(int32 download_id) OVERRIDE; | 58 virtual bool ShouldStartDownload(int32 download_id) OVERRIDE; |
| 57 virtual void ChooseDownloadPath(content::WebContents* web_contents, | 59 virtual void ChooseDownloadPath(content::WebContents* web_contents, |
| 58 const FilePath& suggested_path, | 60 const FilePath& suggested_path, |
| 59 int32 download_id) OVERRIDE; | 61 int32 download_id) OVERRIDE; |
| 60 virtual FilePath GetIntermediatePath(const FilePath& suggested_path) OVERRIDE; | 62 virtual FilePath GetIntermediatePath(const FilePath& suggested_path) OVERRIDE; |
| 61 virtual content::WebContents* | 63 virtual content::WebContents* |
| 62 GetAlternativeWebContentsToNotifyForDownload() OVERRIDE; | 64 GetAlternativeWebContentsToNotifyForDownload() OVERRIDE; |
| 63 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) OVERRIDE; | 65 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) OVERRIDE; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 76 base::Time remove_begin, | 78 base::Time remove_begin, |
| 77 base::Time remove_end) OVERRIDE; | 79 base::Time remove_end) OVERRIDE; |
| 78 virtual void GetSaveDir(content::WebContents* web_contents, | 80 virtual void GetSaveDir(content::WebContents* web_contents, |
| 79 FilePath* website_save_dir, | 81 FilePath* website_save_dir, |
| 80 FilePath* download_save_dir) OVERRIDE; | 82 FilePath* download_save_dir) OVERRIDE; |
| 81 virtual void ChooseSavePath( | 83 virtual void ChooseSavePath( |
| 82 content::WebContents* web_contents, | 84 content::WebContents* web_contents, |
| 83 const FilePath& suggested_path, | 85 const FilePath& suggested_path, |
| 84 const FilePath::StringType& default_extension, | 86 const FilePath::StringType& default_extension, |
| 85 bool can_save_as_complete, | 87 bool can_save_as_complete, |
| 86 content::SaveFilePathPickedCallback callback) OVERRIDE; | 88 const content::SavePackagePathPickedCallback& callback) OVERRIDE; |
| 87 | 89 |
| 88 DownloadPrefs* download_prefs() { return download_prefs_.get(); } | 90 DownloadPrefs* download_prefs() { return download_prefs_.get(); } |
| 89 DownloadHistory* download_history() { return download_history_.get(); } | 91 DownloadHistory* download_history() { return download_history_.get(); } |
| 90 | 92 |
| 91 protected: | 93 protected: |
| 92 // So that test classes can inherit from this for override purposes. | 94 // So that test classes can inherit from this for override purposes. |
| 93 virtual ~ChromeDownloadManagerDelegate(); | 95 virtual ~ChromeDownloadManagerDelegate(); |
| 94 | 96 |
| 95 // So that test classes that inherit from this for override purposes | 97 // So that test classes that inherit from this for override purposes |
| 96 // can call back into the DownloadManager. | 98 // can call back into the DownloadManager. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // Maps from pending extension installations to DownloadItem IDs. | 163 // Maps from pending extension installations to DownloadItem IDs. |
| 162 typedef base::hash_map<CrxInstaller*, int> CrxInstallerMap; | 164 typedef base::hash_map<CrxInstaller*, int> CrxInstallerMap; |
| 163 CrxInstallerMap crx_installers_; | 165 CrxInstallerMap crx_installers_; |
| 164 | 166 |
| 165 content::NotificationRegistrar registrar_; | 167 content::NotificationRegistrar registrar_; |
| 166 | 168 |
| 167 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); | 169 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); |
| 168 }; | 170 }; |
| 169 | 171 |
| 170 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ | 172 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ |
| OLD | NEW |