| 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" |
| 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/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "chrome/browser/safe_browsing/download_protection_service.h" | 14 #include "chrome/browser/safe_browsing/download_protection_service.h" |
| 15 #include "content/public/browser/download_danger_type.h" | 15 #include "content/public/browser/download_danger_type.h" |
| 16 #include "content/public/browser/download_item.h" | 16 #include "content/public/browser/download_item.h" |
| 17 #include "content/public/browser/download_manager_delegate.h" | 17 #include "content/public/browser/download_manager_delegate.h" |
| 18 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
| 19 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
| 20 | 20 |
| 21 class CrxInstaller; | 21 class CrxInstaller; |
| 22 class DownloadHistory; | 22 class DownloadHistory; |
| 23 class DownloadPrefs; | 23 class DownloadPrefs; |
| 24 class ExtensionDownloadsEventRouter; |
| 24 class Profile; | 25 class Profile; |
| 25 | 26 |
| 26 namespace content { | 27 namespace content { |
| 27 class DownloadManager; | 28 class DownloadManager; |
| 28 } | 29 } |
| 29 | 30 |
| 30 #if defined(COMPILER_GCC) | 31 #if defined(COMPILER_GCC) |
| 31 namespace BASE_HASH_NAMESPACE { | 32 namespace BASE_HASH_NAMESPACE { |
| 32 template<> | 33 template<> |
| 33 struct hash<CrxInstaller*> { | 34 struct hash<CrxInstaller*> { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 int next_download_id_; | 195 int next_download_id_; |
| 195 scoped_ptr<DownloadPrefs> download_prefs_; | 196 scoped_ptr<DownloadPrefs> download_prefs_; |
| 196 scoped_ptr<DownloadHistory> download_history_; | 197 scoped_ptr<DownloadHistory> download_history_; |
| 197 | 198 |
| 198 // Maps from pending extension installations to DownloadItem IDs. | 199 // Maps from pending extension installations to DownloadItem IDs. |
| 199 typedef base::hash_map<CrxInstaller*, int> CrxInstallerMap; | 200 typedef base::hash_map<CrxInstaller*, int> CrxInstallerMap; |
| 200 CrxInstallerMap crx_installers_; | 201 CrxInstallerMap crx_installers_; |
| 201 | 202 |
| 202 content::NotificationRegistrar registrar_; | 203 content::NotificationRegistrar registrar_; |
| 203 | 204 |
| 205 // The ExtensionDownloadsEventRouter dispatches download creation, change, and |
| 206 // erase events to extensions. Like ChromeDownloadManagerDelegate, it's a |
| 207 // chrome-level concept and its lifetime should match DownloadManager. There |
| 208 // should be a separate EDER for on-record and off-record managers. |
| 209 // There does not appear to be a separate ExtensionSystem for on-record and |
| 210 // off-record profiles, so ExtensionSystem cannot own the EDER. |
| 211 scoped_ptr<ExtensionDownloadsEventRouter> extension_event_router_; |
| 212 |
| 204 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); | 213 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); |
| 205 }; | 214 }; |
| 206 | 215 |
| 207 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ | 216 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ |
| OLD | NEW |