| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 manager_delegate_->SetDownloadManager(manager); | 51 manager_delegate_->SetDownloadManager(manager); |
| 52 | 52 |
| 53 #if defined(ENABLE_EXTENSIONS) | 53 #if defined(ENABLE_EXTENSIONS) |
| 54 extension_event_router_.reset( | 54 extension_event_router_.reset( |
| 55 new extensions::ExtensionDownloadsEventRouter(profile_, manager)); | 55 new extensions::ExtensionDownloadsEventRouter(profile_, manager)); |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 if (!profile_->IsOffTheRecord()) { | 58 if (!profile_->IsOffTheRecord()) { |
| 59 HistoryService* history = HistoryServiceFactory::GetForProfile( | 59 HistoryService* history = HistoryServiceFactory::GetForProfile( |
| 60 profile_, Profile::EXPLICIT_ACCESS); | 60 profile_, ServiceAccessType::EXPLICIT_ACCESS); |
| 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. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 // code) when the DownloadManager is shutting down. So we shut it down | 171 // code) when the DownloadManager is shutting down. So we shut it down |
| 172 // manually earlier. See http://crbug.com/131692 | 172 // manually earlier. See http://crbug.com/131692 |
| 173 BrowserContext::GetDownloadManager(profile_)->Shutdown(); | 173 BrowserContext::GetDownloadManager(profile_)->Shutdown(); |
| 174 } | 174 } |
| 175 #if defined(ENABLE_EXTENSIONS) | 175 #if defined(ENABLE_EXTENSIONS) |
| 176 extension_event_router_.reset(); | 176 extension_event_router_.reset(); |
| 177 #endif | 177 #endif |
| 178 manager_delegate_.reset(); | 178 manager_delegate_.reset(); |
| 179 download_history_.reset(); | 179 download_history_.reset(); |
| 180 } | 180 } |
| OLD | NEW |