Chromium Code Reviews| Index: chrome/browser/download/download_util.cc |
| =================================================================== |
| --- chrome/browser/download/download_util.cc (revision 74377) |
| +++ chrome/browser/download/download_util.cc (working copy) |
| @@ -36,6 +36,7 @@ |
| #include "chrome/browser/net/chrome_url_request_context.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| +#include "chrome/browser/renderer_host/render_view_host.h" |
| #include "chrome/browser/tab_contents/tab_contents.h" |
| #include "chrome/browser/ui/browser.h" |
| #include "chrome/common/chrome_paths.h" |
| @@ -687,7 +688,7 @@ |
| else if (!progress_known) |
| taskbar->SetProgressState(frame, TBPF_INDETERMINATE); |
| else |
| - taskbar->SetProgressValue(frame, (int)(progress * 100), 100); |
| + taskbar->SetProgressValue(frame, static_cast<int>(progress * 100), 100); |
| } |
| #endif |
| } |
| @@ -740,6 +741,11 @@ |
| render_process_host_id, |
| render_view_id, |
| context); |
| + |
| + BrowserThread::PostTask( |
| + BrowserThread::UI, FROM_HERE, |
| + NewRunnableFunction(&NotifyDownloadInitiated, |
| + render_process_host_id, render_view_id)); |
|
Randy Smith (Not in Mondays)
2011/02/14 19:20:51
See notes elsewhere; this either needs to be moved
dominich
2011/02/15 19:09:19
Done.
|
| } |
| void CancelDownloadRequest(ResourceDispatcherHost* rdh, |
| @@ -749,6 +755,18 @@ |
| rdh->CancelRequest(render_process_id, request_id, false); |
| } |
| +void NotifyDownloadInitiated(int render_process_id, int render_view_id) { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| + RenderViewHost* rvh = RenderViewHost::FromID(render_process_id, |
| + render_view_id); |
| + if (!rvh) |
| + return; |
| + |
| + NotificationService::current()->Notify(NotificationType::DOWNLOAD_INITIATED, |
| + Source<RenderViewHost>(rvh), |
| + NotificationService::NoDetails()); |
|
Randy Smith (Not in Mondays)
2011/02/14 19:20:51
I'm happy with this location and structure.
dominich
2011/02/15 19:09:19
Done.
|
| +} |
| + |
| int GetUniquePathNumberWithCrDownload(const FilePath& path) { |
| if (!file_util::PathExists(path) && |
| !file_util::PathExists(GetCrDownloadPath(path))) |