| 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 #include "chrome/browser/download/download_service.h" | 5 #include "chrome/browser/download/download_service.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 9 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| 10 #include "chrome/browser/download/download_history.h" | 10 #include "chrome/browser/download/download_history.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 history->GetNextDownloadId( | 61 history->GetNextDownloadId( |
| 62 manager_delegate_->GetDownloadIdReceiverCallback()); | 62 manager_delegate_->GetDownloadIdReceiverCallback()); |
| 63 download_history_.reset(new DownloadHistory( | 63 download_history_.reset(new DownloadHistory( |
| 64 manager, | 64 manager, |
| 65 scoped_ptr<DownloadHistory::HistoryAdapter>( | 65 scoped_ptr<DownloadHistory::HistoryAdapter>( |
| 66 new DownloadHistory::HistoryAdapter(history)))); | 66 new DownloadHistory::HistoryAdapter(history)))); |
| 67 } | 67 } |
| 68 | 68 |
| 69 // Pass an empty delegate when constructing the DownloadUIController. The | 69 // Pass an empty delegate when constructing the DownloadUIController. The |
| 70 // default delegate does all the notifications we need. | 70 // default delegate does all the notifications we need. |
| 71 download_ui_.reset(new DownloadUIController( | 71 download_ui_.reset(new DownloadUIController(manager)); |
| 72 manager, scoped_ptr<DownloadUIController::Delegate>())); | |
| 73 | 72 |
| 74 // Include this download manager in the set monitored by the | 73 // Include this download manager in the set monitored by the |
| 75 // global status updater. | 74 // global status updater. |
| 76 g_browser_process->download_status_updater()->AddManager(manager); | 75 g_browser_process->download_status_updater()->AddManager(manager); |
| 77 | 76 |
| 78 return manager_delegate_.get(); | 77 return manager_delegate_.get(); |
| 79 } | 78 } |
| 80 | 79 |
| 81 DownloadHistory* DownloadService::GetDownloadHistory() { | 80 DownloadHistory* DownloadService::GetDownloadHistory() { |
| 82 if (!download_manager_created_) { | 81 if (!download_manager_created_) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 // code) when the DownloadManager is shutting down. So we shut it down | 170 // code) when the DownloadManager is shutting down. So we shut it down |
| 172 // manually earlier. See http://crbug.com/131692 | 171 // manually earlier. See http://crbug.com/131692 |
| 173 BrowserContext::GetDownloadManager(profile_)->Shutdown(); | 172 BrowserContext::GetDownloadManager(profile_)->Shutdown(); |
| 174 } | 173 } |
| 175 #if defined(ENABLE_EXTENSIONS) | 174 #if defined(ENABLE_EXTENSIONS) |
| 176 extension_event_router_.reset(); | 175 extension_event_router_.reset(); |
| 177 #endif | 176 #endif |
| 178 manager_delegate_.reset(); | 177 manager_delegate_.reset(); |
| 179 download_history_.reset(); | 178 download_history_.reset(); |
| 180 } | 179 } |
| OLD | NEW |