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