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

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: Forgot parentheses 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 "ui/base/resource/resource_bundle.h"
8 #include "ui/base/webui/jstemplate_builder.h"
9
10 gin::WrapperInfo PDFPluginPlaceholder::kWrapperInfo = {gin::kEmbedderNativeGin};
11
12 PDFPluginPlaceholder::PDFPluginPlaceholder(content::RenderFrame* render_frame,
13 const blink::WebPluginParams& params,
14 const std::string& html_data)
15 : plugins::PluginPlaceholderBase(render_frame, params, html_data) {}
16
17 PDFPluginPlaceholder::~PDFPluginPlaceholder() {}
18
19 PDFPluginPlaceholder* PDFPluginPlaceholder::CreateBlockedPlugin(
20 content::RenderFrame* render_frame,
21 const blink::WebPluginParams& params,
22 int template_id) {
23 const base::StringPiece template_html(
24 ResourceBundle::GetSharedInstance().GetRawDataResource(template_id));
25 base::DictionaryValue values;
26 std::string html_data = webui::GetI18nTemplateHtml(template_html, &values);
27 return new PDFPluginPlaceholder(render_frame, params, html_data);
28 }
29
30 v8::Local<v8::Value> PDFPluginPlaceholder::GetV8Handle(v8::Isolate* isolate) {
31 return gin::CreateHandle(isolate, this).ToV8();
32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698