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

Unified Diff: chrome/renderer/plugins/pdf_plugin_placeholder.cc

Issue 2972123002: Click to Open PDF: Open PDF once View PDF is clicked. (Closed)
Patch Set: remove id since it's not used Created 3 years, 5 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
Index: chrome/renderer/plugins/pdf_plugin_placeholder.cc
diff --git a/chrome/renderer/plugins/pdf_plugin_placeholder.cc b/chrome/renderer/plugins/pdf_plugin_placeholder.cc
index 6e20cfbce38d5d95d2839659ae16a40719d2095a..fcac3d5ea96220b4a6beafb5f4a9b320cea52818 100644
--- a/chrome/renderer/plugins/pdf_plugin_placeholder.cc
+++ b/chrome/renderer/plugins/pdf_plugin_placeholder.cc
@@ -4,7 +4,9 @@
#include "chrome/renderer/plugins/pdf_plugin_placeholder.h"
+#include "chrome/common/render_messages.h"
#include "chrome/grit/renderer_resources.h"
+#include "content/public/renderer/render_thread.h"
#include "gin/object_template_builder.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/webui/jstemplate_builder.h"
@@ -25,6 +27,7 @@ PDFPluginPlaceholder* PDFPluginPlaceholder::CreatePDFPlaceholder(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_PDF_PLUGIN_HTML));
base::DictionaryValue values;
+ values.SetString("fileName", ((GURL)params.url).ExtractFileName());
Lei Zhang 2017/07/07 17:45:45 No C-style casts.
amberwon 2017/07/07 20:44:22 Done.
std::string html_data = webui::GetI18nTemplateHtml(template_html, &values);
return new PDFPluginPlaceholder(render_frame, params, html_data);
}
@@ -41,5 +44,6 @@ gin::ObjectTemplateBuilder PDFPluginPlaceholder::GetObjectTemplateBuilder(
}
void PDFPluginPlaceholder::DownloadPDFCallback() {
- // TODO(amberwon): Implement starting PDF download.
+ content::RenderThread::Get()->Send(
+ new ChromeViewHostMsg_DownloadPDF(routing_id(), GetPluginParams().url));
}

Powered by Google App Engine
This is Rietveld 408576698