| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/renderer/plugins/pdf_plugin_placeholder.h" |
| 6 |
| 7 #include "chrome/grit/renderer_resources.h" |
| 8 #include "ui/base/resource/resource_bundle.h" |
| 9 #include "ui/base/webui/jstemplate_builder.h" |
| 10 |
| 11 gin::WrapperInfo PDFPluginPlaceholder::kWrapperInfo = {gin::kEmbedderNativeGin}; |
| 12 |
| 13 PDFPluginPlaceholder::PDFPluginPlaceholder(content::RenderFrame* render_frame, |
| 14 const blink::WebPluginParams& params, |
| 15 const std::string& html_data) |
| 16 : plugins::PluginPlaceholderBase(render_frame, params, html_data) {} |
| 17 |
| 18 PDFPluginPlaceholder::~PDFPluginPlaceholder() {} |
| 19 |
| 20 PDFPluginPlaceholder* PDFPluginPlaceholder::CreatePDFPlaceholder( |
| 21 content::RenderFrame* render_frame, |
| 22 const blink::WebPluginParams& params) { |
| 23 const base::StringPiece template_html( |
| 24 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 25 IDR_PDF_PLUGIN_HTML)); |
| 26 base::DictionaryValue values; |
| 27 std::string html_data = webui::GetI18nTemplateHtml(template_html, &values); |
| 28 return new PDFPluginPlaceholder(render_frame, params, html_data); |
| 29 } |
| 30 |
| 31 v8::Local<v8::Value> PDFPluginPlaceholder::GetV8Handle(v8::Isolate* isolate) { |
| 32 return gin::CreateHandle(isolate, this).ToV8(); |
| 33 } |
| OLD | NEW |