Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1073)

Unified Diff: chrome/browser/download/download_util.cc

Issue 6459005: Cancel prerender when we discover a download starting from a page we are prer... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/download/download_util.h ('k') | chrome/browser/prerender/prerender_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_util.cc
===================================================================
--- chrome/browser/download/download_util.cc (revision 74962)
+++ chrome/browser/download/download_util.cc (working copy)
@@ -35,6 +35,7 @@
#include "chrome/browser/history/download_create_info.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/ui/browser.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
}
@@ -749,6 +750,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());
+}
+
int GetUniquePathNumberWithCrDownload(const FilePath& path) {
if (!file_util::PathExists(path) &&
!file_util::PathExists(GetCrDownloadPath(path)))
« no previous file with comments | « chrome/browser/download/download_util.h ('k') | chrome/browser/prerender/prerender_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698