| 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_DOWNLOAD_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // ChromeDownloadManagerDelegate may be the target of callbacks from | 74 // ChromeDownloadManagerDelegate may be the target of callbacks from |
| 75 // the history service/DB thread and must be kept alive for those | 75 // the history service/DB thread and must be kept alive for those |
| 76 // callbacks. | 76 // callbacks. |
| 77 scoped_ptr<ChromeDownloadManagerDelegate> manager_delegate_; | 77 scoped_ptr<ChromeDownloadManagerDelegate> manager_delegate_; |
| 78 | 78 |
| 79 scoped_ptr<DownloadHistory> download_history_; | 79 scoped_ptr<DownloadHistory> download_history_; |
| 80 | 80 |
| 81 // The UI controller is responsible for observing the download manager and | 81 // The UI controller is responsible for observing the download manager and |
| 82 // notifying the UI of any new downloads. Its lifetime matches that of the | 82 // notifying the UI of any new downloads. Its lifetime matches that of the |
| 83 // associated download manager. | 83 // associated download manager. |
| 84 // Note on destruction order: download_ui_ depends on download_history_ and |
| 85 // should be destroyed before the latter. |
| 84 scoped_ptr<DownloadUIController> download_ui_; | 86 scoped_ptr<DownloadUIController> download_ui_; |
| 85 | 87 |
| 86 // On Android, GET downloads are not handled by the DownloadManager. | 88 // On Android, GET downloads are not handled by the DownloadManager. |
| 87 // Once we have extensions on android, we probably need the EventRouter | 89 // Once we have extensions on android, we probably need the EventRouter |
| 88 // in ContentViewDownloadDelegate which knows about both GET and POST | 90 // in ContentViewDownloadDelegate which knows about both GET and POST |
| 89 // downloads. | 91 // downloads. |
| 90 #if !defined(OS_ANDROID) | 92 #if !defined(OS_ANDROID) |
| 91 // The ExtensionDownloadsEventRouter dispatches download creation, change, and | 93 // The ExtensionDownloadsEventRouter dispatches download creation, change, and |
| 92 // erase events to extensions. Like ChromeDownloadManagerDelegate, it's a | 94 // erase events to extensions. Like ChromeDownloadManagerDelegate, it's a |
| 93 // chrome-level concept and its lifetime should match DownloadManager. There | 95 // chrome-level concept and its lifetime should match DownloadManager. There |
| 94 // should be a separate EDER for on-record and off-record managers. | 96 // should be a separate EDER for on-record and off-record managers. |
| 95 // There does not appear to be a separate ExtensionSystem for on-record and | 97 // There does not appear to be a separate ExtensionSystem for on-record and |
| 96 // off-record profiles, so ExtensionSystem cannot own the EDER. | 98 // off-record profiles, so ExtensionSystem cannot own the EDER. |
| 97 scoped_ptr<ExtensionDownloadsEventRouter> extension_event_router_; | 99 scoped_ptr<ExtensionDownloadsEventRouter> extension_event_router_; |
| 98 #endif | 100 #endif |
| 99 | 101 |
| 100 DISALLOW_COPY_AND_ASSIGN(DownloadService); | 102 DISALLOW_COPY_AND_ASSIGN(DownloadService); |
| 101 }; | 103 }; |
| 102 | 104 |
| 103 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ | 105 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_ |
| OLD | NEW |