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

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

Issue 2961383002: Show a new placeholder for PDF's when plugins are disabled. (Closed)
Patch Set: . Created 3 years, 6 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/renderer/plugins/pdf_plugin_placeholder.h ('k') | chrome/renderer/resources/plugins/pdf_plugin.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..3263551c8f9bbf9fb0f54b346856ffb04d9ffba5
--- /dev/null
+++ b/chrome/renderer/plugins/pdf_plugin_placeholder.cc
@@ -0,0 +1,33 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/renderer/plugins/pdf_plugin_placeholder.h"
+
+#include "chrome/grit/renderer_resources.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/webui/jstemplate_builder.h"
+
+gin::WrapperInfo PDFPluginPlaceholder::kWrapperInfo = {gin::kEmbedderNativeGin};
+
+PDFPluginPlaceholder::PDFPluginPlaceholder(content::RenderFrame* render_frame,
+ const blink::WebPluginParams& params,
+ const std::string& html_data)
+ : plugins::PluginPlaceholderBase(render_frame, params, html_data) {}
+
+PDFPluginPlaceholder::~PDFPluginPlaceholder() {}
+
+PDFPluginPlaceholder* PDFPluginPlaceholder::CreatePDFPlaceholder(
+ content::RenderFrame* render_frame,
+ const blink::WebPluginParams& params) {
+ const base::StringPiece template_html(
+ ResourceBundle::GetSharedInstance().GetRawDataResource(
+ IDR_PDF_PLUGIN_HTML));
+ base::DictionaryValue values;
+ std::string html_data = webui::GetI18nTemplateHtml(template_html, &values);
+ return new PDFPluginPlaceholder(render_frame, params, html_data);
+}
+
+v8::Local<v8::Value> PDFPluginPlaceholder::GetV8Handle(v8::Isolate* isolate) {
+ return gin::CreateHandle(isolate, this).ToV8();
+}
« no previous file with comments | « chrome/renderer/plugins/pdf_plugin_placeholder.h ('k') | chrome/renderer/resources/plugins/pdf_plugin.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698