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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
(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 }
OLDNEW
« 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