summaryrefslogtreecommitdiffstats
path: root/content/browser/download/mhtml_generation_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/download/mhtml_generation_manager.cc')
-rw-r--r--content/browser/download/mhtml_generation_manager.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/content/browser/download/mhtml_generation_manager.cc b/content/browser/download/mhtml_generation_manager.cc
index 82948735..7a63009 100644
--- a/content/browser/download/mhtml_generation_manager.cc
+++ b/content/browser/download/mhtml_generation_manager.cc
@@ -29,8 +29,7 @@ MHTMLGenerationManager::~MHTMLGenerationManager() {
}
void MHTMLGenerationManager::GenerateMHTML(TabContents* tab_contents,
- const FilePath& file,
- const GenerateMHTMLCallback& callback) {
+ const FilePath& file) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
static int id_counter = 0;
@@ -39,7 +38,6 @@ void MHTMLGenerationManager::GenerateMHTML(TabContents* tab_contents,
job.file_path = file;
job.process_id = tab_contents->GetRenderProcessHost()->GetID();
job.routing_id = tab_contents->render_view_host()->routing_id();
- job.callback = callback;
id_to_job_[job_id] = job;
base::ProcessHandle renderer_process =
@@ -111,7 +109,18 @@ void MHTMLGenerationManager::JobFinished(int job_id, int64 file_size) {
}
Job& job = iter->second;
- job.callback.Run(job.file_path, file_size);
+
+ RenderViewHost* rvh = RenderViewHost::FromID(job.process_id, job.routing_id);
+ if (rvh) {
+ NotificationDetails details;
+ details.file_path = job.file_path;
+ details.file_size = file_size;
+
+ content::NotificationService::current()->Notify(
+ content::NOTIFICATION_MHTML_GENERATED,
+ content::Source<RenderViewHost>(rvh),
+ content::Details<NotificationDetails>(&details));
+ }
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
base::Bind(&MHTMLGenerationManager::CloseFile, this, job.browser_file));