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 30 matching lines...) Expand all Loading... |
41 // This is the Chrome side helper for the download system. | 41 // This is the Chrome side helper for the download system. |
42 class ChromeDownloadManagerDelegate | 42 class ChromeDownloadManagerDelegate |
43 : public base::RefCountedThreadSafe<ChromeDownloadManagerDelegate>, | 43 : public base::RefCountedThreadSafe<ChromeDownloadManagerDelegate>, |
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. | |
52 static bool IsExtensionDownload(const content::DownloadItem* item); | |
53 | |
54 // Should be called before the first call to ShouldCompleteDownload() to | 51 // Should be called before the first call to ShouldCompleteDownload() to |
55 // disable SafeBrowsing checks for |item|. | 52 // disable SafeBrowsing checks for |item|. |
56 static void DisableSafeBrowsing(content::DownloadItem* item); | 53 static void DisableSafeBrowsing(content::DownloadItem* item); |
57 | 54 |
58 virtual void Shutdown() OVERRIDE; | 55 virtual void Shutdown() OVERRIDE; |
59 virtual content::DownloadId GetNextId() OVERRIDE; | 56 virtual content::DownloadId GetNextId() OVERRIDE; |
60 virtual bool ShouldStartDownload(int32 download_id) OVERRIDE; | 57 virtual bool ShouldStartDownload(int32 download_id) OVERRIDE; |
61 virtual void ChooseDownloadPath(content::WebContents* web_contents, | 58 virtual void ChooseDownloadPath(content::WebContents* web_contents, |
62 const FilePath& suggested_path, | 59 const FilePath& suggested_path, |
63 int32 download_id) OVERRIDE; | 60 int32 download_id) OVERRIDE; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // Maps from pending extension installations to DownloadItem IDs. | 172 // Maps from pending extension installations to DownloadItem IDs. |
176 typedef base::hash_map<CrxInstaller*, int> CrxInstallerMap; | 173 typedef base::hash_map<CrxInstaller*, int> CrxInstallerMap; |
177 CrxInstallerMap crx_installers_; | 174 CrxInstallerMap crx_installers_; |
178 | 175 |
179 content::NotificationRegistrar registrar_; | 176 content::NotificationRegistrar registrar_; |
180 | 177 |
181 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); | 178 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); |
182 }; | 179 }; |
183 | 180 |
184 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ | 181 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ |
OLD | NEW |