Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(718)

Unified Diff: chrome/browser/download/download_service.h

Issue 11574006: Implement chrome.downloads.onDeterminingFilename() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r185803 Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/download_service.h
diff --git a/chrome/browser/download/download_service.h b/chrome/browser/download/download_service.h
index 1c72b29105e0a10debdfdcc2dcb634c3cb085ff4..601b3edcafb9b4a13d8352fae29a45aeeb273f39 100644
--- a/chrome/browser/download/download_service.h
+++ b/chrome/browser/download/download_service.h
@@ -15,6 +15,7 @@
class ChromeDownloadManagerDelegate;
class DownloadHistory;
+class ExtensionDownloadsEventRouter;
class Profile;
namespace content {
@@ -35,6 +36,12 @@ class DownloadService : public ProfileKeyedService {
// no HistoryService for profile.
DownloadHistory* GetDownloadHistory();
+#if !defined(OS_ANDROID)
+ ExtensionDownloadsEventRouter* GetExtensionEventRouter() {
+ return extension_event_router_.get();
+ }
+#endif
+
// Has a download manager been created?
bool HasCreatedDownloadManager();
@@ -65,6 +72,20 @@ class DownloadService : public ProfileKeyedService {
scoped_ptr<DownloadHistory> download_history_;
+ // On Android, GET downloads are not handled by the DownloadManager.
+ // Once we have extensions on android, we probably need the EventRouter
+ // in ContentViewDownloadDelegate which knows about both GET and POST
+ // downloads.
+#if !defined(OS_ANDROID)
+ // The ExtensionDownloadsEventRouter dispatches download creation, change, and
+ // erase events to extensions. Like ChromeDownloadManagerDelegate, it's a
+ // chrome-level concept and its lifetime should match DownloadManager. There
+ // should be a separate EDER for on-record and off-record managers.
+ // There does not appear to be a separate ExtensionSystem for on-record and
+ // off-record profiles, so ExtensionSystem cannot own the EDER.
+ scoped_ptr<ExtensionDownloadsEventRouter> extension_event_router_;
+#endif
+
DISALLOW_COPY_AND_ASSIGN(DownloadService);
};
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate.cc ('k') | chrome/browser/download/download_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698