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 "content/browser/download/download_manager_impl.h" | 5 #include "content/browser/download/download_manager_impl.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 // base::Bind can't handle 7 args, so we use URLParams and RenderParams. | 839 // base::Bind can't handle 7 args, so we use URLParams and RenderParams. |
840 BrowserThread::PostTask( | 840 BrowserThread::PostTask( |
841 BrowserThread::IO, FROM_HERE, | 841 BrowserThread::IO, FROM_HERE, |
842 base::Bind( | 842 base::Bind( |
843 &BeginDownload, | 843 &BeginDownload, |
844 URLParams(url, referrer, post_id), | 844 URLParams(url, referrer, post_id), |
845 prefer_cache, | 845 prefer_cache, |
846 save_info, | 846 save_info, |
847 resource_dispatcher_host, | 847 resource_dispatcher_host, |
848 RenderParams(web_contents->GetRenderProcessHost()->GetID(), | 848 RenderParams(web_contents->GetRenderProcessHost()->GetID(), |
849 web_contents->GetRenderViewHost()->routing_id()), | 849 web_contents->GetRenderViewHost()->GetRoutingID()), |
850 web_contents->GetBrowserContext()->GetResourceContext())); | 850 web_contents->GetBrowserContext()->GetResourceContext())); |
851 } | 851 } |
852 | 852 |
853 void DownloadManagerImpl::AddObserver(Observer* observer) { | 853 void DownloadManagerImpl::AddObserver(Observer* observer) { |
854 observers_.AddObserver(observer); | 854 observers_.AddObserver(observer); |
855 // TODO: It is the responsibility of the observers to query the | 855 // TODO: It is the responsibility of the observers to query the |
856 // DownloadManager. Remove the following call from here and update all | 856 // DownloadManager. Remove the following call from here and update all |
857 // observers. | 857 // observers. |
858 observer->ModelChanged(this); | 858 observer->ModelChanged(this); |
859 } | 859 } |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 it != history_downloads_.end(); ++it) { | 1171 it != history_downloads_.end(); ++it) { |
1172 if (it->second->IsComplete() && !it->second->GetOpened()) | 1172 if (it->second->IsComplete() && !it->second->GetOpened()) |
1173 ++num_unopened; | 1173 ++num_unopened; |
1174 } | 1174 } |
1175 download_stats::RecordOpensOutstanding(num_unopened); | 1175 download_stats::RecordOpensOutstanding(num_unopened); |
1176 } | 1176 } |
1177 | 1177 |
1178 void DownloadManagerImpl::SetFileManager(DownloadFileManager* file_manager) { | 1178 void DownloadManagerImpl::SetFileManager(DownloadFileManager* file_manager) { |
1179 file_manager_ = file_manager; | 1179 file_manager_ = file_manager; |
1180 } | 1180 } |
OLD | NEW |