OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/task.h" | 13 #include "base/task.h" |
| 14 #include "chrome/browser/safe_browsing/download_protection_service.h" |
14 #include "content/browser/download/download_manager_delegate.h" | 15 #include "content/browser/download/download_manager_delegate.h" |
15 #include "content/common/notification_observer.h" | 16 #include "content/common/notification_observer.h" |
16 #include "content/common/notification_registrar.h" | 17 #include "content/common/notification_registrar.h" |
17 | 18 |
18 class CrxInstaller; | 19 class CrxInstaller; |
19 class DownloadHistory; | 20 class DownloadHistory; |
20 class DownloadItem; | 21 class DownloadItem; |
21 class DownloadManager; | 22 class DownloadManager; |
22 class DownloadPrefs; | 23 class DownloadPrefs; |
23 class Profile; | 24 class Profile; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 const DownloadStateInfo& state, | 128 const DownloadStateInfo& state, |
128 bool visited_referrer_before); | 129 bool visited_referrer_before); |
129 | 130 |
130 // Callback from history system. | 131 // Callback from history system. |
131 void OnItemAddedToPersistentStore(int32 download_id, int64 db_handle); | 132 void OnItemAddedToPersistentStore(int32 download_id, int64 db_handle); |
132 | 133 |
133 // Callback function after download file hash is checked with safebrowsing | 134 // Callback function after download file hash is checked with safebrowsing |
134 // service. | 135 // service. |
135 void CheckDownloadHashDone(int32 download_id, bool is_dangerous_hash); | 136 void CheckDownloadHashDone(int32 download_id, bool is_dangerous_hash); |
136 | 137 |
| 138 // Callback function after the DownloadProtectionService completes. |
| 139 void CheckClientDownloadDone( |
| 140 DownloadItem* item, |
| 141 safe_browsing::DownloadProtectionService::DownloadCheckResult result); |
| 142 |
137 Profile* profile_; | 143 Profile* profile_; |
138 scoped_ptr<DownloadPrefs> download_prefs_; | 144 scoped_ptr<DownloadPrefs> download_prefs_; |
139 scoped_ptr<DownloadHistory> download_history_; | 145 scoped_ptr<DownloadHistory> download_history_; |
140 | 146 |
141 // Maps from pending extension installations to DownloadItem IDs. | 147 // Maps from pending extension installations to DownloadItem IDs. |
142 typedef base::hash_map<CrxInstaller*, int> CrxInstallerMap; | 148 typedef base::hash_map<CrxInstaller*, int> CrxInstallerMap; |
143 CrxInstallerMap crx_installers_; | 149 CrxInstallerMap crx_installers_; |
144 | 150 |
145 NotificationRegistrar registrar_; | 151 NotificationRegistrar registrar_; |
146 | 152 |
147 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); | 153 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); |
148 }; | 154 }; |
149 | 155 |
150 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ | 156 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ |
OLD | NEW |